mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 04:35:25 -06:00
* NATIVE_INT_TYPE use in toString * NATIVE_INT_TYPE use in SimpleObjRegistry * NATIVE_INT_TYPE use in Asserts * NATIVE_INT_TYPE use in Fw/Comp * NATIVE_INT_TYPE use in getCapacity * NATIVE_INT_TYPE use in getEntries * NATIVE_INT_TYPE use in size/length * NATIVE_INT_TYPE use in FILE_NAME_ARG * NATIVE_INT_TYPE use in Fw (misc) * NATIVE_INT_TYPE use in identifier * NATIVE_INT_TYPE use in Fw (misc II) * POINTER_CAST in Buffer * POINTER_CAST in Serializable * sp * Removing no longer used DefaultTypes.hpp * Fixes to accomidate Fw refactor * Unit-test and CI fixes * Fixing review comments - pt 1
59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
#include <Fw/Comp/PassiveComponentBase.hpp>
|
|
#include <Fw/Types/Assert.hpp>
|
|
#include <FpConfig.hpp>
|
|
|
|
#include <Fw/Types/ExternalString.hpp>
|
|
|
|
namespace Fw {
|
|
|
|
PassiveComponentBase::PassiveComponentBase(const char* name) : Fw::ObjBase(name), m_idBase(0), m_instance(0) {
|
|
}
|
|
|
|
#if FW_OBJECT_TO_STRING == 1
|
|
const char* PassiveComponentBase::getToStringFormatString() {
|
|
return "Comp: %s";
|
|
}
|
|
|
|
void PassiveComponentBase::toString(char* buffer, FwSizeType size) {
|
|
FW_ASSERT(size > 0);
|
|
FW_ASSERT(buffer != nullptr);
|
|
Fw::FormatStatus status = Fw::ExternalString(buffer, static_cast<Fw::ExternalString::SizeType>(size)).format(
|
|
this->getToStringFormatString(),
|
|
#if FW_OBJECT_NAMES == 1
|
|
this->m_objName.toChar()
|
|
#else
|
|
"UNKNOWN"
|
|
#endif
|
|
);
|
|
if (status != Fw::FormatStatus::SUCCESS) {
|
|
buffer[0] = 0;
|
|
}
|
|
}
|
|
#endif
|
|
|
|
PassiveComponentBase::~PassiveComponentBase() {
|
|
}
|
|
|
|
void PassiveComponentBase::init(FwEnumStoreType instance) {
|
|
ObjBase::init();
|
|
this->m_instance = instance;
|
|
}
|
|
|
|
FwEnumStoreType PassiveComponentBase::getInstance() const {
|
|
return this->m_instance;
|
|
}
|
|
|
|
void PassiveComponentBase ::
|
|
setIdBase(const U32 idBase)
|
|
{
|
|
this->m_idBase = idBase;
|
|
}
|
|
|
|
U32 PassiveComponentBase ::
|
|
getIdBase() const
|
|
{
|
|
return this->m_idBase;
|
|
}
|
|
|
|
}
|