F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
LogTextPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title LogTextPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for LogText port
5 // ======================================================================
6 
7 #ifndef Fw_LogTextPortAc_HPP
8 #define Fw_LogTextPortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
14 #include "Fw/FPrimeBasicTypes.hpp"
16 #include "Fw/Log/TextLogString.hpp"
19 #include "Fw/Time/Time.hpp"
21 #include "Fw/Types/String.hpp"
23 
24 namespace Fw {
25 
30  public Fw::InputPortBase
31  {
32 
33  public:
34 
35  // ----------------------------------------------------------------------
36  // Constants
37  // ----------------------------------------------------------------------
38 
39  enum {
42  sizeof(FwEventIdType) +
46  };
47 
48  public:
49 
50  // ----------------------------------------------------------------------
51  // Types
52  // ----------------------------------------------------------------------
53 
55  typedef void (*CompFuncPtr)(
56  Fw::PassiveComponentBase* callComp,
57  FwIndexType portNum,
58  FwEventIdType id,
59  Fw::Time& timeTag,
60  const Fw::LogSeverity& severity,
61  Fw::TextLogString& text
62  );
63 
64  public:
65 
66  // ----------------------------------------------------------------------
67  // Input Port Member functions
68  // ----------------------------------------------------------------------
69 
72 
74  void init();
75 
77  void addCallComp(
78  Fw::PassiveComponentBase* callComp,
79  CompFuncPtr funcPtr
80  );
81 
83  void invoke(
84  FwEventIdType id,
85  Fw::Time& timeTag,
86  const Fw::LogSeverity& severity,
87  Fw::TextLogString& text
88  );
89 
90  private:
91 
92 #if FW_PORT_SERIALIZATION == 1
93 
95  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
96 
97 #endif
98 
99  private:
100 
101  // ----------------------------------------------------------------------
102  // Member variables
103  // ----------------------------------------------------------------------
104 
106  CompFuncPtr m_func;
107 
108  };
109 
114  public Fw::OutputPortBase
115  {
116 
117  public:
118 
119  // ----------------------------------------------------------------------
120  // Output Port Member functions
121  // ----------------------------------------------------------------------
122 
125 
127  void init();
128 
130  void addCallPort(
131  InputLogTextPort* callPort
132  );
133 
135  void invoke(
136  FwEventIdType id,
137  Fw::Time& timeTag,
138  const Fw::LogSeverity& severity,
139  Fw::TextLogString& text
140  ) const;
141 
142  private:
143 
144  // ----------------------------------------------------------------------
145  // Member variables
146  // ----------------------------------------------------------------------
147 
149  InputLogTextPort* m_port;
150 
151  };
152 
153 }
154 
155 #endif
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
InputLogTextPort()
Constructor.
void init()
Initialization function.
The size of the serial representations of the port arguments.
OutputLogTextPort()
Constructor.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text)
Invoke a port interface.
SerializeStatus
forward declaration for string
FwIdType FwEventIdType
The type of an event identifier.
void addCallPort(InputLogTextPort *callPort)
Register an input port.
Enum representing event severity.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text) const
Invoke a port interface.
PlatformIndexType FwIndexType
The size of the serial representation.
void init()
Initialization function.
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text)
The port callback function type.