F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
PassiveComponentBase.cpp
Go to the documentation of this file.
2 #include <Fw/Types/Assert.hpp>
3 #include <FpConfig.hpp>
4 
5 #include <cstdio>
6 
7 namespace Fw {
8 
9  PassiveComponentBase::PassiveComponentBase(const char* name) : Fw::ObjBase(name), m_idBase(0), m_instance(0) {
10  }
11 
12 #if FW_OBJECT_TO_STRING == 1 && FW_OBJECT_NAMES == 1
13  void PassiveComponentBase::toString(char* buffer, NATIVE_INT_TYPE size) {
14  FW_ASSERT(buffer);
15  FW_ASSERT(size > 0);
16  if (snprintf(buffer, size, "Comp: %s", this->m_objName) < 0) {
17  buffer[0] = 0;
18  }
19  }
20 #endif
21 
23  }
24 
26  ObjBase::init();
27  this->m_instance = instance;
28  }
29 
31  return this->m_instance;
32  }
33 
35  setIdBase(const U32 idBase)
36  {
37  this->m_idBase = idBase;
38  }
39 
41  getIdBase() const
42  {
43  return this->m_idBase;
44  }
45 
46 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
C++-compatible configuration header for fprime configuration.
Brief class description.
Definition: ObjBase.hpp:32
void init()
Object initializer.
Definition: ObjBase.cpp:27
NATIVE_INT_TYPE getInstance() const
PassiveComponentBase(const char *name)
Named constructor.
virtual ~PassiveComponentBase()
Destructor.
void setIdBase(const U32)
Set the ID base.