F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
ObjBase.hpp
Go to the documentation of this file.
1 
13 #ifndef FW_OBJ_BASE_HPP
14 #define FW_OBJ_BASE_HPP
15 
16 #include <FpConfig.hpp>
17 #if FW_OBJECT_NAMES == 1
18 #include <Fw/Types/ObjectName.hpp>
19 #endif
20 
21 namespace Fw {
22 
23 #if FW_OBJECT_REGISTRATION == 1
24  class ObjRegistry;
25 #endif
26 
34 
35  class ObjBase {
36  public:
37 #if FW_OBJECT_NAMES == 1
38 
44  const char* getObjName();
45 
52  void setObjName(const char* name);
53 #if FW_OBJECT_TO_STRING == 1
54 
64  virtual void toString(char* str, NATIVE_INT_TYPE size);
65 #endif // FW_OBJECT_TO_STRING
66 #endif // FW_OBJECT_NAMES
67 
68 #if FW_OBJECT_REGISTRATION == 1
69 
79  static void setObjRegistry(ObjRegistry* reg);
80 #endif
81 
82  protected:
83 
84 #if FW_OBJECT_NAMES == 1
85  Fw::ObjectName m_objName;
86 #endif
87 
94  ObjBase(const char* name);
95 
100  virtual ~ObjBase();
101 
107  void init();
108  private:
109 #if FW_OBJECT_REGISTRATION == 1
110  static ObjRegistry* s_objRegistry;
111 #endif
112  }; // ObjBase
113 
114 #if FW_OBJECT_REGISTRATION == 1
120  class ObjRegistry {
121  public:
122 
132  virtual void regObject(ObjBase* obj)=0;
133 
138  virtual ~ObjRegistry();
139  }; // ObjRegistry
140 #endif // FW_OBJECT_REGISTRATION
141 }
142 #endif // FW_OBJ_BASE_HPP
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
C++-compatible configuration header for fprime configuration.
Brief class description.
Definition: ObjBase.hpp:35
void init()
Object initializer.
Definition: ObjBase.cpp:27
virtual ~ObjBase()
Destructor.
Definition: ObjBase.cpp:35
ObjBase(const char *name)
ObjBase constructor.
Definition: ObjBase.cpp:22