/common/home/bel/bella/lnx/exports/build/current/all/central-services/cap/srvr/client.hh

00001 #ifndef CLIENT_HH
00002 #define CLIENT_HH
00003 
00004 #include <alarm.hh>
00005 
00006 #include "asrvr.h"
00007 #include "ix_tools.h"
00008 
00009 
00010 using namespace AccAlarm;
00011 
00012 namespace Asrvr
00013 {
00014 
00015 class AlarmClient
00016 {
00017 
00018   public:
00019 
00020 
00021     // constructor
00022     AlarmClient( ix_tcp_client_t *p );
00023 
00024     // destructor
00025     virtual ~AlarmClient();
00026 
00027     // name
00028     char *getName(void);
00029 
00030     // key of client
00031     ix_tcp_client_t *getClient(void);
00032 
00033     // set status of connection
00034     int setConnected( bool status );
00035 
00036     // get status of connection
00037     bool getConnected(void);
00038 
00039     // push alarm through client filters to send-queue
00040     void filter( Alarm *palarm );
00041 
00042     // add filter
00043     int addFilter( as_filter_t *pfilter );
00044 
00045     // delete filter
00046     int delFilter( as_filter_t *pfilter );
00047 
00048     // delete filter
00049     int setFilter( as_filter_t *pfilter, int nfilter );
00050 
00051     // flush the send-queue to client
00052     virtual void flush(void) = 0;
00053 
00054     // get the count of the send queue
00055     virtual int getQueueCount(void) = 0;
00056 
00057     // get the average count of the send queue
00058     virtual int getQueueCountAvg(void) = 0;
00059 
00060     // free alarm 
00061     void freeAlarm( Alarm *pAlarm );
00062 
00063     // 
00064     Alarm *eatAlarmQueue(void);
00065 
00066     // 
00067     int feedAlarmQueue(Alarm *pAlarm);
00068 
00069     // ... to be extended
00070     Alarm *pAlarm;
00071 
00072   protected:
00073 
00074     // outgoing alarm queue which is fed in the filter operation
00075     // and  eaten up in the flush operation
00076     ix_queue_t *palarm_queue_out;
00077 
00078     // connection handle to alarm client
00079     ix_tcp_client_t *pclient;
00080 
00081     bool _connected;
00082 
00083     bool _channelBroken;
00084 
00085     ix_thread_t *pSendThread;
00086 
00087     long long int _sendAlarms;
00088 
00089   private:
00090     // filter list of client
00091     ix_list_t *pfilter_list;
00092 
00093 };
00094 
00095 
00096 }
00097 
00098 
00099 #endif

Generated on 4 Mar 2014 for asrvr by  doxygen 1.4.7