F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
OsTimeComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title OsTimeComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for OsTime component base class
5 // ======================================================================
6 
7 #ifndef Svc_OsTimeComponentAc_HPP
8 #define Svc_OsTimeComponentAc_HPP
9 
10 #include <atomic>
11 
12 #include "Fw/Cmd/CmdPortAc.hpp"
13 #include "Fw/Cmd/CmdRegPortAc.hpp"
15 #include "Fw/Cmd/CmdString.hpp"
17 #include "Fw/FPrimeBasicTypes.hpp"
18 #include "Fw/Log/LogPortAc.hpp"
19 #include "Fw/Log/LogString.hpp"
20 #if FW_ENABLE_TEXT_LOGGING == 1
21 #include "Fw/Log/LogTextPortAc.hpp"
22 #endif
25 #include "Fw/Time/TimePortAc.hpp"
27 
28 namespace Svc {
29 
36  {
37 
38  // ----------------------------------------------------------------------
39  // Friend classes
40  // ----------------------------------------------------------------------
41 
43  friend class OsTimeTesterBase;
45  friend class OsTimeTester;
46 
47  PROTECTED:
48 
49  // ----------------------------------------------------------------------
50  // Constants
51  // ----------------------------------------------------------------------
52 
54  enum {
56  };
57 
59  enum {
62  };
63 
65  enum {
71  };
72 
74  enum {
76  };
77 
79  enum {
81  };
82 
83  public:
84 
85  // ----------------------------------------------------------------------
86  // Component initialization
87  // ----------------------------------------------------------------------
88 
90  void init(
91  FwEnumStoreType instance = 0
92  );
93 
94  public:
95 
96  // ----------------------------------------------------------------------
97  // Getters for special input ports
98  // ----------------------------------------------------------------------
99 
104  FwIndexType portNum
105  );
106 
107  public:
108 
109  // ----------------------------------------------------------------------
110  // Getters for typed input ports
111  // ----------------------------------------------------------------------
112 
117  FwIndexType portNum
118  );
119 
124  FwIndexType portNum
125  );
126 
127  public:
128 
129  // ----------------------------------------------------------------------
130  // Connect input ports to special output ports
131  // ----------------------------------------------------------------------
132 
135  FwIndexType portNum,
136  Fw::InputCmdRegPort* port
137  );
138 
141  FwIndexType portNum,
143  );
144 
147  FwIndexType portNum,
148  Fw::InputLogPort* port
149  );
150 
151 #if FW_ENABLE_TEXT_LOGGING == 1
152 
154  void set_LogText_OutputPort(
155  FwIndexType portNum,
156  Fw::InputLogTextPort* port
157  );
158 
159 #endif
160 
163  FwIndexType portNum,
164  Fw::InputTimePort* port
165  );
166 
167 #if FW_PORT_SERIALIZATION
168 
169  public:
170 
171  // ----------------------------------------------------------------------
172  // Connect serial input ports to special output ports
173  // ----------------------------------------------------------------------
174 
177  FwIndexType portNum,
178  Fw::InputSerializePort* port
179  );
180 
183  FwIndexType portNum,
184  Fw::InputSerializePort* port
185  );
186 
189  FwIndexType portNum,
190  Fw::InputSerializePort* port
191  );
192 
193 #if FW_ENABLE_TEXT_LOGGING == 1
194 
196  void set_LogText_OutputPort(
197  FwIndexType portNum,
198  Fw::InputSerializePort* port
199  );
200 
201 #endif
202 
205  FwIndexType portNum,
206  Fw::InputSerializePort* port
207  );
208 
209 #endif
210 
211  public:
212 
213  // ----------------------------------------------------------------------
214  // Command registration
215  // ----------------------------------------------------------------------
216 
220  void regCommands();
221 
222  PROTECTED:
223 
224  // ----------------------------------------------------------------------
225  // Component construction and destruction
226  // ----------------------------------------------------------------------
227 
230  const char* compName = ""
231  );
232 
234  virtual ~OsTimeComponentBase();
235 
236  PROTECTED:
237 
238  // ----------------------------------------------------------------------
239  // Getters for numbers of special input ports
240  // ----------------------------------------------------------------------
241 
246 
247  PROTECTED:
248 
249  // ----------------------------------------------------------------------
250  // Getters for numbers of typed input ports
251  // ----------------------------------------------------------------------
252 
257 
262 
263  PROTECTED:
264 
265  // ----------------------------------------------------------------------
266  // Getters for numbers of special output ports
267  // ----------------------------------------------------------------------
268 
273 
278 
283 
284 #if FW_ENABLE_TEXT_LOGGING == 1
285 
289  FwIndexType getNum_LogText_OutputPorts() const;
290 
291 #endif
292 
297 
298  PROTECTED:
299 
300  // ----------------------------------------------------------------------
301  // Connection status queries for special output ports
302  // ----------------------------------------------------------------------
303 
308  FwIndexType portNum
309  );
310 
315  FwIndexType portNum
316  );
317 
322  FwIndexType portNum
323  );
324 
325 #if FW_ENABLE_TEXT_LOGGING == 1
326 
330  bool isConnected_LogText_OutputPort(
331  FwIndexType portNum
332  );
333 
334 #endif
335 
340  FwIndexType portNum
341  );
342 
343  PROTECTED:
344 
345  // ----------------------------------------------------------------------
346  // Handlers to implement for typed input ports
347  // ----------------------------------------------------------------------
348 
350  virtual void setEpoch_handler(
351  FwIndexType portNum,
352  const Fw::Time& fw_time,
353  const Os::RawTime& os_time
354  ) = 0;
355 
357  virtual void timeGetPort_handler(
358  FwIndexType portNum,
359  Fw::Time& time
360  ) = 0;
361 
362  PROTECTED:
363 
364  // ----------------------------------------------------------------------
365  // Port handler base-class functions for typed input ports
366  //
367  // Call these functions directly to bypass the corresponding ports
368  // ----------------------------------------------------------------------
369 
372  FwIndexType portNum,
373  const Fw::Time& fw_time,
374  const Os::RawTime& os_time
375  );
376 
379  FwIndexType portNum,
380  Fw::Time& time
381  );
382 
383  PROTECTED:
384 
385  // ----------------------------------------------------------------------
386  // Command response
387  // ----------------------------------------------------------------------
388 
390  void cmdResponse_out(
391  FwOpcodeType opCode,
392  U32 cmdSeq,
393  Fw::CmdResponse response
394  );
395 
396  PROTECTED:
397 
398  // ----------------------------------------------------------------------
399  // Command handlers to implement
400  // ----------------------------------------------------------------------
401 
403  virtual void SetCurrentTime_cmdHandler(
404  FwOpcodeType opCode,
405  U32 cmdSeq,
406  U32 seconds_now
407  ) = 0;
408 
409  PROTECTED:
410 
411  // ----------------------------------------------------------------------
412  // Command handler base-class functions
413  //
414  // Call these functions directly to bypass the command input port
415  // ----------------------------------------------------------------------
416 
419  FwOpcodeType opCode,
420  U32 cmdSeq,
421  Fw::CmdArgBuffer& args
422  );
423 
424  PROTECTED:
425 
426  // ----------------------------------------------------------------------
427  // Event logging functions
428  // ----------------------------------------------------------------------
429 
434  U32 status
435  ) const;
436 
437  PROTECTED:
438 
439  // ----------------------------------------------------------------------
440  // Time
441  // ----------------------------------------------------------------------
442 
446  Fw::Time getTime() const;
447 
448  PRIVATE:
449 
450  // ----------------------------------------------------------------------
451  // Calls for messages received on special input ports
452  // ----------------------------------------------------------------------
453 
455  static void m_p_CmdDisp_in(
456  Fw::PassiveComponentBase* callComp,
457  FwIndexType portNum,
458  FwOpcodeType opCode,
459  U32 cmdSeq,
460  Fw::CmdArgBuffer& args
461  );
462 
463  PRIVATE:
464 
465  // ----------------------------------------------------------------------
466  // Calls for messages received on typed input ports
467  // ----------------------------------------------------------------------
468 
470  static void m_p_setEpoch_in(
471  Fw::PassiveComponentBase* callComp,
472  FwIndexType portNum,
473  const Fw::Time& fw_time,
474  const Os::RawTime& os_time
475  );
476 
478  static void m_p_timeGetPort_in(
479  Fw::PassiveComponentBase* callComp,
480  FwIndexType portNum,
481  Fw::Time& time
482  );
483 
484  PRIVATE:
485 
486  // ----------------------------------------------------------------------
487  // Special input ports
488  // ----------------------------------------------------------------------
489 
491  Fw::InputCmdPort m_CmdDisp_InputPort[NUM_CMDDISP_INPUT_PORTS];
492 
493  PRIVATE:
494 
495  // ----------------------------------------------------------------------
496  // Typed input ports
497  // ----------------------------------------------------------------------
498 
501 
503  Fw::InputTimePort m_timeGetPort_InputPort[NUM_TIMEGETPORT_INPUT_PORTS];
504 
505  PRIVATE:
506 
507  // ----------------------------------------------------------------------
508  // Special output ports
509  // ----------------------------------------------------------------------
510 
512  Fw::OutputCmdRegPort m_CmdReg_OutputPort[NUM_CMDREG_OUTPUT_PORTS];
513 
516 
518  Fw::OutputLogPort m_EventOut_OutputPort[NUM_EVENTOUT_OUTPUT_PORTS];
519 
520 #if FW_ENABLE_TEXT_LOGGING == 1
521 
523  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
524 
525 #endif
526 
528  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
529 
530  };
531 
532 }
533 
534 #endif
FwIndexType getNum_CmdStatus_OutputPorts() const
Definition: Time.hpp:9
Svc::InputOsTimeEpochPort * get_setEpoch_InputPort(FwIndexType portNum)
bool isConnected_CmdReg_OutputPort(FwIndexType portNum)
FwIdType FwOpcodeType
The type of a command opcode.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
I32 FwEnumStoreType
virtual void SetCurrentTime_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 seconds_now)=0
Handler for command SetCurrentTime.
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
void log_WARNING_HI_SetCurrentTimeError(U32 status) const
Enum representing a command response.
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
virtual void setEpoch_handler(FwIndexType portNum, const Fw::Time &fw_time, const Os::RawTime &os_time)=0
Handler for input port setEpoch.
FwIndexType getNum_CmdReg_OutputPorts() const
bool isConnected_EventOut_OutputPort(FwIndexType portNum)
void init()
Object initializer.
Definition: ObjBase.cpp:26
void setEpoch_handlerBase(FwIndexType portNum, const Fw::Time &fw_time, const Os::RawTime &os_time)
Handler base-class function for input port setEpoch.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void SetCurrentTime_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Base-class handler function for command SetCurrentTime.
FwIndexType getNum_CmdDisp_InputPorts() const
FwIndexType getNum_timeCaller_OutputPorts() const
FwIndexType getNum_setEpoch_InputPorts() const
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
void timeGetPort_handlerBase(FwIndexType portNum, Fw::Time &time)
Handler base-class function for input port timeGetPort.
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum)
Auto-generated base for OsTime component.
PlatformIndexType FwIndexType
friend class OsTimeTesterBase
Friend class tester to support autocoded test harness.
void set_EventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to EventOut[portNum].
virtual ~OsTimeComponentBase()
Destroy OsTimeComponentBase object.
An error occurred while attempting to set the current time.
RateGroupDivider component implementation.
virtual void timeGetPort_handler(FwIndexType portNum, Fw::Time &time)=0
Handler for input port timeGetPort.
FwIndexType getNum_timeGetPort_InputPorts() const
Fw::InputTimePort * get_timeGetPort_InputPort(FwIndexType portNum)
void regCommands()
Register commands with the Command Dispatcher.
friend class OsTimeTester
Friend class tester implementation to support white-box testing.
OsTimeComponentBase(const char *compName="")
Construct OsTimeComponentBase object.
FwIndexType getNum_EventOut_OutputPorts() const