mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 00:44:37 -06:00
Merge pull request #612 from joshuaa/fix-fw-obj-names
Refactor FW_OBJECT_NAMES switches and fix building without object names
This commit is contained in:
commit
1c4e2d2d17
@ -370,36 +370,15 @@ namespace ${namespace} {
|
||||
// Component construction, initialization, and destruction
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
${class_name} ::
|
||||
#if $kind == "passive":
|
||||
\#if FW_OBJECT_NAMES == 1
|
||||
${class_name}(const char* compName) :
|
||||
Fw::PassiveComponentBase(compName)
|
||||
\#else
|
||||
${class_name}() :
|
||||
Fw::PassiveComponentBase()
|
||||
\#endif
|
||||
{
|
||||
|
||||
${class_name} :: ${class_name}(const char* compName) :
|
||||
Fw::PassiveComponentBase(compName) {
|
||||
#else if $kind == "queued":
|
||||
\#if FW_OBJECT_NAMES == 1
|
||||
${class_name}(const char* compName) :
|
||||
Fw::QueuedComponentBase(compName)
|
||||
\#else
|
||||
${class_name}() :
|
||||
Fw::QueuedComponentBase()
|
||||
\#endif
|
||||
{
|
||||
|
||||
${class_name} :: ${class_name}(const char* compName) :
|
||||
Fw::QueuedComponentBase(compName) {
|
||||
#else:
|
||||
\#if FW_OBJECT_NAMES == 1
|
||||
${class_name}(const char* compName) :
|
||||
Fw::ActiveComponentBase(compName)
|
||||
\#else
|
||||
${class_name}() :
|
||||
Fw::ActiveComponentBase()
|
||||
\#endif
|
||||
{
|
||||
${class_name} :: ${class_name}(const char* compName) :
|
||||
Fw::ActiveComponentBase(compName) {
|
||||
#end if
|
||||
|
||||
#for $ids, $tlmname, $type, $size, $update, $comment, $typeinfo in $channels:
|
||||
|
||||
@ -241,17 +241,11 @@ namespace ${namespace} {
|
||||
// Component construction, initialization, and destruction
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
\#if FW_OBJECT_NAMES == 1
|
||||
//! Construct a ${name}ComponentBase object
|
||||
//!
|
||||
${name}ComponentBase(
|
||||
const char* compName $doxygen_post_comment("Component name")
|
||||
const char* compName = "" $doxygen_post_comment("Component name")
|
||||
);
|
||||
\#else
|
||||
//! Construct a ${name}ComponentBase object
|
||||
//!
|
||||
${name}ComponentBase(void);
|
||||
\#endif
|
||||
|
||||
//! Initialize a ${name}ComponentBase object
|
||||
//!
|
||||
@ -1012,6 +1006,7 @@ $emit_non_port_params(8, $params)
|
||||
|
||||
#end for
|
||||
#end if
|
||||
|
||||
#if $needs_msg_size:
|
||||
|
||||
PRIVATE:
|
||||
|
||||
@ -25,14 +25,9 @@ namespace ${namespace} {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
${name}ComponentImpl ::
|
||||
\#if FW_OBJECT_NAMES == 1
|
||||
${name}ComponentImpl(
|
||||
$emit_non_port_params([ $param_compName ])
|
||||
) :
|
||||
${component_base}(compName)
|
||||
\#else
|
||||
${name}ComponentImpl(void)
|
||||
\#endif
|
||||
) : ${component_base}(compName)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -34,11 +34,7 @@ namespace ${namespace} {
|
||||
//! Construct object $name
|
||||
//!
|
||||
${name}ComponentImpl(
|
||||
\#if FW_OBJECT_NAMES == 1
|
||||
$emit_non_port_params([ $param_compName ])
|
||||
\#else
|
||||
void
|
||||
\#endif
|
||||
);
|
||||
|
||||
//! Initialize object $name
|
||||
|
||||
@ -4,16 +4,12 @@
|
||||
|
||||
namespace Drv {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
BlockDriverImpl::BlockDriverImpl(const char* compName) :
|
||||
BlockDriverComponentBase(compName)
|
||||
#else
|
||||
BlockDriverImpl::BlockDriverImpl()
|
||||
#endif
|
||||
,m_cycles(0)
|
||||
BlockDriverComponentBase(compName), m_cycles(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BlockDriverImpl::init(NATIVE_INT_TYPE queueDepth) {
|
||||
BlockDriverComponentBase::init(queueDepth);
|
||||
}
|
||||
|
||||
@ -5,24 +5,21 @@
|
||||
|
||||
namespace Drv {
|
||||
|
||||
class BlockDriverImpl : public BlockDriverComponentBase {
|
||||
|
||||
public:
|
||||
class BlockDriverImpl : public BlockDriverComponentBase {
|
||||
|
||||
// Only called by derived class
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
BlockDriverImpl(const char* compName);
|
||||
#else
|
||||
BlockDriverImpl();
|
||||
#endif
|
||||
void init(NATIVE_INT_TYPE queueDepth);
|
||||
~BlockDriverImpl(void);
|
||||
// a little hack to get the reference running
|
||||
void callIsr(void);
|
||||
|
||||
private:
|
||||
public:
|
||||
|
||||
// downcalls for input ports
|
||||
// Only called by derived class
|
||||
BlockDriverImpl(const char* compName);
|
||||
|
||||
void init(NATIVE_INT_TYPE queueDepth);
|
||||
~BlockDriverImpl(void);
|
||||
// a little hack to get the reference running
|
||||
void callIsr(void);
|
||||
|
||||
private:
|
||||
|
||||
// downcalls for input ports
|
||||
void InterruptReport_internalInterfaceHandler(U32 ip);
|
||||
void BufferIn_handler(NATIVE_INT_TYPE portNum, Drv::DataBuffer& buffer);
|
||||
void Sched_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context);
|
||||
@ -39,8 +36,7 @@ namespace Drv {
|
||||
// cycle count
|
||||
U32 m_cycles;
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -31,11 +31,7 @@ namespace Drv {
|
||||
//! Construct object LinuxGpioDriver
|
||||
//!
|
||||
LinuxGpioDriverComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize object LinuxGpioDriver
|
||||
|
||||
@ -21,18 +21,13 @@ namespace Drv {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
LinuxGpioDriverComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
LinuxGpioDriverComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
LinuxGpioDriverComponentBase(compName)
|
||||
#else
|
||||
LinuxGpioDriverImpl(void)
|
||||
#endif
|
||||
,m_gpio(-1)
|
||||
,m_direction(GPIO_IN)
|
||||
,m_fd(-1)
|
||||
,m_quitThread(false)
|
||||
) : LinuxGpioDriverComponentBase(compName),
|
||||
m_gpio(-1),
|
||||
m_direction(GPIO_IN),
|
||||
m_fd(-1),
|
||||
m_quitThread(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -31,15 +31,10 @@ namespace Drv {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
LinuxI2cDriverComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
LinuxI2cDriverComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
LinuxI2cDriverComponentBase(compName)
|
||||
#else
|
||||
LinuxI2cDriverComponentImpl(void)
|
||||
#endif
|
||||
,m_fd(-1)
|
||||
) : LinuxI2cDriverComponentBase(compName),
|
||||
m_fd(-1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -29,13 +29,7 @@ namespace Drv {
|
||||
|
||||
//! Construct object LinuxI2cDriver
|
||||
//!
|
||||
LinuxI2cDriverComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
LinuxI2cDriverComponentImpl(const char *const compName);
|
||||
|
||||
//! Initialize object LinuxI2cDriver
|
||||
//!
|
||||
|
||||
@ -24,15 +24,10 @@ namespace Drv {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
LinuxI2cDriverComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
LinuxI2cDriverComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
LinuxI2cDriverComponentBase(compName)
|
||||
#else
|
||||
LinuxI2cDriverComponentImpl(void)
|
||||
#endif
|
||||
,m_fd(-1)
|
||||
) : LinuxI2cDriverComponentBase(compName),
|
||||
m_fd(-1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -32,11 +32,7 @@ namespace Drv {
|
||||
//! Construct object LinuxSerialDriver
|
||||
//!
|
||||
LinuxSerialDriverComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize object LinuxSerialDriver
|
||||
|
||||
@ -15,16 +15,12 @@ namespace Drv {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
LinuxSerialDriverComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
LinuxSerialDriverComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
LinuxSerialDriverComponentBase(compName)
|
||||
#else
|
||||
LinuxSerialDriverImpl(void) :
|
||||
LinuxSerialDriverComponentBase()
|
||||
#endif
|
||||
,m_fd(-1),m_device("NOT_EXIST"),m_quitReadThread(false)
|
||||
) : LinuxSerialDriverComponentBase(compName),
|
||||
m_fd(-1),
|
||||
m_device("NOT_EXIST"),
|
||||
m_quitReadThread(false)
|
||||
{
|
||||
// initialize buffer set
|
||||
for (NATIVE_INT_TYPE entry = 0; entry < DR_MAX_NUM_BUFFERS; entry++) {
|
||||
|
||||
@ -44,12 +44,8 @@ namespace Drv {
|
||||
//! Construct object LinuxSpiDriver
|
||||
//!
|
||||
LinuxSpiDriverComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char * const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
);
|
||||
|
||||
//! Initialize object LinuxSpiDriver
|
||||
//!
|
||||
|
||||
@ -20,13 +20,12 @@ namespace Drv {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
LinuxSpiDriverComponentImpl::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
LinuxSpiDriverComponentImpl(const char * const compName) :
|
||||
LinuxSpiDriverComponentBase(compName)
|
||||
#else
|
||||
LinuxSpiDriverImpl(void)
|
||||
#endif
|
||||
,m_fd(-1),m_device(-1),m_select(-1),m_bytes(0)
|
||||
LinuxSpiDriverComponentBase(compName),
|
||||
m_fd(-1),
|
||||
m_device(-1),
|
||||
m_select(-1),
|
||||
m_bytes(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -28,18 +28,10 @@ namespace Drv {
|
||||
|
||||
SocketIpDriverComponentImpl ::
|
||||
SocketIpDriverComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName
|
||||
#endif
|
||||
) :
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
SocketIpDriverComponentBase(compName)
|
||||
#else
|
||||
SocketIpDriverComponentBase(void)
|
||||
#endif
|
||||
,
|
||||
m_buffer(0xbeef, 0xbeef, reinterpret_cast<U64>(m_backing_data), sizeof(m_buffer)),
|
||||
m_stop(false)
|
||||
) : SocketIpDriverComponentBase(compName),
|
||||
m_buffer(0xbeef, 0xbeef, reinterpret_cast<U64>(m_backing_data), sizeof(m_buffer)),
|
||||
m_stop(false)
|
||||
{ }
|
||||
|
||||
void SocketIpDriverComponentImpl ::
|
||||
|
||||
@ -42,9 +42,7 @@ namespace Drv {
|
||||
//! Construct object SocketIpDriver
|
||||
//!
|
||||
SocketIpDriverComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize object SocketIpDriver
|
||||
|
||||
@ -30,15 +30,10 @@ namespace Fw {
|
||||
|
||||
};
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ActiveComponentBase::ActiveComponentBase(const char* name) : QueuedComponentBase(name) {
|
||||
|
||||
}
|
||||
#else
|
||||
ActiveComponentBase::ActiveComponentBase() : QueuedComponentBase() {
|
||||
|
||||
}
|
||||
#endif
|
||||
ActiveComponentBase::~ActiveComponentBase() {
|
||||
DEBUG_PRINT("ActiveComponent %s destructor.\n",this->getObjName());
|
||||
}
|
||||
|
||||
@ -28,11 +28,7 @@ namespace Fw {
|
||||
};
|
||||
|
||||
PROTECTED:
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ActiveComponentBase(const char* name); //!< Constructor
|
||||
#else
|
||||
ActiveComponentBase(); //!< Constructor
|
||||
#endif
|
||||
virtual ~ActiveComponentBase(); //!< Destructor
|
||||
void init(NATIVE_INT_TYPE instance); //!< initialization code
|
||||
virtual void preamble(void); //!< A function that will be called before the event loop is entered
|
||||
|
||||
@ -6,13 +6,8 @@
|
||||
|
||||
namespace Fw {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
PassiveComponentBase::PassiveComponentBase(const char* name) : Fw::ObjBase(name), m_idBase(0), m_instance(0) {
|
||||
}
|
||||
#else
|
||||
PassiveComponentBase::PassiveComponentBase() : Fw::ObjBase(), m_idBase(0), m_instance(0) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if FW_OBJECT_TO_STRING == 1 && FW_OBJECT_NAMES == 1
|
||||
void PassiveComponentBase::toString(char* buffer, NATIVE_INT_TYPE size) {
|
||||
|
||||
@ -18,11 +18,7 @@ namespace Fw {
|
||||
U32 getIdBase(void) const;
|
||||
|
||||
PROTECTED:
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
PassiveComponentBase(const char* name); //!< Named constructor
|
||||
#else
|
||||
PassiveComponentBase(); //!< Unnamed constructor
|
||||
#endif
|
||||
virtual ~PassiveComponentBase(); //!< Destructor
|
||||
void init(NATIVE_INT_TYPE instance); //!< Initialization function
|
||||
NATIVE_INT_TYPE getInstance(void) const;
|
||||
|
||||
@ -7,15 +7,10 @@
|
||||
|
||||
namespace Fw {
|
||||
|
||||
#if FW_OBJECT_NAMES
|
||||
QueuedComponentBase::QueuedComponentBase(const char* name) : PassiveComponentBase(name),m_msgsDropped(0) {
|
||||
|
||||
}
|
||||
#else
|
||||
QueuedComponentBase::QueuedComponentBase() : PassiveComponentBase(),m_msgsDropped(0) {
|
||||
|
||||
}
|
||||
#endif
|
||||
QueuedComponentBase::~QueuedComponentBase() {
|
||||
|
||||
}
|
||||
|
||||
@ -30,12 +30,7 @@ namespace Fw {
|
||||
} MsgDispatchStatus;
|
||||
|
||||
PROTECTED:
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
QueuedComponentBase(const char* name); //!< Constructor
|
||||
#else
|
||||
QueuedComponentBase(); //!< Constructor
|
||||
#endif
|
||||
virtual ~QueuedComponentBase(); //!< Destructor
|
||||
void init(NATIVE_INT_TYPE instance); //!< initialization function
|
||||
Os::Queue m_queue; //!< queue object for active component
|
||||
|
||||
@ -9,7 +9,7 @@ namespace Fw {
|
||||
ObjRegistry* ObjBase::s_objRegistry = 0;
|
||||
#endif
|
||||
|
||||
#if FW_OBJECT_NAMES
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ObjBase::ObjBase(const char* objName) {
|
||||
if (0 == objName) {
|
||||
this->setObjName("NoName");
|
||||
@ -18,11 +18,10 @@ namespace Fw {
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
ObjBase::ObjBase() {
|
||||
|
||||
ObjBase::ObjBase(const char* objName) {
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void ObjBase::init(void) {
|
||||
#if FW_OBJECT_REGISTRATION
|
||||
|
||||
@ -32,7 +32,6 @@ namespace Fw {
|
||||
|
||||
class ObjBase {
|
||||
public:
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
|
||||
//! \brief Returns the object's name
|
||||
@ -63,6 +62,7 @@ namespace Fw {
|
||||
virtual void toString(char* str, NATIVE_INT_TYPE size); //!< virtual method to get description of object
|
||||
#endif // FW_OBJECT_TO_STRING
|
||||
#endif // FW_OBJECT_NAMES
|
||||
|
||||
#if FW_OBJECT_REGISTRATION == 1
|
||||
|
||||
//! \brief static function to set object registry.
|
||||
@ -81,7 +81,8 @@ namespace Fw {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
char m_objName[FW_OBJ_NAME_MAX_SIZE]; //!< stores object name
|
||||
|
||||
#endif
|
||||
|
||||
//! \brief ObjBase constructor
|
||||
//!
|
||||
//! The constructor for the base class. Protected so it will only be called
|
||||
@ -89,9 +90,6 @@ namespace Fw {
|
||||
//!
|
||||
//! \param name Object name
|
||||
ObjBase(const char* name);
|
||||
#else
|
||||
ObjBase(); // !< Constructor with no name
|
||||
#endif
|
||||
|
||||
//! \brief Destructor
|
||||
//!
|
||||
|
||||
@ -16,7 +16,6 @@ namespace Fw {
|
||||
|
||||
namespace Fw {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
PortBase::PortBase()
|
||||
:
|
||||
Fw::ObjBase(0),
|
||||
@ -28,19 +27,6 @@ namespace Fw {
|
||||
{
|
||||
|
||||
}
|
||||
#else // no object names
|
||||
PortBase::PortBase()
|
||||
:
|
||||
Fw::ObjBase(),
|
||||
m_connObj(0)
|
||||
#if FW_PORT_TRACING == 1
|
||||
,m_trace(false),
|
||||
m_override_trace(false)
|
||||
#endif
|
||||
{
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
PortBase::~PortBase(void) {
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ namespace Os {
|
||||
NATIVE_INT_TYPE getQueueSize(void) const; //!< get the queue depth (maximum number of messages queue can hold)
|
||||
NATIVE_INT_TYPE getMsgSize(void) const; //!< get the message size (maximum message size queue can hold)
|
||||
const QueueString& getName(void); //!< get the queue name
|
||||
NATIVE_INT_TYPE getNumQueues(void); //!< get the number of queues in the system
|
||||
static NATIVE_INT_TYPE getNumQueues(void); //!< get the number of queues in the system
|
||||
#if FW_QUEUE_REGISTRATION
|
||||
static void setQueueRegistry(QueueRegistry* reg); // !< set the queue registry
|
||||
#endif
|
||||
|
||||
@ -20,16 +20,10 @@ namespace Ref {
|
||||
// Construction, initialization, and destruction
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
PingReceiverComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
PingReceiverComponentImpl ::
|
||||
PingReceiverComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
PingReceiverComponentBase(compName)
|
||||
#else
|
||||
PingReceiverImpl(void)
|
||||
#endif
|
||||
,m_inhibitPings(false),m_pingsRecvd(0)
|
||||
) : PingReceiverComponentBase(compName), m_inhibitPings(false), m_pingsRecvd(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -30,11 +30,7 @@ namespace Ref {
|
||||
//! Construct object PingReceiver
|
||||
//!
|
||||
PingReceiverComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize object PingReceiver
|
||||
|
||||
@ -9,12 +9,8 @@
|
||||
|
||||
namespace Ref {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
RecvBuffImpl::RecvBuffImpl(const char* compName) :
|
||||
RecvBuffComponentBase(compName) {
|
||||
#else
|
||||
RecvBuffImpl::RecvBuffImpl() {
|
||||
#endif
|
||||
RecvBuffComponentBase(compName) {
|
||||
this->m_firstBuffReceived = 0;
|
||||
this->m_sensor1 = 1000.0;
|
||||
this->m_sensor2 = 10.0;
|
||||
|
||||
@ -9,11 +9,7 @@ namespace Ref {
|
||||
public:
|
||||
|
||||
// Only called by derived class
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
RecvBuffImpl(const char* compName);
|
||||
#else
|
||||
RecvBuffImpl();
|
||||
#endif
|
||||
|
||||
void init(void);
|
||||
~RecvBuffImpl(void);
|
||||
|
||||
@ -10,13 +10,8 @@
|
||||
|
||||
namespace Ref {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
SendBuffImpl::SendBuffImpl(const char* compName) :
|
||||
SendBuffComponentBase(compName) {
|
||||
#else
|
||||
SendBuffImpl::SendBuffImpl() {
|
||||
|
||||
#endif
|
||||
this->m_currPacketId = 0;
|
||||
this->m_invocations = 0;
|
||||
this->m_buffsSent = 0;
|
||||
|
||||
@ -11,11 +11,7 @@ namespace Ref {
|
||||
public:
|
||||
|
||||
// Only called by derived class
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
SendBuffImpl(const char* compName); //!< constructor
|
||||
#else
|
||||
SendBuffImpl(); //!< constructor
|
||||
#endif
|
||||
void init(NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance = 0); //!< initialization function
|
||||
~SendBuffImpl(void); //!< destructor
|
||||
|
||||
|
||||
@ -24,13 +24,8 @@ namespace Ref {
|
||||
|
||||
Tester ::
|
||||
Tester(void) :
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
SignalGenGTestBase("Tester", MAX_HISTORY_SIZE),
|
||||
component("SignalGen")
|
||||
#else
|
||||
SignalGenGTestBase(MAX_HISTORY_SIZE),
|
||||
component()
|
||||
#endif
|
||||
{
|
||||
this->initComponents();
|
||||
this->connectPorts();
|
||||
|
||||
@ -30,75 +30,83 @@ static Fw::SimpleObjRegistry simpleReg;
|
||||
|
||||
// Component instance pointers
|
||||
static NATIVE_INT_TYPE rgDivs[Svc::RateGroupDriverImpl::DIVIDER_SIZE] = {1,2,4};
|
||||
Svc::RateGroupDriverImpl rateGroupDriverComp("RGDvr",rgDivs,FW_NUM_ARRAY_ELEMENTS(rgDivs));
|
||||
Svc::RateGroupDriverImpl rateGroupDriverComp(FW_OPTIONAL_NAME("RGDvr"),rgDivs,FW_NUM_ARRAY_ELEMENTS(rgDivs));
|
||||
|
||||
static NATIVE_UINT_TYPE rg1Context[] = {0,0,0,0,0,0,0,0,0,0};
|
||||
Svc::ActiveRateGroupImpl rateGroup1Comp("RG1",rg1Context,FW_NUM_ARRAY_ELEMENTS(rg1Context));
|
||||
Svc::ActiveRateGroupImpl rateGroup1Comp(FW_OPTIONAL_NAME("RG1"),rg1Context,FW_NUM_ARRAY_ELEMENTS(rg1Context));
|
||||
|
||||
static NATIVE_UINT_TYPE rg2Context[] = {0,0,0,0,0,0,0,0,0,0};
|
||||
Svc::ActiveRateGroupImpl rateGroup2Comp("RG2",rg2Context,FW_NUM_ARRAY_ELEMENTS(rg2Context));
|
||||
Svc::ActiveRateGroupImpl rateGroup2Comp(FW_OPTIONAL_NAME("RG2"),rg2Context,FW_NUM_ARRAY_ELEMENTS(rg2Context));
|
||||
|
||||
static NATIVE_UINT_TYPE rg3Context[] = {0,0,0,0,0,0,0,0,0,0};
|
||||
Svc::ActiveRateGroupImpl rateGroup3Comp("RG3",rg3Context,FW_NUM_ARRAY_ELEMENTS(rg3Context));
|
||||
Svc::ActiveRateGroupImpl rateGroup3Comp(FW_OPTIONAL_NAME("RG3"),rg3Context,FW_NUM_ARRAY_ELEMENTS(rg3Context));
|
||||
|
||||
// Command Components
|
||||
Svc::GroundInterfaceComponentImpl groundIf("GNDIF");
|
||||
Svc::GroundInterfaceComponentImpl groundIf(FW_OPTIONAL_NAME("GNDIF"));
|
||||
|
||||
// Driver Component
|
||||
Drv::BlockDriverImpl blockDrv("BDRV");
|
||||
Drv::BlockDriverImpl blockDrv(FW_OPTIONAL_NAME("BDRV"));
|
||||
|
||||
// Reference Implementation Components
|
||||
|
||||
Ref::RecvBuffImpl recvBuffComp("RBC");
|
||||
Ref::RecvBuffImpl recvBuffComp(FW_OPTIONAL_NAME("RBC"));
|
||||
|
||||
Ref::SendBuffImpl sendBuffComp("SBC");
|
||||
Ref::SendBuffImpl sendBuffComp(FW_OPTIONAL_NAME("SBC"));
|
||||
|
||||
#if FW_ENABLE_TEXT_LOGGING
|
||||
Svc::ConsoleTextLoggerImpl textLogger("TLOG");
|
||||
Svc::ConsoleTextLoggerImpl textLogger(FW_OPTIONAL_NAME("TLOG"));
|
||||
#endif
|
||||
|
||||
Svc::ActiveLoggerImpl eventLogger("ELOG");
|
||||
Svc::ActiveLoggerImpl eventLogger(FW_OPTIONAL_NAME("ELOG"));
|
||||
|
||||
Svc::LinuxTimeImpl linuxTime("LTIME");
|
||||
Svc::LinuxTimeImpl linuxTime(FW_OPTIONAL_NAME("LTIME"));
|
||||
|
||||
Svc::TlmChanImpl chanTlm("TLM");
|
||||
Svc::TlmChanImpl chanTlm(FW_OPTIONAL_NAME("TLM"));
|
||||
|
||||
Svc::CommandDispatcherImpl cmdDisp("CMDDISP");
|
||||
Svc::CommandDispatcherImpl cmdDisp(FW_OPTIONAL_NAME("CMDDISP"));
|
||||
|
||||
Fw::MallocAllocator seqMallocator;
|
||||
Svc::CmdSequencerComponentImpl cmdSeq("CMDSEQ");
|
||||
Svc::CmdSequencerComponentImpl cmdSeq(FW_OPTIONAL_NAME("CMDSEQ"));
|
||||
|
||||
Svc::PrmDbImpl prmDb("PRM","PrmDb.dat");
|
||||
Svc::PrmDbImpl prmDb(FW_OPTIONAL_NAME("PRM"),"PrmDb.dat");
|
||||
|
||||
Ref::PingReceiverComponentImpl pingRcvr("PngRecv");
|
||||
Ref::PingReceiverComponentImpl pingRcvr(FW_OPTIONAL_NAME("PngRecv"));
|
||||
|
||||
Drv::SocketIpDriverComponentImpl socketIpDriver("SocketIpDriver");
|
||||
Drv::SocketIpDriverComponentImpl socketIpDriver(FW_OPTIONAL_NAME("SocketIpDriver"));
|
||||
|
||||
Svc::FileUplink fileUplink ("fileUplink");
|
||||
Svc::FileUplink fileUplink(FW_OPTIONAL_NAME("fileUplink"));
|
||||
|
||||
Svc::FileDownlink fileDownlink ("fileDownlink", DOWNLINK_PACKET_SIZE);
|
||||
Svc::FileDownlink fileDownlink(FW_OPTIONAL_NAME("fileDownlink"), DOWNLINK_PACKET_SIZE);
|
||||
|
||||
Svc::FileManager fileManager ("fileManager");
|
||||
Svc::FileManager fileManager(FW_OPTIONAL_NAME("fileManager"));
|
||||
|
||||
Svc::BufferManager fileDownlinkBufferManager("fileDownlinkBufferManager", DOWNLINK_BUFFER_STORE_SIZE, DOWNLINK_BUFFER_QUEUE_SIZE);
|
||||
Svc::BufferManager fileDownlinkBufferManager(FW_OPTIONAL_NAME("fileDownlinkBufferManager"), DOWNLINK_BUFFER_STORE_SIZE, DOWNLINK_BUFFER_QUEUE_SIZE);
|
||||
|
||||
Svc::BufferManager fileUplinkBufferManager("fileUplinkBufferManager", UPLINK_BUFFER_STORE_SIZE, UPLINK_BUFFER_QUEUE_SIZE);
|
||||
Svc::BufferManager fileUplinkBufferManager(FW_OPTIONAL_NAME("fileUplinkBufferManager"), UPLINK_BUFFER_STORE_SIZE, UPLINK_BUFFER_QUEUE_SIZE);
|
||||
|
||||
Svc::HealthImpl health("health");
|
||||
Svc::HealthImpl health(FW_OPTIONAL_NAME("health"));
|
||||
|
||||
Ref::SignalGen SG1("signalGen1");
|
||||
Ref::SignalGen SG1(FW_OPTIONAL_NAME("signalGen1"));
|
||||
|
||||
Ref::SignalGen SG2("signalGen2");
|
||||
Ref::SignalGen SG2(FW_OPTIONAL_NAME("signalGen2"));
|
||||
|
||||
Ref::SignalGen SG3("signalGen3");
|
||||
Ref::SignalGen SG3(FW_OPTIONAL_NAME("signalGen3"));
|
||||
|
||||
Ref::SignalGen SG4("signalGen4");
|
||||
Ref::SignalGen SG4(FW_OPTIONAL_NAME("signalGen4"));
|
||||
|
||||
Ref::SignalGen SG5("signalGen5");
|
||||
Ref::SignalGen SG5(FW_OPTIONAL_NAME("signalGen5"));
|
||||
|
||||
Svc::AssertFatalAdapterComponentImpl fatalAdapter("fatalAdapter");
|
||||
Svc::AssertFatalAdapterComponentImpl fatalAdapter(FW_OPTIONAL_NAME("fatalAdapter"));
|
||||
|
||||
Svc::FatalHandlerComponentImpl fatalHandler("fatalHandler");
|
||||
Svc::FatalHandlerComponentImpl fatalHandler(FW_OPTIONAL_NAME("fatalHandler"));
|
||||
|
||||
const char* getHealthName(Fw::ObjBase& comp) {
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
return comp.getObjName();
|
||||
#else
|
||||
return "[no object name]"
|
||||
#endif
|
||||
}
|
||||
|
||||
bool constructApp(bool dump, U32 port_number, char* hostname) {
|
||||
|
||||
@ -149,14 +157,14 @@ bool constructApp(bool dump, U32 port_number, char* hostname) {
|
||||
fileUplinkBufferManager.init(0);
|
||||
fileDownlinkBufferManager.init(1);
|
||||
SG1.init(10,0);
|
||||
SG2.init(10,1);
|
||||
SG3.init(10,2);
|
||||
SG4.init(10,3);
|
||||
SG5.init(10,4);
|
||||
fatalAdapter.init(0);
|
||||
fatalHandler.init(0);
|
||||
health.init(25,0);
|
||||
pingRcvr.init(10);
|
||||
SG2.init(10,1);
|
||||
SG3.init(10,2);
|
||||
SG4.init(10,3);
|
||||
SG5.init(10,4);
|
||||
fatalAdapter.init(0);
|
||||
fatalHandler.init(0);
|
||||
health.init(25,0);
|
||||
pingRcvr.init(10);
|
||||
// Connect rate groups to rate group driver
|
||||
constructRefArchitecture();
|
||||
|
||||
@ -193,19 +201,19 @@ bool constructApp(bool dump, U32 port_number, char* hostname) {
|
||||
// set health ping entries
|
||||
|
||||
Svc::HealthImpl::PingEntry pingEntries[] = {
|
||||
{3,5,rateGroup1Comp.getObjName()}, // 0
|
||||
{3,5,rateGroup2Comp.getObjName()}, // 1
|
||||
{3,5,rateGroup3Comp.getObjName()}, // 2
|
||||
{3,5,cmdDisp.getObjName()}, // 3
|
||||
{3,5,eventLogger.getObjName()}, // 4
|
||||
{3,5,cmdSeq.getObjName()}, // 5
|
||||
{3,5,chanTlm.getObjName()}, // 6
|
||||
{3,5,prmDb.getObjName()}, // 7
|
||||
{3,5,fileUplink.getObjName()}, // 8
|
||||
{3,5,fileDownlink.getObjName()}, // 9
|
||||
{3,5,pingRcvr.getObjName()}, // 10
|
||||
{3,5,blockDrv.getObjName()}, // 11
|
||||
{3,5,fileManager.getObjName()}, // 12
|
||||
{3,5,getHealthName(rateGroup1Comp)}, // 0
|
||||
{3,5,getHealthName(rateGroup2Comp)}, // 1
|
||||
{3,5,getHealthName(rateGroup3Comp)}, // 2
|
||||
{3,5,getHealthName(cmdDisp)}, // 3
|
||||
{3,5,getHealthName(eventLogger)}, // 4
|
||||
{3,5,getHealthName(cmdSeq)}, // 5
|
||||
{3,5,getHealthName(chanTlm)}, // 6
|
||||
{3,5,getHealthName(prmDb)}, // 7
|
||||
{3,5,getHealthName(fileUplink)}, // 8
|
||||
{3,5,getHealthName(fileDownlink)}, // 9
|
||||
{3,5,getHealthName(pingRcvr)}, // 10
|
||||
{3,5,getHealthName(blockDrv)}, // 11
|
||||
{3,5,getHealthName(fileManager)}, // 12
|
||||
};
|
||||
|
||||
// register ping table
|
||||
|
||||
@ -11,19 +11,15 @@
|
||||
|
||||
namespace Svc {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ActiveLoggerImpl::ActiveLoggerImpl(const char* name) : ActiveLoggerComponentBase(name)
|
||||
#else
|
||||
ActiveLoggerImpl::ActiveLoggerImpl() :
|
||||
ActiveLoggerComponentBase()
|
||||
#endif
|
||||
,m_fatalHead(0)
|
||||
,m_warningHiHead(0)
|
||||
,m_warningLoHead(0)
|
||||
,m_commandHead(0)
|
||||
,m_activityHiHead(0)
|
||||
,m_activityLoHead(0)
|
||||
,m_diagnosticHead(0)
|
||||
ActiveLoggerImpl::ActiveLoggerImpl(const char* name) :
|
||||
ActiveLoggerComponentBase(name),
|
||||
m_fatalHead(0),
|
||||
m_warningHiHead(0),
|
||||
m_warningLoHead(0),
|
||||
m_commandHead(0),
|
||||
m_activityHiHead(0),
|
||||
m_activityLoHead(0),
|
||||
m_diagnosticHead(0)
|
||||
{
|
||||
// set input filter defaults
|
||||
this->m_inFilterState[INPUT_WARNING_HI].enabled =
|
||||
|
||||
@ -16,11 +16,7 @@ namespace Svc {
|
||||
|
||||
class ActiveLoggerImpl: public ActiveLoggerComponentBase {
|
||||
public:
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ActiveLoggerImpl(const char* compName); //!< constructor
|
||||
#else
|
||||
ActiveLoggerImpl(); //!< constructor
|
||||
#endif
|
||||
virtual ~ActiveLoggerImpl(); //!< destructor
|
||||
void init(
|
||||
NATIVE_INT_TYPE queueDepth, /*!< The queue depth*/
|
||||
|
||||
@ -20,13 +20,13 @@
|
||||
|
||||
namespace Svc {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ActiveRateGroupImpl::ActiveRateGroupImpl(const char* compName, NATIVE_UINT_TYPE contexts[], NATIVE_UINT_TYPE numContexts) :
|
||||
ActiveRateGroupComponentBase(compName),
|
||||
#else
|
||||
ActiveRateGroupImpl::ActiveRateGroupImpl(NATIVE_UINT_TYPE contexts[], NATIVE_UINT_TYPE numContexts) :
|
||||
#endif
|
||||
m_cycles(0), m_maxTime(0),m_cycleStarted(false),m_overrunThrottle(0),m_cycleSlips(0) {
|
||||
ActiveRateGroupComponentBase(compName),
|
||||
m_cycles(0),
|
||||
m_maxTime(0),
|
||||
m_cycleStarted(false),
|
||||
m_overrunThrottle(0),
|
||||
m_cycleSlips(0) {
|
||||
FW_ASSERT(contexts);
|
||||
FW_ASSERT(numContexts == static_cast<NATIVE_UINT_TYPE>(this->getNum_RateGroupMemberOut_OutputPorts()),numContexts,this->getNum_RateGroupMemberOut_OutputPorts());
|
||||
FW_ASSERT(FW_NUM_ARRAY_ELEMENTS(this->m_contexts) == this->getNum_RateGroupMemberOut_OutputPorts(),
|
||||
|
||||
@ -41,13 +41,8 @@ namespace Svc {
|
||||
//! to each member component. The index of the array corresponds to the
|
||||
//! output port number.
|
||||
//! \param numContexts The number of elements in the context array.
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ActiveRateGroupImpl(const char* compName, NATIVE_UINT_TYPE contexts[], NATIVE_UINT_TYPE numContexts);
|
||||
#else
|
||||
ActiveRateGroupImpl(NATIVE_UINT_TYPE contexts[], NATIVE_UINT_TYPE numContexts);
|
||||
#endif
|
||||
|
||||
|
||||
//! \brief ActiveRateGroupImpl initialization function
|
||||
//!
|
||||
//! The initialization function of the class initializes the member
|
||||
|
||||
@ -13,13 +13,8 @@ namespace Svc {
|
||||
// Initialization/Exiting
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ActiveTextLoggerComponentImpl::ActiveTextLoggerComponentImpl(const char* name) :
|
||||
ActiveTextLoggerComponentBase(name),
|
||||
#else
|
||||
ActiveTextLoggerComponentImpl::ActiveTextLoggerComponentImpl() :
|
||||
ActiveTextLoggerComponentBase(),
|
||||
#endif
|
||||
ActiveTextLoggerComponentBase(name),
|
||||
m_log_file()
|
||||
{
|
||||
|
||||
|
||||
@ -33,11 +33,7 @@ namespace Svc {
|
||||
//! type conversion.
|
||||
//!
|
||||
//! \param compName the component instance name
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
explicit ActiveTextLoggerComponentImpl(const char* compName);
|
||||
#else
|
||||
ActiveTextLoggerComponentImpl();
|
||||
#endif
|
||||
|
||||
//! \brief Component destructor
|
||||
//!
|
||||
|
||||
@ -43,14 +43,9 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
AssertFatalAdapterComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
AssertFatalAdapterComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
AssertFatalAdapterComponentBase(compName)
|
||||
#else
|
||||
AssertFatalAdapterImpl(void)
|
||||
#endif
|
||||
) : AssertFatalAdapterComponentBase(compName)
|
||||
{
|
||||
// register component with adapter
|
||||
this->m_adapter.regAssertReporter(this);
|
||||
|
||||
@ -30,11 +30,7 @@ namespace Svc {
|
||||
//! Construct object AssertFatalAdapter
|
||||
//!
|
||||
AssertFatalAdapterComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize object AssertFatalAdapter
|
||||
|
||||
@ -20,18 +20,14 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
BufferAccumulator ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
BufferAccumulator(const char *const compName) :
|
||||
BufferAccumulatorComponentBase(compName), //!< The component name
|
||||
#else
|
||||
BufferAccumulator() : BufferAccumulatorComponentBase(),
|
||||
#endif
|
||||
mode(DRAIN),
|
||||
bufferMemory(NULL),
|
||||
bufferQueue(),
|
||||
send(true),
|
||||
numWarnings(0),
|
||||
allocatorId(0)
|
||||
BufferAccumulatorComponentBase(compName),
|
||||
mode(DRAIN),
|
||||
bufferMemory(NULL),
|
||||
bufferQueue(),
|
||||
send(true),
|
||||
numWarnings(0),
|
||||
allocatorId(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -95,9 +95,7 @@ namespace Svc {
|
||||
//! Construct BufferAccumulator instance
|
||||
//!
|
||||
BufferAccumulator(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize BufferAccumulator instance
|
||||
|
||||
@ -19,14 +19,10 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
BufferLogger ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
BufferLogger(const char *const compName) :
|
||||
BufferLoggerComponentBase(compName), //!< The component name
|
||||
#else
|
||||
BufferLogger() : BufferLoggerComponentBase(),
|
||||
#endif
|
||||
m_state(LOGGING_ON),
|
||||
m_file(*this)
|
||||
BufferLoggerComponentBase(compName),
|
||||
m_state(LOGGING_ON),
|
||||
m_file(*this)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -158,9 +158,7 @@ namespace Svc {
|
||||
|
||||
//! Create a BufferLogger object
|
||||
BufferLogger(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize a BufferLogger object
|
||||
|
||||
@ -11,13 +11,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
namespace Svc {
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
CommandDispatcherImpl::CommandDispatcherImpl(const char* name) :
|
||||
CommandDispatcherComponentBase(name),
|
||||
#else
|
||||
CommandDispatcherImpl::CommandDispatcherImpl() :
|
||||
#endif
|
||||
m_seq(0), m_numCmdsDispatched(0), m_numCmdErrors(0)
|
||||
m_seq(0),
|
||||
m_numCmdsDispatched(0),
|
||||
m_numCmdErrors(0)
|
||||
{
|
||||
memset(this->m_entryTable,0,sizeof(this->m_entryTable));
|
||||
memset(this->m_sequenceTracker,0,sizeof(this->m_sequenceTracker));
|
||||
|
||||
@ -38,11 +38,7 @@ namespace Svc {
|
||||
//! are initialized.
|
||||
//!
|
||||
//! \param name the component instance name
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
CommandDispatcherImpl(const char* name);
|
||||
#else
|
||||
CommandDispatcherImpl();
|
||||
#endif
|
||||
//! \brief Component initialization routine
|
||||
//!
|
||||
//! The initialization function calls the initialization
|
||||
|
||||
@ -26,13 +26,8 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
CmdSequencerComponentImpl::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
CmdSequencerComponentImpl(const char* name) :
|
||||
CmdSequencerComponentBase(name),
|
||||
#else
|
||||
CmdSequencerComponentImpl(void) :
|
||||
CmdSequencerComponentBase(),
|
||||
#endif
|
||||
m_FPrimeSequence(*this),
|
||||
m_sequence(&this->m_FPrimeSequence),
|
||||
m_loadCmdCount(0),
|
||||
|
||||
@ -539,11 +539,7 @@ namespace Svc {
|
||||
|
||||
//! Construct a CmdSequencer
|
||||
CmdSequencerComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char* compName //!< The component name
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize a CmdSequencer
|
||||
|
||||
@ -17,18 +17,14 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
ComLogger ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ComLogger(const char* compName, const char* incomingFilePrefix, U32 maxFileSize, bool storeBufferLength) :
|
||||
ComLoggerComponentBase(compName),
|
||||
#else
|
||||
ComLogger(const char* incomingFilePrefix, U32 maxFileSize, bool storeBufferLength) :
|
||||
#endif
|
||||
maxFileSize(maxFileSize),
|
||||
fileMode(CLOSED),
|
||||
byteCount(0),
|
||||
writeErrorOccured(false),
|
||||
openErrorOccured(false),
|
||||
storeBufferLength(storeBufferLength)
|
||||
ComLoggerComponentBase(compName),
|
||||
maxFileSize(maxFileSize),
|
||||
fileMode(CLOSED),
|
||||
byteCount(0),
|
||||
writeErrorOccured(false),
|
||||
openErrorOccured(false),
|
||||
storeBufferLength(storeBufferLength)
|
||||
{
|
||||
if( this->storeBufferLength ) {
|
||||
FW_ASSERT(maxFileSize > sizeof(U16), maxFileSize); // must be a positive integer greater than buffer length size
|
||||
|
||||
@ -36,11 +36,7 @@ namespace Svc {
|
||||
// where you can ensure that all buffers given to the ComLogger are the same size
|
||||
// in which case you do not need the overhead. Or you store an id which you can
|
||||
// match to an expected size on the ground during post processing.
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ComLogger(const char* compName, const char* filePrefix, U32 maxFileSize, bool storeBufferLength=true);
|
||||
#else
|
||||
ComLogger(const char* filePrefix, U32 maxFileSize, bool storeBufferLength=true);
|
||||
#endif
|
||||
|
||||
void init(
|
||||
NATIVE_INT_TYPE queueDepth, //!< The queue depth
|
||||
|
||||
@ -14,12 +14,8 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
ComSplitter ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ComSplitter(const char* compName) :
|
||||
ComSplitterComponentBase(compName)
|
||||
#else
|
||||
ComSplitter(void)
|
||||
#endif
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -28,11 +28,7 @@ namespace Svc {
|
||||
|
||||
public:
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ComSplitter(const char* compName);
|
||||
#else
|
||||
ComSplitter(void);
|
||||
#endif
|
||||
|
||||
~ComSplitter(void);
|
||||
|
||||
|
||||
@ -21,14 +21,9 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
FatalHandlerComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
FatalHandlerComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
FatalHandlerComponentBase(compName)
|
||||
#else
|
||||
FatalHandlerImpl(void)
|
||||
#endif
|
||||
) : FatalHandlerComponentBase(compName)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -30,11 +30,7 @@ namespace Svc {
|
||||
//! Construct object FatalHandler
|
||||
//!
|
||||
FatalHandlerComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize object FatalHandler
|
||||
|
||||
@ -20,17 +20,12 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
GroundInterfaceComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
GroundInterfaceComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
GroundInterfaceComponentBase(compName),
|
||||
#else
|
||||
GroundInterfaceComponentBase(void),
|
||||
#endif
|
||||
m_ext_buffer(0xfeedfeed, 0xdeeddeed, reinterpret_cast<POINTER_CAST>(m_buffer), GND_BUFFER_SIZE),
|
||||
m_data_size(0),
|
||||
m_in_ring(m_in_buffer, GND_BUFFER_SIZE)
|
||||
) : GroundInterfaceComponentBase(compName),
|
||||
m_ext_buffer(0xfeedfeed, 0xdeeddeed, reinterpret_cast<POINTER_CAST>(m_buffer), GND_BUFFER_SIZE),
|
||||
m_data_size(0),
|
||||
m_in_ring(m_in_buffer, GND_BUFFER_SIZE)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -29,11 +29,7 @@ namespace Svc {
|
||||
//! Construct object GroundInterface
|
||||
//!
|
||||
GroundInterfaceComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize object GroundInterface
|
||||
|
||||
@ -20,20 +20,14 @@ namespace Svc {
|
||||
// Construction, initialization, and destruction
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
HealthImpl::HealthImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char * const compName
|
||||
#endif
|
||||
) :
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
HealthComponentBase(compName),
|
||||
#endif
|
||||
m_numPingEntries(0),
|
||||
m_key(0),
|
||||
m_watchDogCode(0),
|
||||
m_warnings(0),
|
||||
m_enabled(HLTH_CHK_ENABLED),
|
||||
queue_depth(0) {
|
||||
HealthImpl::HealthImpl(const char * const compName) :
|
||||
HealthComponentBase(compName),
|
||||
m_numPingEntries(0),
|
||||
m_key(0),
|
||||
m_watchDogCode(0),
|
||||
m_warnings(0),
|
||||
m_enabled(HLTH_CHK_ENABLED),
|
||||
queue_depth(0) {
|
||||
// clear tracker by disabling pings
|
||||
for (NATIVE_UINT_TYPE entry = 0;
|
||||
entry < FW_NUM_ARRAY_ELEMENTS(this->m_pingTrackerEntries);
|
||||
|
||||
@ -53,11 +53,7 @@ namespace Svc {
|
||||
//! The constructor for Health
|
||||
//!
|
||||
//! \param compName component name
|
||||
HealthImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char * const compName //!< The component name
|
||||
#endif
|
||||
);
|
||||
HealthImpl(const char * const compName);
|
||||
|
||||
//! \brief HealthImpl initialization function
|
||||
//!
|
||||
|
||||
@ -11,11 +11,7 @@
|
||||
|
||||
namespace Svc {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
LinuxTimeImpl::LinuxTimeImpl(const char* name) : TimeComponentBase(name)
|
||||
#else
|
||||
LinuxTimeImpl::LinuxTimeImpl()
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -14,11 +14,7 @@ namespace Svc {
|
||||
|
||||
class LinuxTimeImpl: public TimeComponentBase {
|
||||
public:
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
LinuxTimeImpl(const char* compName);
|
||||
#else
|
||||
LinuxTimeImpl();
|
||||
#endif
|
||||
virtual ~LinuxTimeImpl();
|
||||
void init(NATIVE_INT_TYPE instance);
|
||||
protected:
|
||||
|
||||
@ -30,11 +30,7 @@ namespace Svc {
|
||||
//! Construct object LinuxTimer
|
||||
//!
|
||||
LinuxTimerComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize object LinuxTimer
|
||||
|
||||
@ -21,15 +21,10 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
LinuxTimerComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
LinuxTimerComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
LinuxTimerComponentBase(compName)
|
||||
#else
|
||||
LinuxTimerImpl(void)
|
||||
#endif
|
||||
,m_quit(false)
|
||||
) : LinuxTimerComponentBase(compName),
|
||||
m_quit(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -9,12 +9,8 @@ namespace Svc {
|
||||
|
||||
public:
|
||||
|
||||
// Only called by derived class
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
// Only called by derived class
|
||||
ConsoleTextLoggerImpl(const char* compName);
|
||||
#else
|
||||
ConsoleTextLoggerImpl();
|
||||
#endif
|
||||
void init(void);
|
||||
~ConsoleTextLoggerImpl(void);
|
||||
|
||||
|
||||
@ -5,15 +5,9 @@
|
||||
|
||||
namespace Svc {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
ConsoleTextLoggerImpl::ConsoleTextLoggerImpl(const char* compName) :
|
||||
PassiveTextLoggerComponentBase(compName),m_displayLine(2),m_pointerLine(0) {
|
||||
}
|
||||
#else
|
||||
ConsoleTextLoggerImpl::ConsoleTextLoggerImpl() :
|
||||
PassiveTextLoggerComponentBase(),m_displayLine(2),m_pointerLine(0) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void ConsoleTextLoggerImpl::init(void) {
|
||||
PassiveTextLoggerComponentBase::init();
|
||||
|
||||
@ -10,11 +10,7 @@
|
||||
#include <Fw/Types/BasicTypes.hpp>
|
||||
|
||||
namespace Svc {
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
PolyDbImpl::PolyDbImpl(const char* name) : PolyDbComponentBase(name) {
|
||||
#else
|
||||
PolyDbImpl::PolyDbImpl() {
|
||||
#endif
|
||||
// initialize all entries to stale
|
||||
for (NATIVE_INT_TYPE entry = 0; entry < POLYDB_NUM_DB_ENTRIES; entry++) {
|
||||
this->m_db[entry].status = MEASUREMENT_STALE;
|
||||
|
||||
@ -37,11 +37,8 @@ namespace Svc {
|
||||
//! update is received.
|
||||
//!
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
PolyDbImpl(const char* name);
|
||||
#else
|
||||
PolyDbImpl();
|
||||
#endif
|
||||
|
||||
//! \brief PolyDbImpl initialization
|
||||
//!
|
||||
//! The PolyDbImpl initialization function calls the base
|
||||
|
||||
@ -39,12 +39,7 @@ namespace Svc {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
PrmDbImpl::PrmDbImpl(const char* name, const char* file) : PrmDbComponentBase(name) {
|
||||
#else
|
||||
PrmDbImpl::PrmDbImpl(const char* file) {
|
||||
#endif
|
||||
this->clearDb();
|
||||
this->m_fileName = file;
|
||||
}
|
||||
|
||||
@ -40,11 +40,8 @@ namespace Svc {
|
||||
//!
|
||||
//! \param name component instance name
|
||||
//! \param file file where parameters are stored.
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
PrmDbImpl(const char* name, const char* file);
|
||||
#else
|
||||
PrmDbImpl(const char* file);
|
||||
#endif
|
||||
|
||||
//! \brief PrmDb initialization function
|
||||
//!
|
||||
//! The initialization function for the component creates the message
|
||||
|
||||
@ -6,12 +6,8 @@
|
||||
|
||||
namespace Svc {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
RateGroupDriverImpl::RateGroupDriverImpl(const char* compName, I32 dividers[], I32 numDividers) :
|
||||
RateGroupDriverComponentBase(compName),
|
||||
#else
|
||||
RateGroupDriverImpl::RateGroupDriverImpl(I32 dividers[], I32 numDividers) :
|
||||
#endif
|
||||
m_ticks(0),m_rollover(1)
|
||||
{
|
||||
|
||||
|
||||
@ -44,11 +44,7 @@ namespace Svc {
|
||||
//! \param numDividers size of dividers array
|
||||
//!
|
||||
//! \return return value description
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
RateGroupDriverImpl(const char* compName, NATIVE_INT_TYPE dividers[], NATIVE_INT_TYPE numDividers);
|
||||
#else
|
||||
RateGroupDriverImpl(NATIVE_INT_TYPE dividers[], NATIVE_INT_TYPE numDividers);
|
||||
#endif
|
||||
|
||||
//! \brief RateGroupDriverImpl initialization function
|
||||
//!
|
||||
|
||||
@ -19,11 +19,7 @@
|
||||
|
||||
namespace Svc {
|
||||
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
TlmChanImpl::TlmChanImpl(const char* name) : TlmChanComponentBase(name)
|
||||
#else
|
||||
TlmChanImpl::TlmChanImpl()
|
||||
#endif
|
||||
{
|
||||
// clear data
|
||||
this->m_activeBuffer = 0;
|
||||
|
||||
@ -23,11 +23,7 @@ namespace Svc {
|
||||
class TlmChanImpl: public TlmChanComponentBase {
|
||||
public:
|
||||
friend class TlmChanImplTester;
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
TlmChanImpl(const char* compName);
|
||||
#else
|
||||
TlmChanImpl();
|
||||
#endif
|
||||
virtual ~TlmChanImpl();
|
||||
void init(
|
||||
NATIVE_INT_TYPE queueDepth, /*!< The queue depth*/
|
||||
|
||||
@ -32,21 +32,16 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
UdpReceiverComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
UdpReceiverComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
UdpReceiverComponentBase(compName)
|
||||
#else
|
||||
UdpReceiverImpl(void)
|
||||
#endif
|
||||
,m_fd(-1)
|
||||
,m_packetsReceived(0)
|
||||
,m_bytesReceived(0)
|
||||
,m_packetsDropped(0)
|
||||
,m_decodeErrors(0)
|
||||
,m_firstSeq(true)
|
||||
,m_currSeq(0)
|
||||
) : UdpReceiverComponentBase(compName),
|
||||
m_fd(-1),
|
||||
m_packetsReceived(0),
|
||||
m_bytesReceived(0),
|
||||
m_packetsDropped(0),
|
||||
m_decodeErrors(0),
|
||||
m_firstSeq(true),
|
||||
m_currSeq(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -31,11 +31,7 @@ namespace Svc {
|
||||
//! Construct object UdpReceiver
|
||||
//!
|
||||
UdpReceiverComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize object UdpReceiver
|
||||
|
||||
@ -29,18 +29,13 @@ namespace Svc {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
UdpSenderComponentImpl ::
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
UdpSenderComponentImpl(
|
||||
const char *const compName
|
||||
) :
|
||||
UdpSenderComponentBase(compName)
|
||||
#else
|
||||
UdpSenderImpl(void)
|
||||
#endif
|
||||
,m_fd(-1)
|
||||
,m_packetsSent(0)
|
||||
,m_bytesSent(0)
|
||||
,m_seq(0)
|
||||
) : UdpSenderComponentBase(compName),
|
||||
m_fd(-1),
|
||||
m_packetsSent(0),
|
||||
m_bytesSent(0),
|
||||
m_seq(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -34,11 +34,7 @@ namespace Svc {
|
||||
//! Construct object UdpSender
|
||||
//!
|
||||
UdpSenderComponentImpl(
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
const char *const compName /*!< The component name*/
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
//! Initialize object UdpSender
|
||||
|
||||
@ -91,6 +91,14 @@
|
||||
#define FW_OBJECT_NAMES 1 //!< Indicates whether or not object names are stored (more memory, can be used for tracking objects)
|
||||
#endif
|
||||
|
||||
// To reduce binary size, FW_OPTIONAL_NAME(<string>) can be used to subsitute strings with an empty string
|
||||
// when running with FW_OBJECT_NAMES disabled
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
#define FW_OPTIONAL_NAME(name) name
|
||||
#else
|
||||
#define FW_OPTIONAL_NAME(name) ""
|
||||
#endif
|
||||
|
||||
// Add methods to query an object about its name. Can be overridden by derived classes
|
||||
// For FW_OBJECT_TO_STRING to work, FW_OBJECT_NAMES must be enabled
|
||||
#if FW_OBJECT_NAMES == 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user