F´ Flight Software - C/C++ Documentation  devel
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 
13 #include "FpConfig.hpp"
15 #include "Fw/Log/LogBuffer.hpp"
19 #include "Fw/Time/Time.hpp"
21 #include "Fw/Types/StringType.hpp"
22 
23 namespace Fw {
24 
27  class InputLogPort :
28  public Fw::InputPortBase
29  {
30 
31  public:
32 
33  // ----------------------------------------------------------------------
34  // Constants
35  // ----------------------------------------------------------------------
36 
37  enum {
40  sizeof(FwEventIdType) +
44  };
45 
46  public:
47 
48  // ----------------------------------------------------------------------
49  // Types
50  // ----------------------------------------------------------------------
51 
53  typedef void (*CompFuncPtr)(
54  Fw::PassiveComponentBase* callComp,
55  FwIndexType portNum,
56  FwEventIdType id,
57  Fw::Time& timeTag,
58  const Fw::LogSeverity& severity,
59  Fw::LogBuffer& args
60  );
61 
62  public:
63 
64  // ----------------------------------------------------------------------
65  // Input Port Member functions
66  // ----------------------------------------------------------------------
67 
69  InputLogPort();
70 
72  void init();
73 
75  void addCallComp(
76  Fw::PassiveComponentBase* callComp,
77  CompFuncPtr funcPtr
78  );
79 
81  void invoke(
82  FwEventIdType id,
83  Fw::Time& timeTag,
84  const Fw::LogSeverity& severity,
85  Fw::LogBuffer& args
86  );
87 
88  private:
89 
90 #if FW_PORT_SERIALIZATION == 1
91 
93  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
94 
95 #endif
96 
97  private:
98 
99  // ----------------------------------------------------------------------
100  // Member variables
101  // ----------------------------------------------------------------------
102 
104  CompFuncPtr m_func;
105 
106  };
107 
111  public Fw::OutputPortBase
112  {
113 
114  public:
115 
116  // ----------------------------------------------------------------------
117  // Output Port Member functions
118  // ----------------------------------------------------------------------
119 
121  OutputLogPort();
122 
124  void init();
125 
127  void addCallPort(
128  InputLogPort* callPort
129  );
130 
132  void invoke(
133  FwEventIdType id,
134  Fw::Time& timeTag,
135  const Fw::LogSeverity& severity,
136  Fw::LogBuffer& args
137  );
138 
139  private:
140 
141  // ----------------------------------------------------------------------
142  // Member variables
143  // ----------------------------------------------------------------------
144 
146  InputLogPort* m_port;
147 
148  };
149 
150 }
151 
152 #endif
U32 FwEventIdType
Definition: FpConfig.h:86
PlatformIndexType FwIndexType
Definition: FpConfig.h:20
C++-compatible configuration header for fprime configuration.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: LogPortAc.cpp:62
void init()
Initialization function.
Definition: LogPortAc.cpp:56
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition: LogPortAc.hpp:39
InputLogPort()
Constructor.
Definition: LogPortAc.cpp:48
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:53
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
Definition: LogPortAc.cpp:76
Enum representing event severity.
@ SERIALIZED_SIZE
The size of the serial representation.
OutputLogPort()
Constructor.
Definition: LogPortAc.cpp:143
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
Definition: LogPortAc.cpp:170
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
Definition: Time.hpp:9
@ SERIALIZED_SIZE
Definition: Time.hpp:13
SerializeStatus
forward declaration for string