F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
LinuxTimerComponentAc.cpp
Go to the documentation of this file.
1// ======================================================================
2// \title LinuxTimerComponentAc.cpp
3// \author Generated by fpp-to-cpp
4// \brief cpp file for LinuxTimer component base class
5// ======================================================================
6
8#include "Fw/Types/Assert.hpp"
10#if FW_ENABLE_TEXT_LOGGING
11#include "Fw/Types/String.hpp"
12#endif
13
14namespace Svc {
15
16 // ----------------------------------------------------------------------
17 // Component initialization
18 // ----------------------------------------------------------------------
19
20 void LinuxTimerComponentBase ::
21 init(FwEnumStoreType instance)
22 {
23 // Initialize base class
25
26 // Connect output port CycleOut
27 for (
28 FwIndexType port = 0;
29 port < static_cast<FwIndexType>(this->getNum_CycleOut_OutputPorts());
30 port++
31 ) {
32 this->m_CycleOut_OutputPort[port].init();
33
34#if FW_OBJECT_NAMES == 1
35 Fw::ObjectName portName;
36 portName.format(
37 "%s_CycleOut_OutputPort[%" PRI_PlatformIntType "]",
38 this->m_objName.toChar(),
39 port
40 );
41 this->m_CycleOut_OutputPort[port].setObjName(portName.toChar());
42#endif
43 }
44 }
45
46 // ----------------------------------------------------------------------
47 // Connect typed input ports to typed output ports
48 // ----------------------------------------------------------------------
49
50 void LinuxTimerComponentBase ::
51 set_CycleOut_OutputPort(
52 FwIndexType portNum,
54 )
55 {
57 portNum < this->getNum_CycleOut_OutputPorts(),
58 static_cast<FwAssertArgType>(portNum)
59 );
60
61 this->m_CycleOut_OutputPort[portNum].addCallPort(port);
62 }
63
64#if FW_PORT_SERIALIZATION
65
66 // ----------------------------------------------------------------------
67 // Connect serial input ports to typed output ports
68 // ----------------------------------------------------------------------
69
70 void LinuxTimerComponentBase ::
71 set_CycleOut_OutputPort(
72 FwIndexType portNum,
73 Fw::InputSerializePort* port
74 )
75 {
77 portNum < this->getNum_CycleOut_OutputPorts(),
78 static_cast<FwAssertArgType>(portNum)
79 );
80
81 this->m_CycleOut_OutputPort[portNum].registerSerialPort(port);
82 }
83
84#endif
85
86 // ----------------------------------------------------------------------
87 // Component construction and destruction
88 // ----------------------------------------------------------------------
89
90 LinuxTimerComponentBase ::
91 LinuxTimerComponentBase(const char* compName) :
92 Fw::PassiveComponentBase(compName)
93 {
94
95 }
96
97 LinuxTimerComponentBase ::
98 ~LinuxTimerComponentBase()
99 {
100
101 }
102
103 // ----------------------------------------------------------------------
104 // Getters for numbers of typed output ports
105 // ----------------------------------------------------------------------
106
107 FwIndexType LinuxTimerComponentBase ::
108 getNum_CycleOut_OutputPorts() const
109 {
110 return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_CycleOut_OutputPort));
111 }
112
113 // ----------------------------------------------------------------------
114 // Connection status queries for typed output ports
115 // ----------------------------------------------------------------------
116
117 bool LinuxTimerComponentBase ::
118 isConnected_CycleOut_OutputPort(FwIndexType portNum)
119 {
120 FW_ASSERT(
121 portNum < this->getNum_CycleOut_OutputPorts(),
122 static_cast<FwAssertArgType>(portNum)
123 );
124
125 return this->m_CycleOut_OutputPort[portNum].isConnected();
126 }
127
128 // ----------------------------------------------------------------------
129 // Invocation functions for typed output ports
130 // ----------------------------------------------------------------------
131
132 void LinuxTimerComponentBase ::
133 CycleOut_out(
134 FwIndexType portNum,
135 Os::RawTime& cycleStart
136 )
137 {
138 FW_ASSERT(
139 portNum < this->getNum_CycleOut_OutputPorts(),
140 static_cast<FwAssertArgType>(portNum)
141 );
142 this->m_CycleOut_OutputPort[portNum].invoke(
143 cycleStart
144 );
145 }
146
147}
#define FW_ASSERT(...)
Definition Assert.hpp:14
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition BasicTypes.h:70
#define PRI_PlatformIntType
I32 FwEnumStoreType
Definition FpConfig.h:64
PlatformAssertArgType FwAssertArgType
Definition FpConfig.h:39
PlatformIndexType FwIndexType
Definition FpConfig.h:25
void init()
Object initializer.
Definition ObjBase.cpp:27
const char * toChar() const
void format(const CHAR *formatString,...)
write formatted string to buffer