F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
LogPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title LogPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Log port
5 // ======================================================================
6 
7 #ifndef Fw_LogPortAc_HPP
8 #define Fw_LogPortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
14 #include "Fw/FPrimeBasicTypes.hpp"
15 #include "Fw/Log/LogBuffer.hpp"
19 #include "Fw/Time/Time.hpp"
21 #include "Fw/Types/String.hpp"
23 
24 namespace Fw {
25 
28  class InputLogPort :
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::LogBuffer& args
61  );
62 
63  public:
64 
65  // ----------------------------------------------------------------------
66  // Input Port Member functions
67  // ----------------------------------------------------------------------
68 
70  InputLogPort();
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::LogBuffer& args
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 
112  public Fw::OutputPortBase
113  {
114 
115  public:
116 
117  // ----------------------------------------------------------------------
118  // Output Port Member functions
119  // ----------------------------------------------------------------------
120 
122  OutputLogPort();
123 
125  void init();
126 
128  void addCallPort(
129  InputLogPort* callPort
130  );
131 
133  void invoke(
134  FwEventIdType id,
135  Fw::Time& timeTag,
136  const Fw::LogSeverity& severity,
137  Fw::LogBuffer& args
138  ) const;
139 
140  private:
141 
142  // ----------------------------------------------------------------------
143  // Member variables
144  // ----------------------------------------------------------------------
145 
147  InputLogPort* m_port;
148 
149  };
150 
151 }
152 
153 #endif
Definition: Time.hpp:9
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
The port callback function type.
Definition: LogPortAc.hpp:54
U32 FwEventIdType
The type of an event identifier.
SerializeStatus
forward declaration for string
void init()
Initialization function.
Definition: LogPortAc.cpp:56
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
Definition: LogPortAc.cpp:76
The size of the serial representation.
Enum representing event severity.
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: LogPortAc.cpp:62
InputLogPort()
Constructor.
Definition: LogPortAc.cpp:48
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
OutputLogPort()
Constructor.
Definition: LogPortAc.cpp:143
PlatformIndexType FwIndexType
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
The size of the serial representations of the port arguments.
Definition: LogPortAc.hpp:40