F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ConvertTimePortAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ConvertTimePortAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for ConvertTime port
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 
10 namespace Svc {
11 
12 #if !FW_DIRECT_PORT_CALLS
13 
14  // ----------------------------------------------------------------------
15  // Public constructors for InputConvertTimePort
16  // ----------------------------------------------------------------------
17 
20  Fw::InputPortBase(),
21  m_func(nullptr)
22  {
23 
24  }
25 
26  // ----------------------------------------------------------------------
27  // Public member functions for InputConvertTimePort
28  // ----------------------------------------------------------------------
29 
32  {
34  }
35 
38  Fw::PassiveComponentBase* callComp,
39  CompFuncPtr funcPtr
40  )
41  {
42  FW_ASSERT(callComp != nullptr);
43  FW_ASSERT(funcPtr != nullptr);
44 
45  this->m_comp = callComp;
46  this->m_func = funcPtr;
47  this->m_connObj = callComp;
48  }
49 
52  const Fw::Time& in_time,
53  Fw::Time& out_time
54  )
55  {
56 #if FW_PORT_TRACING == 1
57  this->trace();
58 #endif
59 
60  FW_ASSERT(this->m_comp != nullptr);
61  FW_ASSERT(this->m_func != nullptr);
62 
63  return this->m_func(this->m_comp, this->m_portNum, in_time, out_time);
64  }
65 
66  // ----------------------------------------------------------------------
67  // Private member functions for InputConvertTimePort
68  // ----------------------------------------------------------------------
69 
70 #if FW_PORT_SERIALIZATION == 1
71 
72  Fw::SerializeStatus InputConvertTimePort ::
73  invokeSerial(Fw::LinearBufferBase& _buffer)
74  {
75  // For ports with a return type, invokeSerial is not used
76  (void) _buffer;
77 
78  FW_ASSERT(false);
79  return Fw::FW_SERIALIZE_OK;
80  }
81 
82 #endif
83 
84  // ----------------------------------------------------------------------
85  // Public constructors for OutputConvertTimePort
86  // ----------------------------------------------------------------------
87 
90  Fw::OutputPortBase(),
91  m_port(nullptr)
92  {
93 
94  }
95 
96  // ----------------------------------------------------------------------
97  // Public member functions for OutputConvertTimePort
98  // ----------------------------------------------------------------------
99 
102  {
104  }
105 
108  {
109  FW_ASSERT(callPort != nullptr);
110 
111  this->m_port = callPort;
112  this->m_connObj = callPort;
113 
114 #if FW_PORT_SERIALIZATION == 1
115  this->m_serPort = nullptr;
116 #endif
117  }
118 
121  const Fw::Time& in_time,
122  Fw::Time& out_time
123  ) const
124  {
125 #if FW_PORT_TRACING == 1
126  this->trace();
127 #endif
128 
129  FW_ASSERT(this->m_port != nullptr);
130  return this->m_port->invoke(in_time, out_time);
131  }
132 
133 #endif
134 
135 }
Serialization/Deserialization operation was successful.
void init()
Initialization function.
FwIndexType m_portNum
Svc::ConvertTimeStatus invoke(const Fw::Time &in_time, Fw::Time &out_time) const
SerializeStatus
forward declaration for string
void init() override
Svc::ConvertTimeStatus invoke(const Fw::Time &in_time, Fw::Time &out_time)
Invoke a port interface.
Result of a time base conversion.
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
PassiveComponentBase * m_comp
void init() override
RateGroupDivider component implementation.
Implementation of malloc based allocator.
void addCallPort(InputConvertTimePort *callPort)
Register an input port.
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:34
#define FW_ASSERT(...)
Definition: Assert.hpp:14