Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

LiveBroadcastTable.h

Go to the documentation of this file.
00001 #ifndef __LIVEBROADCASTTABLE_H
00002 #define __LIVEBROADCASTTABLE_H
00003 
00004 #include <sys/types.h>
00005 #include <pthread.h>
00006 #include "GlobalConstants.h"
00007 
00008 class NodeId
00009 {
00010 public:
00011         NodeId(unsigned int id, Node *fromNode)
00012         {
00013                 this->id = id;
00014                 this->fromNode = fromNode;
00015         }
00016 
00017     friend class LiveBroadcastTable;
00018 
00019 private:
00021     unsigned int id;
00022     
00024         Node* fromNode;         
00025 };
00026 
00027 class LiveBroadcastTable : public BasicObject
00028 {
00029 public:
00030         LiveBroadcastTable();
00031         virtual ~LiveBroadcastTable();
00032         void addId(unsigned int id, Node* from);
00033         bool hasId(unsigned int id, Node** from);
00034     bool hasNode(Node*);
00035     int nodeCount(Node*);
00036         static void* onTick(void*);
00037     virtual void toStream(std::ostream&);
00038 
00039 protected:
00040     typedef vector<NodeId> TimeSlice;
00041         vector< TimeSlice > m_broadcastId;
00042         int m_curPos;
00043         bool m_dead;
00044     pthread_t m_liveBroadcastThreadId;
00045     Mutex m_lock;
00046     Condition m_cond;
00047 };
00048 
00049 #endif

Generated at Thu Jul 11 13:31:50 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001