DRDE/AusRegCliever/include/masterDaemon.h

90 lines
2.5 KiB
C
Raw Normal View History

2014-01-03 08:27:31 +00:00
#ifndef MASTER_DAEMON
#define MASTER_DAEMON
/*! \brief masterDaemon
* server core.
*
* Two Process Layers: one to n EPP Servers and one to n EPP Clients.
2014-01-03 08:27:31 +00:00
*/
#ifdef MD_CORE
class masterDaemon *thisService;
#else
extern class masterDaemon *thisService;
#endif
using boost::asio::ip::udp;
class masterDaemon : public mdProcess,
public Listener<mdAttention>,
public Listener<mdCDPulse>,
public Listener<mdClientBirth>,
public Listener<mdClientDeath>,
public Listener<mdIncoming>,
public Listener<mdResponse>,
public Listener<mdAPIFrame>,
public Listener<mdHostCommand> {
2014-01-03 08:27:31 +00:00
public:
bool shuttingDown;
boost::asio::io_service io_;
int arCycles,
apiClients[MAX_CLIENTS],
eppPeers[MAX_PEER],
nClievers,
received,
2014-01-03 08:27:31 +00:00
sentCommands;
2014-01-15 16:44:02 +00:00
#if ARTKENABLED > 0
2014-01-08 05:00:04 +00:00
ausRegEPPTK *artk;
2014-01-15 16:44:02 +00:00
#endif
2014-01-03 08:27:31 +00:00
masterDaemonConfig *cfg;
mdDGChannel *bg,*fg;
std::string clievers[MAX_CLIEVER];
masterDaemon();
~masterDaemon() {}
masterDaemon(masterDaemonConfig *cmdCfg) { int i;
thisService = this;
cfg = cmdCfg;
nClievers = 0;
shuttingDown = false;
memset(apiClients,0,sizeof(apiClients));
memset(eppPeers,0,sizeof(eppPeers));
2014-01-03 08:27:31 +00:00
}
int getDeviceHandle(int deviceMajor,std::string &deviceMinor) {};
2014-01-08 05:00:04 +00:00
int initAusRegTK(void);
2014-01-03 08:27:31 +00:00
int initDataLayer(void);
int releaseDevice(int handle) {return( -1);}
int validateHandleForCmds(int handle) {return(-1);}
void dispatch(mdWQitem*);
void dispatch(const mdIncoming&);
void listen();
void * fetchCommands(std::string subSystem) {};
2014-01-03 08:27:31 +00:00
virtual void processEvent(const mdAttention &ev);
virtual void processEvent(const mdCDPulse &ev);
virtual void processEvent(const mdClientBirth &ev);
virtual void processEvent(const mdClientDeath &ev);
virtual void processEvent(const mdIncoming &ev);
virtual void processEvent(const mdResponse &ev);
virtual void processEvent(const mdAPIFrame &ev);
virtual void processEvent(const mdHostCommand &ev);
2014-01-03 08:27:31 +00:00
void run();
};
#endif