F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TimeComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TimeComponentAc.cpp
3 // \author Auto-generated
4 // \brief cpp file for Time component base class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #include <stdio.h>
14 #include <FpConfig.hpp>
16 #include <Fw/Types/Assert.hpp>
17 #if FW_ENABLE_TEXT_LOGGING
19 #endif
20 
21 
22 namespace Svc {
23 
24  // ----------------------------------------------------------------------
25  // Getters for numbers of input ports
26  // ----------------------------------------------------------------------
27 
30  {
31  FW_ASSERT(portNum < this->getNum_timeGetPort_InputPorts(),static_cast<AssertArg>(portNum));
32  return &this->m_timeGetPort_InputPort[portNum];
33  }
34 
35  // ----------------------------------------------------------------------
36  // Component construction, initialization, and destruction
37  // ----------------------------------------------------------------------
38 
40 #if FW_OBJECT_NAMES == 1
41  TimeComponentBase(const char* compName) :
42  Fw::PassiveComponentBase(compName)
43 #else
45  Fw::PassiveComponentBase()
46 #endif
47  {
48 
49 
50 
51 
52  }
53 
55  init(NATIVE_INT_TYPE instance)
56  {
57 
58  // Initialize base class
60 
61  // Connect input port timeGetPort
62  for (
63  NATIVE_INT_TYPE port = 0;
64  port < this->getNum_timeGetPort_InputPorts();
65  port++
66  ) {
67 
68  this->m_timeGetPort_InputPort[port].init();
69  this->m_timeGetPort_InputPort[port].addCallComp(
70  this,
71  m_p_timeGetPort_in
72  );
73  this->m_timeGetPort_InputPort[port].setPortNum(port);
74 
75 #if FW_OBJECT_NAMES == 1
76  char portName[120];
77  (void) snprintf(
78  portName,
79  sizeof(portName),
80  "%s_timeGetPort_InputPort[%d]",
81  this->m_objName,
82  port
83  );
84  this->m_timeGetPort_InputPort[port].setObjName(portName);
85 #endif
86 
87  }
88 
89 
90  }
91 
94 
95  }
96 
97  // ----------------------------------------------------------------------
98  // Invocation functions for output ports
99  // ----------------------------------------------------------------------
100 
101  // ----------------------------------------------------------------------
102  // Getters for numbers of ports
103  // ----------------------------------------------------------------------
104 
105  NATIVE_INT_TYPE TimeComponentBase ::
106  getNum_timeGetPort_InputPorts(void)
107  {
109  this->m_timeGetPort_InputPort
110  );
111  }
112 
113  // ----------------------------------------------------------------------
114  // Calls for invocations received on typed input ports
115  // ----------------------------------------------------------------------
116 
117  void TimeComponentBase ::
118  m_p_timeGetPort_in(
119  Fw::PassiveComponentBase* callComp,
120  NATIVE_INT_TYPE portNum,
121  Fw::Time &time
122  )
123  {
124  FW_ASSERT(callComp);
125  TimeComponentBase* compPtr =
126  (TimeComponentBase*) callComp;
127  compPtr->timeGetPort_handlerBase(portNum, time);
128  }
129 
130  // ----------------------------------------------------------------------
131  // Port handler base-class functions for typed input ports
132  // ----------------------------------------------------------------------
133 
134  void TimeComponentBase ::
135  timeGetPort_handlerBase(
136  NATIVE_INT_TYPE portNum,
137  Fw::Time &time
138  )
139  {
140 
141  // Make sure port number is valid
142  FW_ASSERT(portNum < this->getNum_timeGetPort_InputPorts(),static_cast<AssertArg>(portNum));
143 
144  // Down call to pure virtual handler method implemented in Impl class
145  this->timeGetPort_handler(portNum, time);
146 
147  }
148 
149 } // end namespace Svc
Fw::InputTimePort
Definition: TimePortAc.hpp:28
Svc::TimeComponentBase
Auto-generated base for Time component.
Definition: TimeComponentAc.hpp:30
Fw::Time
Definition: Time.hpp:10
Svc::TimeComponentBase::portNum
PRIVATE NATIVE_INT_TYPE portNum
Definition: TimeComponentAc.hpp:158
FW_NUM_ARRAY_ELEMENTS
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.hpp:103
TimeComponentAc.hpp
Svc::TimeComponentBase::get_timeGetPort_InputPort
Fw::InputTimePort * get_timeGetPort_InputPort(NATIVE_INT_TYPE portNum)
Definition: TimeComponentAc.cpp:29
Assert.hpp
EightyCharString.hpp
Fw::PassiveComponentBase
Definition: PassiveComponentBase.hpp:10
Fw::ObjBase::init
void init(void)
Object initializer.
Definition: ObjBase.cpp:26
Svc::TimeComponentBase::~TimeComponentBase
virtual ~TimeComponentBase(void)
Definition: TimeComponentAc.cpp:93
Svc::TimeComponentBase::time
PROTECTED Fw::Time & time
Definition: TimeComponentAc.hpp:93
FW_ASSERT
#define FW_ASSERT(...)
Definition: Assert.hpp:9
FpConfig.hpp
ISF configuration file.
Svc
Definition: ActiveLoggerComponentAc.cpp:22
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
AssertArg
#define AssertArg
Definition: FpConfig.hpp:51
Fw
Definition: BufferGetPortAc.cpp:6