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.
53 lines
1.2 KiB
53 lines
1.2 KiB
#ifndef __DEVICE_NODE_FACTORY_HEADER__
|
|
#define __DEVICE_NODE_FACTORY_HEADER__
|
|
|
|
#include "../components/base/basicThread.h"
|
|
#include "dataBinder.h"
|
|
#include "deviceNode.h"
|
|
|
|
#define FACTORY_NODE_INIT_PENDING_COUNT 10 // Counts of validation in seconds
|
|
|
|
class deviceNodeFactory : public basicThread
|
|
{
|
|
private:
|
|
|
|
basicLogCollection * m_pLog;
|
|
dataBinder * m_pDBC;
|
|
vectorDeviceNodes m_vDeviceNodes;
|
|
mapDeviceNode2Id m_mDeviceNodesIDS;
|
|
DBC_INT_LIST m_nPendingNodes;
|
|
uint16_t m_nPendingInitCounter;
|
|
|
|
public:
|
|
|
|
static deviceNodeFactory * getInstance();
|
|
virtual ~deviceNodeFactory();
|
|
deviceNode * createNode(uint32_t id);
|
|
void deleteNode(deviceNode * ptr);
|
|
void deleteNode(uint32_t id);
|
|
uint32_t fetchNodes(ARGUS_NODE_TYPE type, deviceNode **& RA);
|
|
deviceNode * getNode(uint32_t id);
|
|
uint32_t getNodesCount(ARGUS_NODE_TYPE type);
|
|
bool loadNodes();
|
|
|
|
bool nodesAreLoaded()
|
|
{
|
|
return m_vDeviceNodes.size() > 0;
|
|
}
|
|
|
|
bool unloadNodes(void);
|
|
bool reloadNodes();
|
|
bool reloadNode(uint32_t NodeID);
|
|
bool validate(void);
|
|
|
|
protected:
|
|
|
|
explicit deviceNodeFactory();
|
|
virtual void m_fThreadProc(void);
|
|
|
|
private:
|
|
|
|
static deviceNodeFactory * _instance;
|
|
};
|
|
|
|
#endif
|