F´ Flight Software - C/C++ Documentation  NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 }
PassiveComponentBase.hpp
Fw::ObjBase
Brief class description.
Definition: ObjBase.hpp:33
Fw::PassiveComponentBase::getIdBase
U32 getIdBase() const
Definition: PassiveComponentBase.cpp:41
Fw::PassiveComponentBase::PassiveComponentBase
PassiveComponentBase(const char *name)
Named constructor.
Definition: PassiveComponentBase.cpp:9
Fw::PassiveComponentBase::setIdBase
void setIdBase(const U32)
Set the ID base.
Definition: PassiveComponentBase.cpp:35
Assert.hpp
Fw::PassiveComponentBase::~PassiveComponentBase
virtual ~PassiveComponentBase()
Destructor.
Definition: PassiveComponentBase.cpp:22
FW_ASSERT
#define FW_ASSERT(...)
Definition: Assert.hpp:8
Fw::ObjBase::init
void init()
Object initializer.
Definition: ObjBase.cpp:27
FpConfig.hpp
ISF configuration file.
Fw::PassiveComponentBase::getInstance
NATIVE_INT_TYPE getInstance() const
Definition: PassiveComponentBase.cpp:30
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
Fw
Definition: Buffer.cpp:21