F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
BlockDriverComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title BlockDriverComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for BlockDriver component base class
5 // ======================================================================
6 
7 #ifndef Drv_BlockDriverComponentAc_HPP
8 #define Drv_BlockDriverComponentAc_HPP
9 
12 #include "Fw/FPrimeBasicTypes.hpp"
15 #include "Fw/Time/TimePortAc.hpp"
16 #include "Fw/Tlm/TlmPortAc.hpp"
17 #include "Fw/Tlm/TlmString.hpp"
20 #include "Svc/Ping/PingPortAc.hpp"
22 
23 namespace Drv {
24 
31  {
32 
33  // ----------------------------------------------------------------------
34  // Friend classes
35  // ----------------------------------------------------------------------
36 
40  friend class BlockDriverTesterBase;
41 
42  PROTECTED:
43 
44  // ----------------------------------------------------------------------
45  // Constants
46  // ----------------------------------------------------------------------
47 
49  enum {
53  };
54 
56  enum {
59  };
60 
62  enum {
66  };
67 
69  enum {
71  };
72 
73  public:
74 
75  // ----------------------------------------------------------------------
76  // Component initialization
77  // ----------------------------------------------------------------------
78 
80  void init(
81  FwSizeType queueDepth,
82  FwEnumStoreType instance = 0
83  );
84 
85  public:
86 
87  // ----------------------------------------------------------------------
88  // Getters for typed input ports
89  // ----------------------------------------------------------------------
90 
95  FwIndexType portNum
96  );
97 
102  FwIndexType portNum
103  );
104 
109  FwIndexType portNum
110  );
111 
112  public:
113 
114  // ----------------------------------------------------------------------
115  // Connect input ports to special output ports
116  // ----------------------------------------------------------------------
117 
119  void set_Time_OutputPort(
120  FwIndexType portNum,
121  Fw::InputTimePort* port
122  );
123 
125  void set_Tlm_OutputPort(
126  FwIndexType portNum,
127  Fw::InputTlmPort* port
128  );
129 
130  public:
131 
132  // ----------------------------------------------------------------------
133  // Connect typed input ports to typed output ports
134  // ----------------------------------------------------------------------
135 
138  FwIndexType portNum,
140  );
141 
144  FwIndexType portNum,
145  Svc::InputCyclePort* port
146  );
147 
150  FwIndexType portNum,
151  Svc::InputPingPort* port
152  );
153 
154 #if FW_PORT_SERIALIZATION
155 
156  public:
157 
158  // ----------------------------------------------------------------------
159  // Connect serial input ports to special output ports
160  // ----------------------------------------------------------------------
161 
163  void set_Time_OutputPort(
164  FwIndexType portNum,
165  Fw::InputSerializePort* port
166  );
167 
169  void set_Tlm_OutputPort(
170  FwIndexType portNum,
171  Fw::InputSerializePort* port
172  );
173 
174 #endif
175 
176 #if FW_PORT_SERIALIZATION
177 
178  public:
179 
180  // ----------------------------------------------------------------------
181  // Connect serial input ports to typed output ports
182  // ----------------------------------------------------------------------
183 
186  FwIndexType portNum,
187  Fw::InputSerializePort* port
188  );
189 
192  FwIndexType portNum,
193  Fw::InputSerializePort* port
194  );
195 
198  FwIndexType portNum,
199  Fw::InputSerializePort* port
200  );
201 
202 #endif
203 
204  PROTECTED:
205 
206  // ----------------------------------------------------------------------
207  // Component construction and destruction
208  // ----------------------------------------------------------------------
209 
212  const char* compName = ""
213  );
214 
216  virtual ~BlockDriverComponentBase();
217 
218  PROTECTED:
219 
220  // ----------------------------------------------------------------------
221  // Getters for numbers of typed input ports
222  // ----------------------------------------------------------------------
223 
228 
233 
238 
239  PROTECTED:
240 
241  // ----------------------------------------------------------------------
242  // Getters for numbers of special output ports
243  // ----------------------------------------------------------------------
244 
249 
254 
255  PROTECTED:
256 
257  // ----------------------------------------------------------------------
258  // Getters for numbers of typed output ports
259  // ----------------------------------------------------------------------
260 
265 
270 
275 
276  PROTECTED:
277 
278  // ----------------------------------------------------------------------
279  // Connection status queries for special output ports
280  // ----------------------------------------------------------------------
281 
286  FwIndexType portNum
287  );
288 
293  FwIndexType portNum
294  );
295 
296  PROTECTED:
297 
298  // ----------------------------------------------------------------------
299  // Connection status queries for typed output ports
300  // ----------------------------------------------------------------------
301 
306  FwIndexType portNum
307  );
308 
313  FwIndexType portNum
314  );
315 
320  FwIndexType portNum
321  );
322 
323  PROTECTED:
324 
325  // ----------------------------------------------------------------------
326  // Handlers to implement for typed input ports
327  // ----------------------------------------------------------------------
328 
330  virtual void BufferIn_handler(
331  FwIndexType portNum,
332  Drv::DataBuffer& buff
333  ) = 0;
334 
336  virtual void PingIn_handler(
337  FwIndexType portNum,
338  U32 key
339  ) = 0;
340 
342  virtual void Sched_handler(
343  FwIndexType portNum,
344  U32 context
345  ) = 0;
346 
347  PROTECTED:
348 
349  // ----------------------------------------------------------------------
350  // Port handler base-class functions for typed input ports
351  //
352  // Call these functions directly to bypass the corresponding ports
353  // ----------------------------------------------------------------------
354 
357  FwIndexType portNum,
358  Drv::DataBuffer& buff
359  );
360 
362  void PingIn_handlerBase(
363  FwIndexType portNum,
364  U32 key
365  );
366 
368  void Sched_handlerBase(
369  FwIndexType portNum,
370  U32 context
371  );
372 
373  PROTECTED:
374 
375  // ----------------------------------------------------------------------
376  // Pre-message hooks for typed async input ports
377  //
378  // Each of these functions is invoked just before processing a message
379  // on the corresponding port. By default, they do nothing. You can
380  // override them to provide specific pre-message behavior.
381  // ----------------------------------------------------------------------
382 
384  virtual void BufferIn_preMsgHook(
385  FwIndexType portNum,
386  Drv::DataBuffer& buff
387  );
388 
390  virtual void PingIn_preMsgHook(
391  FwIndexType portNum,
392  U32 key
393  );
394 
396  virtual void Sched_preMsgHook(
397  FwIndexType portNum,
398  U32 context
399  );
400 
401  PROTECTED:
402 
403  // ----------------------------------------------------------------------
404  // Invocation functions for typed output ports
405  // ----------------------------------------------------------------------
406 
408  void BufferOut_out(
409  FwIndexType portNum,
410  Drv::DataBuffer& buff
411  );
412 
414  void CycleOut_out(
415  FwIndexType portNum,
416  Os::RawTime& cycleStart
417  );
418 
420  void PingOut_out(
421  FwIndexType portNum,
422  U32 key
423  );
424 
425  PROTECTED:
426 
427  // ----------------------------------------------------------------------
428  // Internal interface handlers
429  // ----------------------------------------------------------------------
430 
433  U32 interrupt
434  ) = 0;
435 
436  PROTECTED:
437 
438  // ----------------------------------------------------------------------
439  // Internal interface base-class functions
440  // ----------------------------------------------------------------------
441 
444  U32 interrupt
445  );
446 
447  PROTECTED:
448 
449  // ----------------------------------------------------------------------
450  // Telemetry write functions
451  // ----------------------------------------------------------------------
452 
456  void tlmWrite_BD_Cycles(
457  U32 arg,
458  Fw::Time _tlmTime = Fw::Time()
459  ) const;
460 
461  PROTECTED:
462 
463  // ----------------------------------------------------------------------
464  // Time
465  // ----------------------------------------------------------------------
466 
470  Fw::Time getTime() const;
471 
472  PRIVATE:
473 
474  // ----------------------------------------------------------------------
475  // Message dispatch functions
476  // ----------------------------------------------------------------------
477 
479  virtual MsgDispatchStatus doDispatch();
480 
481  PRIVATE:
482 
483  // ----------------------------------------------------------------------
484  // Calls for messages received on typed input ports
485  // ----------------------------------------------------------------------
486 
488  static void m_p_BufferIn_in(
489  Fw::PassiveComponentBase* callComp,
490  FwIndexType portNum,
491  Drv::DataBuffer& buff
492  );
493 
495  static void m_p_PingIn_in(
496  Fw::PassiveComponentBase* callComp,
497  FwIndexType portNum,
498  U32 key
499  );
500 
502  static void m_p_Sched_in(
503  Fw::PassiveComponentBase* callComp,
504  FwIndexType portNum,
505  U32 context
506  );
507 
508  PRIVATE:
509 
510  // ----------------------------------------------------------------------
511  // Typed input ports
512  // ----------------------------------------------------------------------
513 
516 
518  Svc::InputPingPort m_PingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
519 
521  Svc::InputSchedPort m_Sched_InputPort[NUM_SCHED_INPUT_PORTS];
522 
523  PRIVATE:
524 
525  // ----------------------------------------------------------------------
526  // Special output ports
527  // ----------------------------------------------------------------------
528 
530  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
531 
533  Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
534 
535  PRIVATE:
536 
537  // ----------------------------------------------------------------------
538  // Typed output ports
539  // ----------------------------------------------------------------------
540 
543 
545  Svc::OutputCyclePort m_CycleOut_OutputPort[NUM_CYCLEOUT_OUTPUT_PORTS];
546 
548  Svc::OutputPingPort m_PingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
549 
550  };
551 
552 }
553 
554 #endif
void Sched_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Sched.
bool isConnected_BufferOut_OutputPort(FwIndexType portNum)
Definition: Time.hpp:9
Svc::InputSchedPort * get_Sched_InputPort(FwIndexType portNum)
bool isConnected_Time_OutputPort(FwIndexType portNum)
bool isConnected_CycleOut_OutputPort(FwIndexType portNum)
Auto-generated base for BlockDriver component.
PlatformSizeType FwSizeType
I32 FwEnumStoreType
virtual ~BlockDriverComponentBase()
Destroy BlockDriverComponentBase object.
void tlmWrite_BD_Cycles(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
friend class BlockDriverTesterBase
Friend class tester to support autocoded test harness.
void PingOut_out(FwIndexType portNum, U32 key)
Invoke output port PingOut.
void init()
Object initializer.
Definition: ObjBase.cpp:26
virtual void Sched_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port Sched.
void set_CycleOut_OutputPort(FwIndexType portNum, Svc::InputCyclePort *port)
Connect port to CycleOut[portNum].
virtual void PingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port PingIn.
void set_PingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to PingOut[portNum].
Drv::InputDataBufferPort * get_BufferIn_InputPort(FwIndexType portNum)
void PingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port PingIn.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
FwIndexType getNum_BufferOut_OutputPorts() const
friend class BlockDriverComponentBaseFriend
Friend class for white-box testing.
void set_BufferOut_OutputPort(FwIndexType portNum, Drv::InputDataBufferPort *port)
Connect port to BufferOut[portNum].
virtual void PingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port PingIn.
void CycleOut_out(FwIndexType portNum, Os::RawTime &cycleStart)
Invoke output port CycleOut.
FwIndexType getNum_BufferIn_InputPorts() const
PlatformIndexType FwIndexType
void BufferIn_handlerBase(FwIndexType portNum, Drv::DataBuffer &buff)
Handler base-class function for input port BufferIn.
void BufferOut_out(FwIndexType portNum, Drv::DataBuffer &buff)
Invoke output port BufferOut.
bool isConnected_PingOut_OutputPort(FwIndexType portNum)
void InterruptReport_internalInterfaceInvoke(U32 interrupt)
Internal interface base-class function for InterruptReport.
BlockDriverComponentBase(const char *compName="")
Construct BlockDriverComponentBase object.
virtual void Sched_handler(FwIndexType portNum, U32 context)=0
Handler for input port Sched.
virtual void InterruptReport_internalInterfaceHandler(U32 interrupt)=0
Internal interface handler for InterruptReport.
FwIndexType getNum_CycleOut_OutputPorts() const
FwIndexType getNum_PingOut_OutputPorts() const
Svc::InputPingPort * get_PingIn_InputPort(FwIndexType portNum)
virtual void BufferIn_preMsgHook(FwIndexType portNum, Drv::DataBuffer &buff)
Pre-message hook for async input port BufferIn.
virtual void BufferIn_handler(FwIndexType portNum, Drv::DataBuffer &buff)=0
Handler for input port BufferIn.