F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
LogPortAc.hpp
Go to the documentation of this file.
1 /*
2  * LogPort.hpp
3  *
4  * Created on: Wednesday, 14 October 2020
5  * Author: mstarch
6  *
7  */
8 #ifndef FW_LOG_PORT_HPP_
9 #define FW_LOG_PORT_HPP_
10 
11 #include <cstring>
12 #include <cstdio>
13 #include <FpConfig.hpp>
17 #include <Fw/Types/BasicTypes.hpp>
19 #include <Fw/Types/StringType.hpp>
20 #include <Fw/Log/LogBuffer.hpp>
21 #include <Fw/Time/Time.hpp>
22 
23 
24 namespace Fw {
25 
26  typedef enum {
27  LOG_FATAL = 1, // A fatal non-recoverable event
28  LOG_WARNING_HI = 2, // A serious but recoverable event
29  LOG_WARNING_LO = 3, // A less serious but recoverable event
30  LOG_COMMAND = 4, // An activity related to commanding
31  LOG_ACTIVITY_HI = 5, // Important informational events
32  LOG_ACTIVITY_LO = 6, // Less important informational events
33  LOG_DIAGNOSTIC = 7, // Software diagnostic events
36 
39 
41  public:
42  enum {
44  };
45  typedef void (*CompFuncPtr)(Fw::PassiveComponentBase* callComp, NATIVE_INT_TYPE portNum, FwEventIdType id, Fw::Time &timeTag, LogSeverity severity, LogBuffer &args);
46 
47  InputLogPort(void);
48  void init(void);
49  void addCallComp(Fw::PassiveComponentBase* callComp, CompFuncPtr funcPtr);
50  void invoke(FwEventIdType id, Fw::Time &timeTag, LogSeverity severity, LogBuffer &args);
51  protected:
52  private:
53  CompFuncPtr m_func;
54 #if FW_PORT_SERIALIZATION == 1
55  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase &buffer);
56 #endif
57 };
60 
62  public:
63  OutputLogPort(void);
64  void init(void);
65  void addCallPort(InputLogPort* callPort);
66  void invoke(FwEventIdType id, Fw::Time &timeTag, LogSeverity severity, LogBuffer &args);
67  protected:
68  private:
69  InputLogPort* m_port;
70  };
71 } // end namespace Fw
72 #endif /* FW_LOG_PORT_HPP_ */
73 
StringType.hpp
Declares ISF string base class.
InputPortBase.hpp
PassiveComponentBase.hpp
LogBuffer.hpp
Fw::Time
Definition: Time.hpp:10
Fw::SerializeBufferBase
Definition: Serializable.hpp:43
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition: Serializable.hpp:14
Serializable.hpp
Fw::OutputLogPort::invoke
void invoke(FwEventIdType id, Fw::Time &timeTag, LogSeverity severity, LogBuffer &args)
Definition: LogPortAc.cpp:121
Fw::LOG_WARNING_HI
@ LOG_WARNING_HI
Definition: LogPortAc.hpp:28
Fw::LOG_WARNING_LO
@ LOG_WARNING_LO
Definition: LogPortAc.hpp:29
Fw::LOG_FATAL
@ LOG_FATAL
Definition: LogPortAc.hpp:27
Fw::LOG_COMMAND
@ LOG_COMMAND
Definition: LogPortAc.hpp:30
Fw::LogBuffer
Definition: LogBuffer.hpp:22
Fw::LogSeverity
LogSeverity
Definition: LogPortAc.hpp:26
Fw::PassiveComponentBase
Definition: PassiveComponentBase.hpp:10
Fw::OutputLogPort::init
void init(void)
Definition: LogPortAc.cpp:107
Fw::OutputLogPort
Definition: LogPortAc.hpp:61
Fw::InputLogPort::CompFuncPtr
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, FwEventIdType id, Fw::Time &timeTag, LogSeverity severity, LogBuffer &args)
port callback definition
Definition: LogPortAc.hpp:45
Fw::InputPortBase
Definition: InputPortBase.hpp:14
Fw::LOG_DIAGNOSTIC
@ LOG_DIAGNOSTIC
Definition: LogPortAc.hpp:33
Fw::InputLogPort::addCallComp
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
call to register a component
Definition: LogPortAc.cpp:42
Fw::LogBuffer::SERIALIZED_SIZE
@ SERIALIZED_SIZE
Definition: LogBuffer.hpp:27
Fw::InputLogPort::InputLogPort
InputLogPort(void)
constructor
Definition: LogPortAc.cpp:33
Fw::OutputLogPort::OutputLogPort
OutputLogPort(void)
Definition: LogPortAc.cpp:102
OutputPortBase.hpp
Fw::InputLogPort::invoke
void invoke(FwEventIdType id, Fw::Time &timeTag, LogSeverity severity, LogBuffer &args)
invoke port interface
Definition: LogPortAc.cpp:52
Fw::LOG_ACTIVITY_HI
@ LOG_ACTIVITY_HI
Definition: LogPortAc.hpp:31
FpConfig.hpp
ISF configuration file.
Fw::OutputLogPort::addCallPort
void addCallPort(InputLogPort *callPort)
Definition: LogPortAc.cpp:111
Fw::OutputPortBase
Definition: OutputPortBase.hpp:13
Fw::InputLogPort
Definition: LogPortAc.hpp:40
BasicTypes.hpp
Declares ISF basic types.
FwEventIdType
#define FwEventIdType
Type representation for a event id.
Definition: FpConfig.hpp:70
Fw::LOG_ACTIVITY_LO
@ LOG_ACTIVITY_LO
Definition: LogPortAc.hpp:32
Time.hpp
Fw::InputLogPort::init
void init(void)
initialization function
Definition: LogPortAc.cpp:38
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
Fw::Time::SERIALIZED_SIZE
@ SERIALIZED_SIZE
Definition: Time.hpp:14
Fw::LogSeverity_MAX
@ LogSeverity_MAX
Definition: LogPortAc.hpp:34
Fw
Definition: BufferGetPortAc.cpp:6
Fw::InputLogPort::SERIALIZED_SIZE
@ SERIALIZED_SIZE
serialized size of port arguments
Definition: LogPortAc.hpp:43