Mixe for Privacy and Anonymity in the Internet
Classes | Defines | Typedefs | Functions
CAReplayDatabase.hpp File Reference
#include "CAMutex.hpp"
#include "CAThread.hpp"
Include dependency graph for CAReplayDatabase.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __t_replay_database_entry
struct  __t_replay_database_heap
struct  __t_database_info
class  CAReplayDatabase

Defines

#define REPLAY_DB_ENTRIES_PER_HEAP   1000
#define SECONDS_PER_INTERVALL   600

Typedefs

typedef struct
__t_replay_database_entry 
t_replay_databaseEntry
typedef t_replay_databaseEntryLP_replay_databaseEntry
typedef struct
__t_replay_database_heap 
t_replay_databaseHeap
typedef struct __t_database_info t_replay_databaseInfo

Functions

THREAD_RETURN replaydb_loopMaintenance (void *param)

Define Documentation

#define REPLAY_DB_ENTRIES_PER_HEAP   1000

Definition at line 42 of file CAReplayDatabase.hpp.

Referenced by CAReplayDatabase::getNewDBEntry().

#define SECONDS_PER_INTERVALL   600

Definition at line 60 of file CAReplayDatabase.hpp.

Referenced by CAReplayDatabase::getTimeForReplayTimestamp().


Typedef Documentation

Definition at line 40 of file CAReplayDatabase.hpp.


Function Documentation

Definition at line 175 of file CAReplayDatabase.cpp.

References BEGIN_STACK, FINISH_STACK, CAReplayDatabase::getCurrentReplayTimestamp(), INIT_STACK, t_replay_timestamp::interval, CAReplayDatabase::m_bRun, CAReplayDatabase::m_currentClock, CAReplayDatabase::m_refTime, CAReplayDatabase::nextClock(), SECONDS_PER_INTERVALL, sSleep(), and THREAD_RETURN_SUCCESS.

  {
    INIT_STACK;
    BEGIN_STACK("CADatabase::db_loopMaintenance");
    
    CAReplayDatabase* pDatabase=(CAReplayDatabase*)param;
    tReplayTimestamp rt;
    pDatabase->getCurrentReplayTimestamp(rt);
    pDatabase->m_currentClock=rt.interval;
    while(pDatabase->m_bRun)
      {
        sSleep(10);
        SINT32 secondsTilNextClock=((pDatabase->m_currentClock+1)*SECONDS_PER_INTERVALL)+pDatabase->m_refTime-time(NULL);
        if(secondsTilNextClock<=0&&pDatabase->m_bRun)
          pDatabase->nextClock();
      }
      
    FINISH_STACK("CADatabase::db_loopMaintenance");
      
    THREAD_RETURN_SUCCESS;
  }

Here is the call graph for this function: