96 lines
2.4 KiB
C++
96 lines
2.4 KiB
C++
#include <cassert>
|
|
#include <cstdarg>
|
|
#include <cstdlib>
|
|
#include <iostream>
|
|
#include <boost/thread.hpp>
|
|
#include <boost/asio.hpp>
|
|
#include <boost/bind.hpp>
|
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
|
#include <boost/statechart/event.hpp>
|
|
#include <boost/statechart/state_machine.hpp>
|
|
#include <boost/statechart/simple_state.hpp>
|
|
#include <boost/statechart/transition.hpp>
|
|
#include <boost/interprocess/shared_memory_object.hpp>
|
|
#include <boost/interprocess/mapped_region.hpp>
|
|
|
|
#include <msgpack.hpp>
|
|
|
|
#include <Category.hh>
|
|
#include <FileAppender.hh>
|
|
#include <PatternLayout.hh>
|
|
|
|
#include "Listener.h"
|
|
#include "EventSender.h"
|
|
#include "TimeStampedEvent.h"
|
|
#include "PolymorphEvent.h"
|
|
|
|
#include <map>
|
|
#include <utility>
|
|
#include <map>
|
|
#include <string>
|
|
#include <queue>
|
|
|
|
#define CLIEVER
|
|
|
|
#define CLIEVER_APP " ausreg-cd "
|
|
#define MD_COMPONENT "Client Daemon" // Cliever Component
|
|
#define MD_NAME CLIEVER_APP " " MD_COMPONENT
|
|
#define MD_VERSION " 1.0 " // Version
|
|
#define MD_DEFAULT_IP "188.138.106.163"
|
|
|
|
#include "mdcommon.h"
|
|
|
|
#include "cdEvents.h"
|
|
#include "mdCommander.h"
|
|
|
|
#include "mdBehavior.h"
|
|
#include "mdState.h"
|
|
|
|
|
|
#define CD_EPOCH date()
|
|
#define CD_GLOBAL_SIZE 4096
|
|
#define CD_LOCK_FILE "ausreg-cd.lock"
|
|
#define CD_NAME CLIEVER_APP " ausreg-cd"
|
|
#define CD_VERSION "1.0"
|
|
#define CD_REFRESH MD_HEARTBEAT // default milliseconds between telemetry frame updates
|
|
#define CD_MAX_DEVICE 4 // including ourselves
|
|
|
|
|
|
#include "clientDaemonConfig.h"
|
|
|
|
typedef std::map<std::string,mdOperationalDataElement*> ODEsOfInterest;
|
|
|
|
#include "cdLogger.h"
|
|
|
|
class cdapiLayer;
|
|
class mdCliever;
|
|
|
|
|
|
#ifdef CD_MAIN
|
|
|
|
ac_cd_global *gm;
|
|
boost::asio::io_service io_bg,io_fg;
|
|
cdLogger theseLogs;
|
|
clientDaemonConfig *thisConfig;
|
|
mdCliever *thisCliever;
|
|
|
|
|
|
extern void runAPILayer();
|
|
extern void runCliever();
|
|
extern void shutdown();
|
|
|
|
#else
|
|
|
|
extern ac_cd_global *gm;
|
|
extern boost::asio::io_service io_bg,io_fg;
|
|
extern const char *cdOrTk;
|
|
extern cdLogger theseLogs;
|
|
extern clientDaemonConfig *thisConfig;
|
|
extern mdCliever *thisCliever;
|
|
|
|
|
|
#endif
|
|
|
|
#include "clientDaemon.h"
|
|
|