NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nodeImpl.h
1 /*
2  * Nominal Device Support v3 (NDS3)
3  *
4  * Copyright (c) 2015 Cosylab d.d.
5  *
6  * For more information about the license please refer to the license.txt
7  * file included in the distribution.
8  */
9 
10 #ifndef NDSNODEIMPL_H
11 #define NDSNODEIMPL_H
12 
13 #include <list>
14 #include "nds3/definitions.h"
15 #include "nds3/impl/baseImpl.h"
16 
17 namespace nds
18 {
19 
20 class Node;
21 class StateMachineImpl;
22 
29 class NodeImpl: public BaseImpl
30 {
31 public:
37  NodeImpl(const std::string& name, const nodeType_t nodeType);
38 
39  void addChild(std::shared_ptr<BaseImpl> pChild);
40 
41  void initializeRootNode(void* pDeviceObject, FactoryBaseImpl& controlSystem);
42 
43  void deinitializeRootNode();
44 
45  virtual void initialize(FactoryBaseImpl& controlSystem);
46 
47  virtual void deinitialize();
48 
49  virtual state_t getLocalState() const;
50 
51  virtual void getGlobalState(timespec* pTimestamp, state_t* pState) const;
52  void getChildrenState(timespec* pTimestamp, state_t* pState) const;
53 
54  virtual void setLogLevel(const logLevel_t logLevel);
55 
56  virtual std::string buildFullExternalName(const FactoryBaseImpl& controlSystem) const;
57  virtual std::string buildFullExternalNameFromPort(const FactoryBaseImpl& controlSystem) const;
58 
59 protected:
60  std::string buildFullExternalName(const FactoryBaseImpl& controlSystem, const bool bStopAtPort) const;
61 
62  nodeType_t m_nodeType;
63 
64 private:
65  typedef std::map<std::string, std::shared_ptr<BaseImpl> > tChildren;
66  tChildren m_children;
67 
68  std::shared_ptr<StateMachineImpl> m_pStateMachine;
69 
70 };
71 
72 }
73 
74 #endif // NDSNODEIMPL_H
nodeType_t
Defines the nodes' roles in the tree structure: it is used to build the node's external name when usi...
Definition: definitions.h:103
This is the base class for objects that interact with specific control systems and has to be allocate...
Definition: factoryBaseImpl.h:51
logLevel_t
Defines the severities of the log information.
Definition: definitions.h:80
Represents a node (channel or channelGroup in the old NDS) which can contain other nodes...
Definition: nodeImpl.h:29
Defines all the enumeration and common types used across the NDS library.
NodeImpl(const std::string &name, const nodeType_t nodeType)
Construct the node.
state_t
Available states, ordered by priority (lowest to higher).
Definition: definitions.h:36