50 lines
910 B
C++
50 lines
910 B
C++
#ifndef CDUTILS_CORE_H
|
|
#define CDUTILS_CORE_H
|
|
|
|
#include "cdutils_k_types.h"
|
|
#include "piconnection.h"
|
|
#include "pidatatransfer.h"
|
|
|
|
|
|
namespace CDUtils {
|
|
|
|
class Core;
|
|
|
|
|
|
class __Core_Initializer__ {
|
|
public:
|
|
__Core_Initializer__();
|
|
~__Core_Initializer__();
|
|
static int count_;
|
|
static Core * __instance__;
|
|
};
|
|
|
|
|
|
class Core: public PIObject
|
|
{
|
|
PIOBJECT(CDUtils::Core)
|
|
friend class __Core_Initializer__;
|
|
public:
|
|
static Core * instance() {return __Core_Initializer__::__instance__;}
|
|
|
|
EVENT(K_Received)
|
|
EVENT_HANDLER(void, K_Send);
|
|
|
|
private:
|
|
Core();
|
|
EVENT_HANDLER2(void, dataReceived, const PIString &, from, const PIByteArray &, data);
|
|
|
|
PIConnection connection;
|
|
|
|
KSection k_plain;
|
|
PIMap<int, PIMap<int, KSection> > k_sections; // [enum KSection][index] = CDUtils::KSection
|
|
|
|
};
|
|
|
|
|
|
static __Core_Initializer__ __Core_initializer__;
|
|
|
|
}
|
|
|
|
#endif // CDUTILS_CORE_H
|