You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

119 lines
2.2 KiB

#ifndef __DFSL_KERNEL_MODULE_HEADER__
#define __DFSL_KERNEL_MODULE_HEADER__
#include "../../components/base/basicEngine.h"
#include "../../components/base/basicEvent.h"
#include "../../components/base/basicEventHandler.h"
#include "../../components/base/basicLogCollection.h"
#include "../../components/base/basicObject.h"
#include "dataBinder.h"
#include <vector>
typedef enum E_KERNEL_MODULE_TYPE
{
KERNEL_MODULE_UNKNOWN = 0,
KERNEL_MODULE_DCBUSB = 1,
KERNEL_MODULE_KAFKA = 2,
KERNEL_MODULE_GPS = 3,
KERNEL_MODULE_NETWORK = 4,
KERNEL_MODULE_FLYHUNTER = 5,
KERNEL_MODULE_SSDP_ANONCE = 6,
KERNEL_MODULE_ONVIF_OBSERVER = 7,
KERNEL_MODULE_EMBED_VIDEO = 8,
KERNEL_MODULE_MODEM_MANAGER = 9,
KERNEL_MODULE_REMOTE_SERVER = 10,
KERNEL_MODULE_REPORT_BACKUPPER = 11,
KERNEL_MODULE_BOSCH_REST = 12,
KERNEL_MODULE_ATTENTION_CLOUD = 13
} KERNEL_MODULE_TYPE;
class kernelModule : public basicEventHandler, public basicEngine
{
protected:
basicLogCollection * m_pLog;
dataBinder * m_pDBC;
uint32_t m_nDBID;
uint32_t m_nDBAUXID;
bool m_bEnabled;
bool m_bDetached;
bool m_bEvtFlags[EVT_COUNT];
KERNEL_MODULE_TYPE m_eType;
public:
explicit kernelModule(uint32_t id, KERNEL_MODULE_TYPE type = KERNEL_MODULE_UNKNOWN);
virtual ~kernelModule();
uint32_t getId() const
{
return m_nDBID;
}
uint32_t getAuxId() const
{
return m_nDBAUXID;
}
KERNEL_MODULE_TYPE getType() const
{
return m_eType;
}
bool isDetached() const
{
return m_bDetached;
}
bool isAttached() const
{
return ! m_bDetached;
}
bool isEnabled() const
{
return m_bEnabled;
}
virtual bool reloadSettings()
{
return false;
}
void setAttached(bool b = true)
{
m_bDetached = ! b;
}
void setDetached(bool b = true)
{
m_bDetached = b;
}
virtual bool startService()
{
return false;
}
virtual bool stopService(bool force = false)
{
if ( !force ) return true;
return force;
}
virtual bool validate()
{
return false;
}
virtual bool dispatchEvent(EVENT_CONTAINER * Evt)
{
if ( Evt ) return true;
return true;
}
};
typedef std::vector<kernelModule *> vectorKernelModules;
#endif