From 3cccd731d914886a7f9ed2f56541c94987bc8a49 Mon Sep 17 00:00:00 2001 From: Joshua Anderson Date: Wed, 7 Oct 2020 14:21:08 -0700 Subject: [PATCH] Refactor FW_OBJECT_NAMES switches and fix building without object names Instead of adding the name argument to a constructor when FW_OBJECT_NAMES is enabled, always supply a name argument. Add a marco that conditionally sets the name to "" if FW_OBJECT_NAMES is not set. This cleans up a lot of the conditional compilation switches that weren't being tested and would silently break, while still stripping the strings from the binary. --- .../generators/templates/component/cpp.tmpl | 33 +----- .../generators/templates/component/hpp.tmpl | 9 +- .../generators/templates/impl/cpp.tmpl | 7 +- .../generators/templates/impl/hpp.tmpl | 4 - Drv/BlockDriver/BlockDriverImpl.cpp | 8 +- Drv/BlockDriver/BlockDriverImpl.hpp | 32 +++-- .../LinuxGpioDriverComponentImpl.hpp | 4 - .../LinuxGpioDriverComponentImplCommon.cpp | 15 +-- .../LinuxI2cDriverComponentImpl.cpp | 9 +- .../LinuxI2cDriverComponentImpl.hpp | 8 +- .../LinuxI2cDriverComponentImplStub.cpp | 9 +- .../LinuxSerialDriverComponentImpl.hpp | 4 - .../LinuxSerialDriverComponentImplCommon.cpp | 12 +- .../LinuxSpiDriverComponentImpl.hpp | 6 +- .../LinuxSpiDriverComponentImplCommon.cpp | 11 +- .../SocketIpDriverComponentImpl.cpp | 14 +-- .../SocketIpDriverComponentImpl.hpp | 2 - Fw/Comp/ActiveComponentBase.cpp | 5 - Fw/Comp/ActiveComponentBase.hpp | 4 - Fw/Comp/PassiveComponentBase.cpp | 5 - Fw/Comp/PassiveComponentBase.hpp | 4 - Fw/Comp/QueuedComponentBase.cpp | 5 - Fw/Comp/QueuedComponentBase.hpp | 5 - Fw/Obj/ObjBase.cpp | 9 +- Fw/Obj/ObjBase.hpp | 8 +- Fw/Port/PortBase.cpp | 14 --- Os/Queue.hpp | 2 +- .../PingReceiverComponentImpl.cpp | 10 +- .../PingReceiverComponentImpl.hpp | 4 - Ref/RecvBuffApp/RecvBuffComponentImpl.cpp | 6 +- Ref/RecvBuffApp/RecvBuffComponentImpl.hpp | 4 - Ref/SendBuffApp/SendBuffComponentImpl.cpp | 5 - Ref/SendBuffApp/SendBuffComponentImpl.hpp | 4 - Ref/SignalGen/test/ut/Tester.cpp | 5 - Ref/Top/Topology.cpp | 110 ++++++++++-------- Svc/ActiveLogger/ActiveLoggerImpl.cpp | 22 ++-- Svc/ActiveLogger/ActiveLoggerImpl.hpp | 4 - Svc/ActiveRateGroup/ActiveRateGroupImpl.cpp | 12 +- Svc/ActiveRateGroup/ActiveRateGroupImpl.hpp | 7 +- Svc/ActiveTextLogger/ActiveTextLoggerImpl.cpp | 7 +- Svc/ActiveTextLogger/ActiveTextLoggerImpl.hpp | 4 - .../AssertFatalAdapterComponentImpl.cpp | 7 +- .../AssertFatalAdapterComponentImpl.hpp | 4 - Svc/BufferAccumulator/BufferAccumulator.cpp | 18 ++- Svc/BufferAccumulator/BufferAccumulator.hpp | 2 - Svc/BufferLogger/BufferLogger.cpp | 10 +- Svc/BufferLogger/BufferLogger.hpp | 2 - Svc/CmdDispatcher/CommandDispatcherImpl.cpp | 8 +- Svc/CmdDispatcher/CommandDispatcherImpl.hpp | 4 - Svc/CmdSequencer/CmdSequencerImpl.cpp | 5 - Svc/CmdSequencer/CmdSequencerImpl.hpp | 4 - Svc/ComLogger/ComLogger.cpp | 18 ++- Svc/ComLogger/ComLogger.hpp | 4 - Svc/ComSplitter/ComSplitter.cpp | 4 - Svc/ComSplitter/ComSplitter.hpp | 4 - .../FatalHandlerComponentCommonImpl.cpp | 7 +- .../FatalHandlerComponentImpl.hpp | 4 - Svc/GroundInterface/GroundInterface.cpp | 13 +-- Svc/GroundInterface/GroundInterface.hpp | 4 - Svc/Health/HealthComponentImpl.cpp | 22 ++-- Svc/Health/HealthComponentImpl.hpp | 6 +- Svc/LinuxTime/LinuxTimeImpl.cpp | 4 - Svc/LinuxTime/LinuxTimeImpl.hpp | 4 - Svc/LinuxTimer/LinuxTimerComponentImpl.hpp | 4 - .../LinuxTimerComponentImplCommon.cpp | 9 +- .../ConsoleTextLoggerImpl.hpp | 6 +- .../ConsoleTextLoggerImplCommon.cpp | 6 - Svc/PolyDb/PolyDbImpl.cpp | 4 - Svc/PolyDb/PolyDbImpl.hpp | 5 +- Svc/PrmDb/PrmDbImpl.cpp | 5 - Svc/PrmDb/PrmDbImpl.hpp | 5 +- Svc/RateGroupDriver/RateGroupDriverImpl.cpp | 4 - Svc/RateGroupDriver/RateGroupDriverImpl.hpp | 4 - Svc/TlmChan/TlmChanImpl.cpp | 4 - Svc/TlmChan/TlmChanImpl.hpp | 4 - Svc/UdpReceiver/UdpReceiverComponentImpl.cpp | 21 ++-- Svc/UdpReceiver/UdpReceiverComponentImpl.hpp | 4 - Svc/UdpSender/UdpSenderComponentImpl.cpp | 15 +-- Svc/UdpSender/UdpSenderComponentImpl.hpp | 4 - config/FpConfig.hpp | 8 ++ 80 files changed, 196 insertions(+), 526 deletions(-) diff --git a/Autocoders/Python/src/fprime_ac/generators/templates/component/cpp.tmpl b/Autocoders/Python/src/fprime_ac/generators/templates/component/cpp.tmpl index 9d7374b76a..c209ca87c7 100644 --- a/Autocoders/Python/src/fprime_ac/generators/templates/component/cpp.tmpl +++ b/Autocoders/Python/src/fprime_ac/generators/templates/component/cpp.tmpl @@ -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: diff --git a/Autocoders/Python/src/fprime_ac/generators/templates/component/hpp.tmpl b/Autocoders/Python/src/fprime_ac/generators/templates/component/hpp.tmpl index 834cf406b7..a52a1a9e96 100644 --- a/Autocoders/Python/src/fprime_ac/generators/templates/component/hpp.tmpl +++ b/Autocoders/Python/src/fprime_ac/generators/templates/component/hpp.tmpl @@ -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: diff --git a/Autocoders/Python/src/fprime_ac/generators/templates/impl/cpp.tmpl b/Autocoders/Python/src/fprime_ac/generators/templates/impl/cpp.tmpl index c87eb8a76d..c983020e0e 100644 --- a/Autocoders/Python/src/fprime_ac/generators/templates/impl/cpp.tmpl +++ b/Autocoders/Python/src/fprime_ac/generators/templates/impl/cpp.tmpl @@ -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) { } diff --git a/Autocoders/Python/src/fprime_ac/generators/templates/impl/hpp.tmpl b/Autocoders/Python/src/fprime_ac/generators/templates/impl/hpp.tmpl index 368cd30087..348c44820c 100644 --- a/Autocoders/Python/src/fprime_ac/generators/templates/impl/hpp.tmpl +++ b/Autocoders/Python/src/fprime_ac/generators/templates/impl/hpp.tmpl @@ -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 diff --git a/Drv/BlockDriver/BlockDriverImpl.cpp b/Drv/BlockDriver/BlockDriverImpl.cpp index 0846349505..2189b98396 100644 --- a/Drv/BlockDriver/BlockDriverImpl.cpp +++ b/Drv/BlockDriver/BlockDriverImpl.cpp @@ -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); } diff --git a/Drv/BlockDriver/BlockDriverImpl.hpp b/Drv/BlockDriver/BlockDriverImpl.hpp index a5acaea71b..d588b22ec3 100644 --- a/Drv/BlockDriver/BlockDriverImpl.hpp +++ b/Drv/BlockDriver/BlockDriverImpl.hpp @@ -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 diff --git a/Drv/LinuxGpioDriver/LinuxGpioDriverComponentImpl.hpp b/Drv/LinuxGpioDriver/LinuxGpioDriverComponentImpl.hpp index 6509ece4aa..fb5f53f2de 100644 --- a/Drv/LinuxGpioDriver/LinuxGpioDriverComponentImpl.hpp +++ b/Drv/LinuxGpioDriver/LinuxGpioDriverComponentImpl.hpp @@ -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 diff --git a/Drv/LinuxGpioDriver/LinuxGpioDriverComponentImplCommon.cpp b/Drv/LinuxGpioDriver/LinuxGpioDriverComponentImplCommon.cpp index 5dfce42968..0df4643e2a 100644 --- a/Drv/LinuxGpioDriver/LinuxGpioDriverComponentImplCommon.cpp +++ b/Drv/LinuxGpioDriver/LinuxGpioDriverComponentImplCommon.cpp @@ -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) { } diff --git a/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImpl.cpp b/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImpl.cpp index 6b4ef365e2..d5b6540f4d 100644 --- a/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImpl.cpp +++ b/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImpl.cpp @@ -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) { } diff --git a/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImpl.hpp b/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImpl.hpp index 4a5bfa15cb..276c700bf8 100644 --- a/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImpl.hpp +++ b/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImpl.hpp @@ -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 //! diff --git a/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImplStub.cpp b/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImplStub.cpp index d23be042ab..ff93fdf44a 100644 --- a/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImplStub.cpp +++ b/Drv/LinuxI2cDriver/LinuxI2cDriverComponentImplStub.cpp @@ -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) { } diff --git a/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImpl.hpp b/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImpl.hpp index 69e43407bd..47977b2c38 100644 --- a/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImpl.hpp +++ b/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImpl.hpp @@ -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 diff --git a/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImplCommon.cpp b/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImplCommon.cpp index 837c3f9b29..fa88b432de 100644 --- a/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImplCommon.cpp +++ b/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImplCommon.cpp @@ -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++) { diff --git a/Drv/LinuxSpiDriver/LinuxSpiDriverComponentImpl.hpp b/Drv/LinuxSpiDriver/LinuxSpiDriverComponentImpl.hpp index 21ae082347..72972592ad 100644 --- a/Drv/LinuxSpiDriver/LinuxSpiDriverComponentImpl.hpp +++ b/Drv/LinuxSpiDriver/LinuxSpiDriverComponentImpl.hpp @@ -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 //! diff --git a/Drv/LinuxSpiDriver/LinuxSpiDriverComponentImplCommon.cpp b/Drv/LinuxSpiDriver/LinuxSpiDriverComponentImplCommon.cpp index 4ade9af064..9de8bbd5e8 100644 --- a/Drv/LinuxSpiDriver/LinuxSpiDriverComponentImplCommon.cpp +++ b/Drv/LinuxSpiDriver/LinuxSpiDriverComponentImplCommon.cpp @@ -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) { } diff --git a/Drv/SocketIpDriver/SocketIpDriverComponentImpl.cpp b/Drv/SocketIpDriver/SocketIpDriverComponentImpl.cpp index b43d5955a3..7e8623f161 100644 --- a/Drv/SocketIpDriver/SocketIpDriverComponentImpl.cpp +++ b/Drv/SocketIpDriver/SocketIpDriverComponentImpl.cpp @@ -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(m_backing_data), sizeof(m_buffer)), - m_stop(false) + ) : SocketIpDriverComponentBase(compName), + m_buffer(0xbeef, 0xbeef, reinterpret_cast(m_backing_data), sizeof(m_buffer)), + m_stop(false) { } void SocketIpDriverComponentImpl :: diff --git a/Drv/SocketIpDriver/SocketIpDriverComponentImpl.hpp b/Drv/SocketIpDriver/SocketIpDriverComponentImpl.hpp index 2bc007f996..3e1459af10 100644 --- a/Drv/SocketIpDriver/SocketIpDriverComponentImpl.hpp +++ b/Drv/SocketIpDriver/SocketIpDriverComponentImpl.hpp @@ -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 diff --git a/Fw/Comp/ActiveComponentBase.cpp b/Fw/Comp/ActiveComponentBase.cpp index c6c5cf099d..f7d3d59c36 100644 --- a/Fw/Comp/ActiveComponentBase.cpp +++ b/Fw/Comp/ActiveComponentBase.cpp @@ -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()); } diff --git a/Fw/Comp/ActiveComponentBase.hpp b/Fw/Comp/ActiveComponentBase.hpp index 5726900491..c0568c372f 100644 --- a/Fw/Comp/ActiveComponentBase.hpp +++ b/Fw/Comp/ActiveComponentBase.hpp @@ -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 diff --git a/Fw/Comp/PassiveComponentBase.cpp b/Fw/Comp/PassiveComponentBase.cpp index 87abf2bf36..9dc0e63632 100644 --- a/Fw/Comp/PassiveComponentBase.cpp +++ b/Fw/Comp/PassiveComponentBase.cpp @@ -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) { diff --git a/Fw/Comp/PassiveComponentBase.hpp b/Fw/Comp/PassiveComponentBase.hpp index a856a4014c..0c4b368f64 100644 --- a/Fw/Comp/PassiveComponentBase.hpp +++ b/Fw/Comp/PassiveComponentBase.hpp @@ -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; diff --git a/Fw/Comp/QueuedComponentBase.cpp b/Fw/Comp/QueuedComponentBase.cpp index 8610e88f8c..45b915a07e 100644 --- a/Fw/Comp/QueuedComponentBase.cpp +++ b/Fw/Comp/QueuedComponentBase.cpp @@ -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() { } diff --git a/Fw/Comp/QueuedComponentBase.hpp b/Fw/Comp/QueuedComponentBase.hpp index 9434be13ad..4838772866 100644 --- a/Fw/Comp/QueuedComponentBase.hpp +++ b/Fw/Comp/QueuedComponentBase.hpp @@ -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 diff --git a/Fw/Obj/ObjBase.cpp b/Fw/Obj/ObjBase.cpp index 0063410f23..64ed422e6b 100644 --- a/Fw/Obj/ObjBase.cpp +++ b/Fw/Obj/ObjBase.cpp @@ -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 diff --git a/Fw/Obj/ObjBase.hpp b/Fw/Obj/ObjBase.hpp index f2006ac2be..09fe038a5c 100644 --- a/Fw/Obj/ObjBase.hpp +++ b/Fw/Obj/ObjBase.hpp @@ -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 //! diff --git a/Fw/Port/PortBase.cpp b/Fw/Port/PortBase.cpp index d88dc3d958..2fdb010e4c 100644 --- a/Fw/Port/PortBase.cpp +++ b/Fw/Port/PortBase.cpp @@ -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) { diff --git a/Os/Queue.hpp b/Os/Queue.hpp index b7818ff96f..0ecc9606d6 100644 --- a/Os/Queue.hpp +++ b/Os/Queue.hpp @@ -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 diff --git a/Ref/PingReceiver/PingReceiverComponentImpl.cpp b/Ref/PingReceiver/PingReceiverComponentImpl.cpp index d6d39ceb11..8d6e5e6869 100644 --- a/Ref/PingReceiver/PingReceiverComponentImpl.cpp +++ b/Ref/PingReceiver/PingReceiverComponentImpl.cpp @@ -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) { } diff --git a/Ref/PingReceiver/PingReceiverComponentImpl.hpp b/Ref/PingReceiver/PingReceiverComponentImpl.hpp index 2039bafa95..053604ef8a 100644 --- a/Ref/PingReceiver/PingReceiverComponentImpl.hpp +++ b/Ref/PingReceiver/PingReceiverComponentImpl.hpp @@ -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 diff --git a/Ref/RecvBuffApp/RecvBuffComponentImpl.cpp b/Ref/RecvBuffApp/RecvBuffComponentImpl.cpp index 4e9a6f867d..b2999b8f19 100644 --- a/Ref/RecvBuffApp/RecvBuffComponentImpl.cpp +++ b/Ref/RecvBuffApp/RecvBuffComponentImpl.cpp @@ -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; diff --git a/Ref/RecvBuffApp/RecvBuffComponentImpl.hpp b/Ref/RecvBuffApp/RecvBuffComponentImpl.hpp index 6b7d6153ea..c3e2208b19 100644 --- a/Ref/RecvBuffApp/RecvBuffComponentImpl.hpp +++ b/Ref/RecvBuffApp/RecvBuffComponentImpl.hpp @@ -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); diff --git a/Ref/SendBuffApp/SendBuffComponentImpl.cpp b/Ref/SendBuffApp/SendBuffComponentImpl.cpp index 7dc961105e..39e0b931eb 100644 --- a/Ref/SendBuffApp/SendBuffComponentImpl.cpp +++ b/Ref/SendBuffApp/SendBuffComponentImpl.cpp @@ -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; diff --git a/Ref/SendBuffApp/SendBuffComponentImpl.hpp b/Ref/SendBuffApp/SendBuffComponentImpl.hpp index 713ae59cb4..a8540a9633 100644 --- a/Ref/SendBuffApp/SendBuffComponentImpl.hpp +++ b/Ref/SendBuffApp/SendBuffComponentImpl.hpp @@ -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 diff --git a/Ref/SignalGen/test/ut/Tester.cpp b/Ref/SignalGen/test/ut/Tester.cpp index 9e6d028a13..758a066668 100644 --- a/Ref/SignalGen/test/ut/Tester.cpp +++ b/Ref/SignalGen/test/ut/Tester.cpp @@ -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(); diff --git a/Ref/Top/Topology.cpp b/Ref/Top/Topology.cpp index cef4bdf230..b1a9fa8f43 100644 --- a/Ref/Top/Topology.cpp +++ b/Ref/Top/Topology.cpp @@ -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 diff --git a/Svc/ActiveLogger/ActiveLoggerImpl.cpp b/Svc/ActiveLogger/ActiveLoggerImpl.cpp index 6f051a2f0d..3636410e50 100644 --- a/Svc/ActiveLogger/ActiveLoggerImpl.cpp +++ b/Svc/ActiveLogger/ActiveLoggerImpl.cpp @@ -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 = diff --git a/Svc/ActiveLogger/ActiveLoggerImpl.hpp b/Svc/ActiveLogger/ActiveLoggerImpl.hpp index 37ec246477..bad53b3b8e 100644 --- a/Svc/ActiveLogger/ActiveLoggerImpl.hpp +++ b/Svc/ActiveLogger/ActiveLoggerImpl.hpp @@ -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*/ diff --git a/Svc/ActiveRateGroup/ActiveRateGroupImpl.cpp b/Svc/ActiveRateGroup/ActiveRateGroupImpl.cpp index dc50c72bdf..2b35af50ea 100644 --- a/Svc/ActiveRateGroup/ActiveRateGroupImpl.cpp +++ b/Svc/ActiveRateGroup/ActiveRateGroupImpl.cpp @@ -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(this->getNum_RateGroupMemberOut_OutputPorts()),numContexts,this->getNum_RateGroupMemberOut_OutputPorts()); FW_ASSERT(FW_NUM_ARRAY_ELEMENTS(this->m_contexts) == this->getNum_RateGroupMemberOut_OutputPorts(), diff --git a/Svc/ActiveRateGroup/ActiveRateGroupImpl.hpp b/Svc/ActiveRateGroup/ActiveRateGroupImpl.hpp index 8327feb20b..38f9573e59 100644 --- a/Svc/ActiveRateGroup/ActiveRateGroupImpl.hpp +++ b/Svc/ActiveRateGroup/ActiveRateGroupImpl.hpp @@ -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 diff --git a/Svc/ActiveTextLogger/ActiveTextLoggerImpl.cpp b/Svc/ActiveTextLogger/ActiveTextLoggerImpl.cpp index 5488aa03c1..db4f26c010 100644 --- a/Svc/ActiveTextLogger/ActiveTextLoggerImpl.cpp +++ b/Svc/ActiveTextLogger/ActiveTextLoggerImpl.cpp @@ -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() { diff --git a/Svc/ActiveTextLogger/ActiveTextLoggerImpl.hpp b/Svc/ActiveTextLogger/ActiveTextLoggerImpl.hpp index f3be0ca4e9..8621573c76 100644 --- a/Svc/ActiveTextLogger/ActiveTextLoggerImpl.hpp +++ b/Svc/ActiveTextLogger/ActiveTextLoggerImpl.hpp @@ -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 //! diff --git a/Svc/AssertFatalAdapter/AssertFatalAdapterComponentImpl.cpp b/Svc/AssertFatalAdapter/AssertFatalAdapterComponentImpl.cpp index dd0361f716..1120d8a07f 100644 --- a/Svc/AssertFatalAdapter/AssertFatalAdapterComponentImpl.cpp +++ b/Svc/AssertFatalAdapter/AssertFatalAdapterComponentImpl.cpp @@ -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); diff --git a/Svc/AssertFatalAdapter/AssertFatalAdapterComponentImpl.hpp b/Svc/AssertFatalAdapter/AssertFatalAdapterComponentImpl.hpp index f71fd9a861..f16465c4dd 100644 --- a/Svc/AssertFatalAdapter/AssertFatalAdapterComponentImpl.hpp +++ b/Svc/AssertFatalAdapter/AssertFatalAdapterComponentImpl.hpp @@ -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 diff --git a/Svc/BufferAccumulator/BufferAccumulator.cpp b/Svc/BufferAccumulator/BufferAccumulator.cpp index 201cd23fc7..fb128291f1 100644 --- a/Svc/BufferAccumulator/BufferAccumulator.cpp +++ b/Svc/BufferAccumulator/BufferAccumulator.cpp @@ -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) { } diff --git a/Svc/BufferAccumulator/BufferAccumulator.hpp b/Svc/BufferAccumulator/BufferAccumulator.hpp index 5c844f9dd6..5b13404c4b 100644 --- a/Svc/BufferAccumulator/BufferAccumulator.hpp +++ b/Svc/BufferAccumulator/BufferAccumulator.hpp @@ -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 diff --git a/Svc/BufferLogger/BufferLogger.cpp b/Svc/BufferLogger/BufferLogger.cpp index 4a657eb95a..8367dcd79e 100644 --- a/Svc/BufferLogger/BufferLogger.cpp +++ b/Svc/BufferLogger/BufferLogger.cpp @@ -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) { } diff --git a/Svc/BufferLogger/BufferLogger.hpp b/Svc/BufferLogger/BufferLogger.hpp index 6c5f304605..a9732e60d6 100644 --- a/Svc/BufferLogger/BufferLogger.hpp +++ b/Svc/BufferLogger/BufferLogger.hpp @@ -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 diff --git a/Svc/CmdDispatcher/CommandDispatcherImpl.cpp b/Svc/CmdDispatcher/CommandDispatcherImpl.cpp index 26d4ed4911..6d27bf2231 100644 --- a/Svc/CmdDispatcher/CommandDispatcherImpl.cpp +++ b/Svc/CmdDispatcher/CommandDispatcherImpl.cpp @@ -11,13 +11,11 @@ #include 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)); diff --git a/Svc/CmdDispatcher/CommandDispatcherImpl.hpp b/Svc/CmdDispatcher/CommandDispatcherImpl.hpp index c0f279e5ac..e721dac648 100644 --- a/Svc/CmdDispatcher/CommandDispatcherImpl.hpp +++ b/Svc/CmdDispatcher/CommandDispatcherImpl.hpp @@ -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 diff --git a/Svc/CmdSequencer/CmdSequencerImpl.cpp b/Svc/CmdSequencer/CmdSequencerImpl.cpp index 65d85ba813..1e9079315c 100644 --- a/Svc/CmdSequencer/CmdSequencerImpl.cpp +++ b/Svc/CmdSequencer/CmdSequencerImpl.cpp @@ -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), diff --git a/Svc/CmdSequencer/CmdSequencerImpl.hpp b/Svc/CmdSequencer/CmdSequencerImpl.hpp index ac30cf0520..19efa8b7eb 100644 --- a/Svc/CmdSequencer/CmdSequencerImpl.hpp +++ b/Svc/CmdSequencer/CmdSequencerImpl.hpp @@ -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 diff --git a/Svc/ComLogger/ComLogger.cpp b/Svc/ComLogger/ComLogger.cpp index 8bbaf64e3e..2be39a9a8a 100644 --- a/Svc/ComLogger/ComLogger.cpp +++ b/Svc/ComLogger/ComLogger.cpp @@ -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 diff --git a/Svc/ComLogger/ComLogger.hpp b/Svc/ComLogger/ComLogger.hpp index f3bca97186..89b7de90c9 100644 --- a/Svc/ComLogger/ComLogger.hpp +++ b/Svc/ComLogger/ComLogger.hpp @@ -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 diff --git a/Svc/ComSplitter/ComSplitter.cpp b/Svc/ComSplitter/ComSplitter.cpp index 7446aca295..917eb4054d 100644 --- a/Svc/ComSplitter/ComSplitter.cpp +++ b/Svc/ComSplitter/ComSplitter.cpp @@ -14,12 +14,8 @@ namespace Svc { // ---------------------------------------------------------------------- ComSplitter :: -#if FW_OBJECT_NAMES == 1 ComSplitter(const char* compName) : ComSplitterComponentBase(compName) -#else - ComSplitter(void) -#endif { } diff --git a/Svc/ComSplitter/ComSplitter.hpp b/Svc/ComSplitter/ComSplitter.hpp index 48d8662508..50c442aecc 100644 --- a/Svc/ComSplitter/ComSplitter.hpp +++ b/Svc/ComSplitter/ComSplitter.hpp @@ -28,11 +28,7 @@ namespace Svc { public: -#if FW_OBJECT_NAMES == 1 ComSplitter(const char* compName); -#else - ComSplitter(void); -#endif ~ComSplitter(void); diff --git a/Svc/FatalHandler/FatalHandlerComponentCommonImpl.cpp b/Svc/FatalHandler/FatalHandlerComponentCommonImpl.cpp index 09382bf34f..e0b422f302 100644 --- a/Svc/FatalHandler/FatalHandlerComponentCommonImpl.cpp +++ b/Svc/FatalHandler/FatalHandlerComponentCommonImpl.cpp @@ -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) { } diff --git a/Svc/FatalHandler/FatalHandlerComponentImpl.hpp b/Svc/FatalHandler/FatalHandlerComponentImpl.hpp index a24ae9ce84..31501e0be2 100644 --- a/Svc/FatalHandler/FatalHandlerComponentImpl.hpp +++ b/Svc/FatalHandler/FatalHandlerComponentImpl.hpp @@ -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 diff --git a/Svc/GroundInterface/GroundInterface.cpp b/Svc/GroundInterface/GroundInterface.cpp index e40280ddb6..53647b8375 100644 --- a/Svc/GroundInterface/GroundInterface.cpp +++ b/Svc/GroundInterface/GroundInterface.cpp @@ -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(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(m_buffer), GND_BUFFER_SIZE), + m_data_size(0), + m_in_ring(m_in_buffer, GND_BUFFER_SIZE) { } diff --git a/Svc/GroundInterface/GroundInterface.hpp b/Svc/GroundInterface/GroundInterface.hpp index 5d37bc4f76..12f7822292 100644 --- a/Svc/GroundInterface/GroundInterface.hpp +++ b/Svc/GroundInterface/GroundInterface.hpp @@ -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 diff --git a/Svc/Health/HealthComponentImpl.cpp b/Svc/Health/HealthComponentImpl.cpp index 1606326434..7c1ba7ef2a 100644 --- a/Svc/Health/HealthComponentImpl.cpp +++ b/Svc/Health/HealthComponentImpl.cpp @@ -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); diff --git a/Svc/Health/HealthComponentImpl.hpp b/Svc/Health/HealthComponentImpl.hpp index 3b01403e77..bde30e9ba6 100644 --- a/Svc/Health/HealthComponentImpl.hpp +++ b/Svc/Health/HealthComponentImpl.hpp @@ -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 //! diff --git a/Svc/LinuxTime/LinuxTimeImpl.cpp b/Svc/LinuxTime/LinuxTimeImpl.cpp index 1146ae5412..f12f3d9b9a 100644 --- a/Svc/LinuxTime/LinuxTimeImpl.cpp +++ b/Svc/LinuxTime/LinuxTimeImpl.cpp @@ -11,11 +11,7 @@ namespace Svc { - #if FW_OBJECT_NAMES == 1 LinuxTimeImpl::LinuxTimeImpl(const char* name) : TimeComponentBase(name) - #else - LinuxTimeImpl::LinuxTimeImpl() - #endif { } diff --git a/Svc/LinuxTime/LinuxTimeImpl.hpp b/Svc/LinuxTime/LinuxTimeImpl.hpp index 8cbdd303f7..9a2696494b 100644 --- a/Svc/LinuxTime/LinuxTimeImpl.hpp +++ b/Svc/LinuxTime/LinuxTimeImpl.hpp @@ -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: diff --git a/Svc/LinuxTimer/LinuxTimerComponentImpl.hpp b/Svc/LinuxTimer/LinuxTimerComponentImpl.hpp index 55ed467881..7e9561dd50 100644 --- a/Svc/LinuxTimer/LinuxTimerComponentImpl.hpp +++ b/Svc/LinuxTimer/LinuxTimerComponentImpl.hpp @@ -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 diff --git a/Svc/LinuxTimer/LinuxTimerComponentImplCommon.cpp b/Svc/LinuxTimer/LinuxTimerComponentImplCommon.cpp index 51d1e317ec..31a252bbf6 100644 --- a/Svc/LinuxTimer/LinuxTimerComponentImplCommon.cpp +++ b/Svc/LinuxTimer/LinuxTimerComponentImplCommon.cpp @@ -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) { } diff --git a/Svc/PassiveConsoleTextLogger/ConsoleTextLoggerImpl.hpp b/Svc/PassiveConsoleTextLogger/ConsoleTextLoggerImpl.hpp index 0a3fac9c41..75c6aa32a9 100644 --- a/Svc/PassiveConsoleTextLogger/ConsoleTextLoggerImpl.hpp +++ b/Svc/PassiveConsoleTextLogger/ConsoleTextLoggerImpl.hpp @@ -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); diff --git a/Svc/PassiveConsoleTextLogger/ConsoleTextLoggerImplCommon.cpp b/Svc/PassiveConsoleTextLogger/ConsoleTextLoggerImplCommon.cpp index 13da20c2e9..5fbc041dad 100644 --- a/Svc/PassiveConsoleTextLogger/ConsoleTextLoggerImplCommon.cpp +++ b/Svc/PassiveConsoleTextLogger/ConsoleTextLoggerImplCommon.cpp @@ -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(); diff --git a/Svc/PolyDb/PolyDbImpl.cpp b/Svc/PolyDb/PolyDbImpl.cpp index 690079a889..973e2431bb 100644 --- a/Svc/PolyDb/PolyDbImpl.cpp +++ b/Svc/PolyDb/PolyDbImpl.cpp @@ -10,11 +10,7 @@ #include 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; diff --git a/Svc/PolyDb/PolyDbImpl.hpp b/Svc/PolyDb/PolyDbImpl.hpp index 1d417fbeeb..cce08f7aa9 100644 --- a/Svc/PolyDb/PolyDbImpl.hpp +++ b/Svc/PolyDb/PolyDbImpl.hpp @@ -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 diff --git a/Svc/PrmDb/PrmDbImpl.cpp b/Svc/PrmDb/PrmDbImpl.cpp index 5d0e5f6eae..7380e54161 100644 --- a/Svc/PrmDb/PrmDbImpl.cpp +++ b/Svc/PrmDb/PrmDbImpl.cpp @@ -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; } diff --git a/Svc/PrmDb/PrmDbImpl.hpp b/Svc/PrmDb/PrmDbImpl.hpp index 32991307f8..466d57f5c6 100644 --- a/Svc/PrmDb/PrmDbImpl.hpp +++ b/Svc/PrmDb/PrmDbImpl.hpp @@ -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 diff --git a/Svc/RateGroupDriver/RateGroupDriverImpl.cpp b/Svc/RateGroupDriver/RateGroupDriverImpl.cpp index 169e3637b9..dd4832ab8d 100644 --- a/Svc/RateGroupDriver/RateGroupDriverImpl.cpp +++ b/Svc/RateGroupDriver/RateGroupDriverImpl.cpp @@ -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) { diff --git a/Svc/RateGroupDriver/RateGroupDriverImpl.hpp b/Svc/RateGroupDriver/RateGroupDriverImpl.hpp index ae95295dc2..dbb94c62d4 100644 --- a/Svc/RateGroupDriver/RateGroupDriverImpl.hpp +++ b/Svc/RateGroupDriver/RateGroupDriverImpl.hpp @@ -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 //! diff --git a/Svc/TlmChan/TlmChanImpl.cpp b/Svc/TlmChan/TlmChanImpl.cpp index 32826c98c2..a3b1ea9689 100644 --- a/Svc/TlmChan/TlmChanImpl.cpp +++ b/Svc/TlmChan/TlmChanImpl.cpp @@ -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; diff --git a/Svc/TlmChan/TlmChanImpl.hpp b/Svc/TlmChan/TlmChanImpl.hpp index 4bbfa4a5bb..3a7f801cb9 100644 --- a/Svc/TlmChan/TlmChanImpl.hpp +++ b/Svc/TlmChan/TlmChanImpl.hpp @@ -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*/ diff --git a/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp b/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp index 97281b852b..b66ef0fa6a 100644 --- a/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp +++ b/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp @@ -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) { } diff --git a/Svc/UdpReceiver/UdpReceiverComponentImpl.hpp b/Svc/UdpReceiver/UdpReceiverComponentImpl.hpp index a9c387983c..a2469fb1d6 100644 --- a/Svc/UdpReceiver/UdpReceiverComponentImpl.hpp +++ b/Svc/UdpReceiver/UdpReceiverComponentImpl.hpp @@ -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 diff --git a/Svc/UdpSender/UdpSenderComponentImpl.cpp b/Svc/UdpSender/UdpSenderComponentImpl.cpp index a591c5da15..a077367106 100644 --- a/Svc/UdpSender/UdpSenderComponentImpl.cpp +++ b/Svc/UdpSender/UdpSenderComponentImpl.cpp @@ -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) { } diff --git a/Svc/UdpSender/UdpSenderComponentImpl.hpp b/Svc/UdpSender/UdpSenderComponentImpl.hpp index d3b2246b69..3b4fa1df04 100644 --- a/Svc/UdpSender/UdpSenderComponentImpl.hpp +++ b/Svc/UdpSender/UdpSenderComponentImpl.hpp @@ -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 diff --git a/config/FpConfig.hpp b/config/FpConfig.hpp index b65d295dcc..91cafa3b28 100644 --- a/config/FpConfig.hpp +++ b/config/FpConfig.hpp @@ -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() 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