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.

38 lines
1.6 KiB

​
​
​
6 years ago
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __ARGUS_NODE_FACTORY_HEADER__
  2. #define __ARGUS_NODE_FACTORY_HEADER__
  3. #include <vector>
  4. #include <map>
  5. #include "rgooseNode.h"
  6. #include "../components/base/basicThread.h"
  7. typedef std::vector<argusNetNode*> vectorNetNodes;
  8. typedef std::map<uint32_t,argusNetNode*> mapNode2Id;
  9. class argusNodeFactory: public basicThread{
  10. private:
  11. basicLogCollection * m_pLog;
  12. argusDBC * m_pDBC;
  13. uint32_t m_nSiteID;
  14. vectorNetNodes m_vNetNodes;
  15. mapNode2Id m_mNetNodesIDS;
  16. public:
  17. static argusNodeFactory * getInstance( uint32_t ServerID = 0 );
  18. virtual ~argusNodeFactory();
  19. argusNetNode * createNode( uint32_t id );
  20. void deleteNode( argusNetNode *ptr );
  21. void deleteNode( uint32_t id );
  22. uint32_t fetchNodes( ARGUS_NODE_TYPE type, argusNetNode **&RA );
  23. argusNetNode * getNode( uint32_t id );
  24. uint32_t getNodesCount( ARGUS_NODE_TYPE type );
  25. bool loadNodes( uint32_t SiteID = 0 );
  26. bool unloadNodes( void );
  27. bool reloadNodes( uint32_t SiteID = 0 );
  28. bool reloadNode( uint32_t NodeID );
  29. bool validate( void );
  30. protected:
  31. explicit argusNodeFactory( uint32_t ServerID );
  32. virtual void m_fThreadProc( void );
  33. private:
  34. static argusNodeFactory * _instance;
  35. };
  36. #endif