mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
cache stuff does not compile. just saving lots of coding i've done.
Completed most of the coding for first new cache service, need to fix compile errors and test. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-new_cache_system@5330 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b2c74a045f
commit
d50ecd145f
20 changed files with 775 additions and 263 deletions
56
libretroshare/src/gxs/gxscoreserver.cc
Normal file
56
libretroshare/src/gxs/gxscoreserver.cc
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* gxscoreserver.cpp
|
||||
*
|
||||
* Created on: 24 Jul 2012
|
||||
* Author: crispy
|
||||
*/
|
||||
|
||||
#include "gxscoreserver.h"
|
||||
|
||||
GxsCoreServer::GxsCoreServer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
GxsCoreServer::~GxsCoreServer()
|
||||
{
|
||||
|
||||
std::set<RsGxsService*>::iterator sit;
|
||||
|
||||
for(sit = mGxsServices.begin(); sit != mGxsServices.end(); sit++)
|
||||
delete *sit;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GxsCoreServer::run()
|
||||
{
|
||||
std::set<RsGxsService*>::iterator sit;
|
||||
|
||||
double timeDelta = 0.2;
|
||||
|
||||
while(isRunning())
|
||||
{
|
||||
|
||||
#ifndef WINDOWS_SYS
|
||||
usleep((int) (timeDelta * 1000000));
|
||||
#else
|
||||
Sleep((int) (timeDelta * 1000));
|
||||
#endif
|
||||
|
||||
for(sit = mGxsServices.begin(); sit != mGxsServices.end(); sit++)
|
||||
(*sit)->tick();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void GxsCoreServer::addService(RsGxsService* service)
|
||||
{
|
||||
mGxsServices.insert(service);
|
||||
}
|
||||
|
||||
bool GxsCoreServer::removeService(RsGxsService* service)
|
||||
{
|
||||
return (mGxsServices.erase(service) > 0);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue