00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __communicable_h
00010 #define __communicable_h
00011
00012 #include <semaphore.h>
00013
00014 typedef unsigned COMM_ID;
00015
00016 class Communicable {
00017
00018 public :
00019
00020 Communicable ();
00021
00022 virtual ~ Communicable ();
00023
00024 COMM_ID getKey ();
00025
00026 void lock ();
00027 void unlock ();
00028
00029 void stop ();
00030 void resume ();
00031
00032 protected :
00033
00034 COMM_ID key;
00035
00036 sem_t sem_lock;
00037
00038 sem_t sem_stop;
00039
00040 static unsigned num_comm;
00041 };
00042
00043 extern Communicable * getCommunicable (COMM_ID __key);
00044
00045
00046
00047 #endif