F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 <Fw/FPrimeBasicTypes.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, FwSizeType 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 #if FW_OBJECT_NAMES == 1
84  Fw::ObjectName m_objName;
85 #endif
86 
93  ObjBase(const char* name);
94 
99  virtual ~ObjBase();
100 
106  void init();
107  private:
108 #if FW_OBJECT_REGISTRATION == 1
109  static ObjRegistry* s_objRegistry;
110 #endif
111 }; // ObjBase
112 
113 #if FW_OBJECT_REGISTRATION == 1
114 class ObjRegistry {
120  public:
130  virtual void regObject(ObjBase* obj) = 0;
131 
136  virtual ~ObjRegistry();
137 }; // ObjRegistry
138 #endif // FW_OBJECT_REGISTRATION
139 } // namespace Fw
140 #endif // FW_OBJ_BASE_HPP
PlatformSizeType FwSizeType
ObjBase(const char *name)
ObjBase constructor.
Definition: ObjBase.cpp:21
void init()
Object initializer.
Definition: ObjBase.cpp:24
Brief class description.
Definition: ObjBase.hpp:35
virtual ~ObjBase()
Destructor.
Definition: ObjBase.cpp:32