F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
QueuedComponentBase.cpp
Go to the documentation of this file.
2 #include <Fw/Types/Assert.hpp>
3 #include <FpConfig.hpp>
4 #include <Os/QueueString.hpp>
5 
6 #include <cstdio>
7 
8 namespace Fw {
9 
10  QueuedComponentBase::QueuedComponentBase(const char* name) : PassiveComponentBase(name),m_msgsDropped(0) {
11 
12  }
13 
15 
16  }
17 
20  }
21 
22 #if FW_OBJECT_TO_STRING == 1
23  const char* QueuedComponentBase::getToStringFormatString() {
24  return "QueueComp: %s";
25  }
26 #endif
27 
29 
30  Os::QueueString queueName;
31 #if FW_OBJECT_NAMES == 1
32  queueName = this->m_objName;
33 #else
34  queueName.format("CompQ_%" PRI_FwSizeType,Os::Queue::getNumQueues());
35 #endif
36  return this->m_queue.create(queueName, depth, msgSize);
37  }
38 
40  return this->m_msgsDropped;
41  }
42 
44  this->m_msgsDropped++;
45  }
46 
47 }
virtual ~QueuedComponentBase()
Destructor.
QueuedComponentBase(const char *name)
Constructor.
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:55
static FwSizeType getNumQueues()
get number of queues system-wide
Definition: Queue.cpp:127
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
Os::Queue m_queue
queue object for active component
void init()
Object initializer.
Definition: ObjBase.cpp:26
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
Status
Generic OK/ERROR status.
Definition: Os.hpp:25
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
C++-compatible configuration header for fprime configuration.
Status create(const Fw::StringBase &name, FwSizeType depth, FwSizeType messageSize) override
create queue storage through delegate
Definition: Queue.cpp:20
void incNumMsgDropped()
increment the number of messages dropped
NATIVE_INT_TYPE getNumMsgsDropped()
return number of messages dropped
#define PRI_FwSizeType
Definition: FpConfig.h:36