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.
40 lines
1.7 KiB
40 lines
1.7 KiB
#ifndef __ARGUS_NODE_FACTORY_HEADER__
|
|
#define __ARGUS_NODE_FACTORY_HEADER__
|
|
|
|
#include <vector>
|
|
#include <map>
|
|
#include "rgooseNode.h"
|
|
#include "../components/base/basicThread.h"
|
|
|
|
typedef std::vector<argusNetNode*> vectorNetNodes;
|
|
typedef std::map<uint32_t,argusNetNode*> mapNode2Id;
|
|
class argusNodeFactory: public basicThread{
|
|
private:
|
|
basicLogCollection * m_pLog;
|
|
argusDBC * m_pDBC;
|
|
uint32_t m_nSiteID;
|
|
uint32_t m_nServerID;
|
|
vectorNetNodes m_vNetNodes;
|
|
mapNode2Id m_mNetNodesIDS;
|
|
public:
|
|
static argusNodeFactory * getInstance( uint32_t SiteID = 0, uint32_t ServerID = 0 );
|
|
virtual ~argusNodeFactory();
|
|
argusNetNode * createNode( uint32_t id );
|
|
void deleteNode( argusNetNode *ptr );
|
|
void deleteNode( uint32_t id );
|
|
uint32_t fetchNodes( ARGUS_NODE_TYPE type, argusNetNode **&RA );
|
|
argusNetNode * getNode( uint32_t id );
|
|
uint32_t getNodesCount( ARGUS_NODE_TYPE type );
|
|
bool loadNodes( uint32_t SiteID = 0, uint32_t ServerID = 0 );
|
|
bool unloadNodes( void );
|
|
bool reloadNodes( uint32_t SiteID = 0, uint32_t ServerID = 0 );
|
|
bool reloadNode( uint32_t NodeID );
|
|
bool validate( void );
|
|
protected:
|
|
explicit argusNodeFactory( uint32_t SiteID, uint32_t ServerID );
|
|
virtual void m_fThreadProc( void );
|
|
private:
|
|
static argusNodeFactory * _instance;
|
|
};
|
|
|
|
#endif
|