fprime/Fw/Comp/PassiveComponentBase.hpp
Joshua Anderson 3cccd731d9
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.
2020-10-07 17:19:05 -07:00

38 lines
1.0 KiB
C++

#ifndef FW_COMP_BASE_HPP
#define FW_COMP_BASE_HPP
#include <Fw/Obj/ObjBase.hpp>
#include <Fw/Types/Serializable.hpp>
#include <FpConfig.hpp>
namespace Fw {
class PassiveComponentBase : public Fw::ObjBase {
public:
//! Set the ID base
void setIdBase(
const U32 //< The new ID base
);
//! Get the ID base
//! \return The ID base
U32 getIdBase(void) const;
PROTECTED:
PassiveComponentBase(const char* name); //!< Named constructor
virtual ~PassiveComponentBase(); //!< Destructor
void init(NATIVE_INT_TYPE instance); //!< Initialization function
NATIVE_INT_TYPE getInstance(void) const;
#if FW_OBJECT_TO_STRING == 1
virtual void toString(char* str, NATIVE_INT_TYPE size); //!< returns string description of component
#endif
PRIVATE:
U32 m_idBase; //!< ID base for opcodes etc.
NATIVE_INT_TYPE m_instance; //!< instance of component object
};
}
#endif