F´ Flight Software - C/C++ Documentation  devel
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 
13 #include "FpConfig.hpp"
16 #include "Fw/Log/TextLogString.hpp"
19 #include "Fw/Time/Time.hpp"
21 #include "Fw/Types/StringType.hpp"
22 
23 namespace Fw {
24 
29  public Fw::InputPortBase
30  {
31 
32  public:
33 
34  // ----------------------------------------------------------------------
35  // Constants
36  // ----------------------------------------------------------------------
37 
38  enum {
41  sizeof(FwEventIdType) +
45  };
46 
47  public:
48 
49  // ----------------------------------------------------------------------
50  // Types
51  // ----------------------------------------------------------------------
52 
54  typedef void (*CompFuncPtr)(
55  Fw::PassiveComponentBase* callComp,
56  FwIndexType portNum,
57  FwEventIdType id,
58  Fw::Time& timeTag,
59  const Fw::LogSeverity& severity,
60  Fw::TextLogString& text
61  );
62 
63  public:
64 
65  // ----------------------------------------------------------------------
66  // Input Port Member functions
67  // ----------------------------------------------------------------------
68 
71 
73  void init();
74 
76  void addCallComp(
77  Fw::PassiveComponentBase* callComp,
78  CompFuncPtr funcPtr
79  );
80 
82  void invoke(
83  FwEventIdType id,
84  Fw::Time& timeTag,
85  const Fw::LogSeverity& severity,
86  Fw::TextLogString& text
87  );
88 
89  private:
90 
91 #if FW_PORT_SERIALIZATION == 1
92 
94  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
95 
96 #endif
97 
98  private:
99 
100  // ----------------------------------------------------------------------
101  // Member variables
102  // ----------------------------------------------------------------------
103 
105  CompFuncPtr m_func;
106 
107  };
108 
113  public Fw::OutputPortBase
114  {
115 
116  public:
117 
118  // ----------------------------------------------------------------------
119  // Output Port Member functions
120  // ----------------------------------------------------------------------
121 
124 
126  void init();
127 
129  void addCallPort(
130  InputLogTextPort* callPort
131  );
132 
134  void invoke(
135  FwEventIdType id,
136  Fw::Time& timeTag,
137  const Fw::LogSeverity& severity,
138  Fw::TextLogString& text
139  );
140 
141  private:
142 
143  // ----------------------------------------------------------------------
144  // Member variables
145  // ----------------------------------------------------------------------
146 
148  InputLogTextPort* m_port;
149 
150  };
151 
152 }
153 
154 #endif
U32 FwEventIdType
Definition: FpConfig.h:103
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
InputLogTextPort()
Constructor.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text)
Invoke a port interface.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
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.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Enum representing event severity.
@ SERIALIZED_SIZE
The size of the serial representation.
void init()
Initialization function.
void addCallPort(InputLogTextPort *callPort)
Register an input port.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text)
Invoke a port interface.
OutputLogTextPort()
Constructor.
Definition: Time.hpp:9
@ SERIALIZED_SIZE
Definition: Time.hpp:13
SerializeStatus
forward declaration for string