F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
TimePortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TimePortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Time port
5 // ======================================================================
6 
7 #ifndef Fw_TimePortAc_HPP
8 #define Fw_TimePortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
13 #include "FpConfig.hpp"
17 #include "Fw/Time/Time.hpp"
19 #include "Fw/Types/StringType.hpp"
20 
21 namespace Fw {
22 
25  class InputTimePort :
26  public Fw::InputPortBase
27  {
28 
29  public:
30 
31  // ----------------------------------------------------------------------
32  // Constants
33  // ----------------------------------------------------------------------
34 
35  enum {
39  };
40 
41  public:
42 
43  // ----------------------------------------------------------------------
44  // Types
45  // ----------------------------------------------------------------------
46 
48  typedef void (*CompFuncPtr)(
49  Fw::PassiveComponentBase* callComp,
50  FwIndexType portNum,
51  Fw::Time& time
52  );
53 
54  public:
55 
56  // ----------------------------------------------------------------------
57  // Input Port Member functions
58  // ----------------------------------------------------------------------
59 
61  InputTimePort();
62 
64  void init();
65 
67  void addCallComp(
68  Fw::PassiveComponentBase* callComp,
69  CompFuncPtr funcPtr
70  );
71 
73  void invoke(
74  Fw::Time& time
75  );
76 
77  private:
78 
79 #if FW_PORT_SERIALIZATION == 1
80 
82  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
83 
84 #endif
85 
86  private:
87 
88  // ----------------------------------------------------------------------
89  // Member variables
90  // ----------------------------------------------------------------------
91 
93  CompFuncPtr m_func;
94 
95  };
96 
100  public Fw::OutputPortBase
101  {
102 
103  public:
104 
105  // ----------------------------------------------------------------------
106  // Output Port Member functions
107  // ----------------------------------------------------------------------
108 
110  OutputTimePort();
111 
113  void init();
114 
116  void addCallPort(
117  InputTimePort* callPort
118  );
119 
121  void invoke(
122  Fw::Time& time
123  );
124 
125  private:
126 
127  // ----------------------------------------------------------------------
128  // Member variables
129  // ----------------------------------------------------------------------
130 
132  InputTimePort* m_port;
133 
134  };
135 
136 }
137 
138 #endif
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, Fw::Time &time)
The port callback function type.
Definition: TimePortAc.hpp:48
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TimePortAc.cpp:62
InputTimePort()
Constructor.
Definition: TimePortAc.cpp:48
void invoke(Fw::Time &time)
Invoke a port interface.
Definition: TimePortAc.cpp:76
void init()
Initialization function.
Definition: TimePortAc.cpp:56
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition: TimePortAc.hpp:37
OutputTimePort()
Constructor.
Definition: TimePortAc.cpp:120
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void invoke(Fw::Time &time)
Invoke a port interface.
Definition: TimePortAc.cpp:147
void init()
Initialization function.
Definition: TimePortAc.cpp:128
Definition: Time.hpp:9
@ SERIALIZED_SIZE
Definition: Time.hpp:13
SerializeStatus
forward declaration for string