fprime/Fw/Comp/QueuedComponentBase.cpp
M Starch ec08d43dd3
Removes NATIVE_INT_TYPE, NATIVE_UINT_TYPE, and POINTER_CAST from Fw (#3286)
* 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
2025-03-04 14:42:48 -08:00

48 lines
1.1 KiB
C++

#include <Fw/Comp/QueuedComponentBase.hpp>
#include <Fw/Types/Assert.hpp>
#include <FpConfig.hpp>
#include <Os/QueueString.hpp>
#include <cstdio>
namespace Fw {
QueuedComponentBase::QueuedComponentBase(const char* name) : PassiveComponentBase(name),m_msgsDropped(0) {
}
QueuedComponentBase::~QueuedComponentBase() {
}
void QueuedComponentBase::init(FwEnumStoreType instance) {
PassiveComponentBase::init(instance);
}
#if FW_OBJECT_TO_STRING == 1
const char* QueuedComponentBase::getToStringFormatString() {
return "QueueComp: %s";
}
#endif
Os::Queue::Queue::Status QueuedComponentBase::createQueue(FwSizeType depth, FwSizeType msgSize) {
Os::QueueString queueName;
#if FW_OBJECT_NAMES == 1
queueName = this->m_objName;
#else
queueName.format("CompQ_%" PRI_FwSizeType,Os::Queue::getNumQueues());
#endif
return this->m_queue.create(queueName, depth, msgSize);
}
FwSizeType QueuedComponentBase::getNumMsgsDropped() {
return this->m_msgsDropped;
}
void QueuedComponentBase::incNumMsgDropped() {
this->m_msgsDropped++;
}
}