F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
PortBase.hpp
Go to the documentation of this file.
1 #ifndef FW_PORT_BASE_HPP
2 #define FW_PORT_BASE_HPP
3 
5 #include <Fw/Obj/ObjBase.hpp>
7 
8 #if FW_PORT_TRACING == 1
9 extern "C" {
10 void setConnTrace(bool trace);
11 }
12 #endif
13 
14 namespace Fw {
15 
16 class PortBase : public Fw::ObjBase {
17  public:
18 #if FW_PORT_TRACING == 1
19  static void setTrace(bool trace); // !< turn tracing on or off
20  void ovrTrace(bool ovr, bool trace); // !< override tracing for a particular port
21 #endif
22 
23  bool isConnected() const;
24 
25  protected:
26  // Should only be accessed by derived classes
27  PortBase(); // Constructor
28  virtual ~PortBase(); // Destructor
29  virtual void init(); // !< initialization function
30 
31 #if FW_PORT_TRACING == 1
32  void trace() const; // !< trace port calls if active
33 #endif
34  Fw::ObjBase* m_connObj; // !< object port is connected to
35 
36 #if FW_OBJECT_TO_STRING
37  virtual const char* getToStringFormatString();
38 
39  void toString(char* str, FwSizeType size) override;
40 #endif
41 
42  private:
43 #if FW_PORT_TRACING == 1
44  static bool s_trace; // !< global tracing is active
45  bool m_trace; // !< local trace flag
46  bool m_ovr_trace; // !< flag to override global trace
47 #endif
48  // Disable constructors
51  PortBase& operator=(PortBase&);
52 };
53 
54 } // namespace Fw
55 
56 #endif
PlatformSizeType FwSizeType
virtual void init()
Definition: PortBase.cpp:34
Brief class description.
Definition: ObjBase.hpp:35
bool isConnected() const
Definition: PortBase.cpp:38
virtual ~PortBase()
Definition: PortBase.cpp:32
Declarations for Fw::ObjBase and Fw::ObjRegistry.
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:34