F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
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 Auto-generated
4 // \brief hpp file for BlockDriver 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 #ifndef BLOCKDRIVER_COMP_HPP_
14 #define BLOCKDRIVER_COMP_HPP_
15 
16 #include <FpConfig.hpp>
20 #include <Fw/Tlm/TlmString.hpp>
21 #include <Fw/Time/TimePortAc.hpp>
24 #include <Svc/Cycle/TimerVal.hpp>
25 #include <Fw/Tlm/TlmBuffer.hpp>
26 #include <Fw/Time/Time.hpp>
30 #include <Svc/Ping/PingPortAc.hpp>
31 #include <Fw/Tlm/TlmPortAc.hpp>
32 #include <Fw/Time/TimePortAc.hpp>
33 
34 namespace Drv {
35 
41  {
42 
43  // ----------------------------------------------------------------------
44  // Friend classes
45  // ----------------------------------------------------------------------
46 
50 
51  public:
52 
53  // ----------------------------------------------------------------------
54  // Getters for typed input ports
55  // ----------------------------------------------------------------------
56 
63  );
64 
71  );
72 
79  );
80 
81  public:
82 
83  // ----------------------------------------------------------------------
84  // Connect typed input ports to typed output ports
85  // ----------------------------------------------------------------------
86 
91  Svc::InputCyclePort *port
92  );
93 
99  );
100 
105  Svc::InputPingPort *port
106  );
107 
110  void set_Tlm_OutputPort(
112  Fw::InputTlmPort *port
113  );
114 
117  void set_Time_OutputPort(
119  Fw::InputTimePort *port
120  );
121 
122 #if FW_PORT_SERIALIZATION
123 
124  public:
125 
126  // ----------------------------------------------------------------------
127  // Connect serialization input ports to typed output ports
128  // ----------------------------------------------------------------------
129 
134  Fw::InputSerializePort *port
135  );
136 
141  Fw::InputSerializePort *port
142  );
143 
148  Fw::InputSerializePort *port
149  );
150 
153  void set_Tlm_OutputPort(
155  Fw::InputSerializePort *port
156  );
157 
160  void set_Time_OutputPort(
162  Fw::InputSerializePort *port
163  );
164 
165 #endif
166 
168 
169  // ----------------------------------------------------------------------
170  // Component construction, initialization, and destruction
171  // ----------------------------------------------------------------------
172 
173 #if FW_OBJECT_NAMES == 1
177  const char* compName
178  );
179 #else
183 #endif
184 
187  void init(
188  NATIVE_INT_TYPE queueDepth,
189  NATIVE_INT_TYPE instance = 0
190  );
191 
194  virtual ~BlockDriverComponentBase(void);
195 
197 
198  // ----------------------------------------------------------------------
199  // Handlers to implement for typed input ports
200  // ----------------------------------------------------------------------
201 
203  //
204  virtual void Sched_handler(
207  ) = 0;
208 
210  //
211  virtual void BufferIn_handler(
213  Drv::DataBuffer &buff
214  ) = 0;
215 
217  //
218  virtual void PingIn_handler(
220  U32 key
221  ) = 0;
222 
224 
225  // ----------------------------------------------------------------------
226  // Port handler base-class functions for typed input ports.
227  // ----------------------------------------------------------------------
228  // Call these functions directly to bypass the corresponding ports.
229  // ----------------------------------------------------------------------
230 
233  void Sched_handlerBase(
236  );
237 
242  Drv::DataBuffer &buff
243  );
244 
247  void PingIn_handlerBase(
249  U32 key
250  );
251 
253 
254  // ----------------------------------------------------------------------
255  // Pre-message hooks for typed async input ports.
256  // ----------------------------------------------------------------------
257  // Each of these functions is invoked just before processing a message
258  // on the corresponding port. By default they do nothing. You can
259  // override them to provide specific pre-message behavior.
260  // ----------------------------------------------------------------------
261 
264  virtual void Sched_preMsgHook(
267  );
268 
271  virtual void BufferIn_preMsgHook(
273  Drv::DataBuffer &buff
274  );
275 
278  virtual void PingIn_preMsgHook(
280  U32 key
281  );
282 
284 
285  // ----------------------------------------------------------------------
286  // Invocation functions for typed output ports
287  // ----------------------------------------------------------------------
288 
291  void CycleOut_out(
294  );
295 
298  void BufferOut_out(
300  Drv::DataBuffer &buff
301  );
302 
305  void PingOut_out(
307  U32 key
308  );
309 
311 
312  // ----------------------------------------------------------------------
313  // Getters for numbers of input ports
314  // ----------------------------------------------------------------------
315 
320  NATIVE_INT_TYPE getNum_Sched_InputPorts(void);
321 
327 
333 
334 
335  // ----------------------------------------------------------------------
336  // Enumerations for number of ports
337  // ----------------------------------------------------------------------
338 
339  enum {
343  };
344 
346 
347  // ----------------------------------------------------------------------
348  // Getters for numbers of output ports
349  // ----------------------------------------------------------------------
350 
355  NATIVE_INT_TYPE getNum_CycleOut_OutputPorts(void);
356 
362 
368 
374 
380 
381 
382  enum {
388  };
389 
391 
392  // ----------------------------------------------------------------------
393  // Connection status queries for output ports
394  // ----------------------------------------------------------------------
395 
400  bool isConnected_CycleOut_OutputPort(
402  );
403 
410  );
411 
418  );
419 
426  );
427 
434  );
435 
437 
438  // ----------------------------------------------------------------------
439  // Event logging functions
440  // ----------------------------------------------------------------------
441 
442  PROTECTED:
443 
444  // ----------------------------------------------------------------------
445  // Channel IDs
446  // ----------------------------------------------------------------------
447 
448  enum {
449  CHANNELID_BD_CYCLES = 0,
450  };
451 
453 
454  // ----------------------------------------------------------------------
455  // Telemetry write functions
456  // ----------------------------------------------------------------------
457 
460  /* Driver cycle count */
461  void tlmWrite_BD_Cycles(
462  U32 arg
463  );
464 
466 
467  // ----------------------------------------------------------------------
468  // Time
469  // ----------------------------------------------------------------------
470 
475  Fw::Time getTime(void);
476 
478 
479  // ----------------------------------------------------------------------
480  // Internal interface handlers
481  // ----------------------------------------------------------------------
482 
485  virtual void InterruptReport_internalInterfaceHandler(
486  U32 interrupt
487  ) = 0;
488 
490 
491  // ----------------------------------------------------------------------
492  // Internal interface base-class functions
493  // ----------------------------------------------------------------------
494 
497  void InterruptReport_internalInterfaceInvoke(
498  U32 interrupt
499  );
500 
501 
503 
504  // ----------------------------------------------------------------------
505  // Typed input ports
506  // ----------------------------------------------------------------------
507 
510  Svc::InputSchedPort m_Sched_InputPort[NUM_SCHED_INPUT_PORTS];
511 
515 
519 
521 
522  // ----------------------------------------------------------------------
523  // Typed output ports
524  // ----------------------------------------------------------------------
525 
528  Svc::OutputCyclePort m_CycleOut_OutputPort[NUM_CYCLEOUT_OUTPUT_PORTS];
529 
533 
537 
541 
545 
547 
548  // ----------------------------------------------------------------------
549  // Calls for messages received on typed input ports
550  // ----------------------------------------------------------------------
551 
554  static void m_p_Sched_in(
555  Fw::PassiveComponentBase* callComp,
558  );
559 
562  static void m_p_BufferIn_in(
563  Fw::PassiveComponentBase* callComp,
565  Drv::DataBuffer &buff
566  );
567 
570  static void m_p_PingIn_in(
571  Fw::PassiveComponentBase* callComp,
573  U32 key
574  );
575 
577 
578  // ----------------------------------------------------------------------
579  // Message dispatch functions
580  // ----------------------------------------------------------------------
581 
584  virtual MsgDispatchStatus doDispatch(void);
585 
586 
587 
588  };
589 
590 } // end namespace Drv
591 #endif
Drv::BlockDriverComponentBase::set_Time_OutputPort
void set_Time_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Definition: BlockDriverComponentAc.cpp:158
Drv::BlockDriverComponentBase::isConnected_Time_OutputPort
bool isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum)
Definition: BlockDriverComponentAc.cpp:611
Fw::InputTimePort
Definition: TimePortAc.hpp:28
Drv::BlockDriverComponentBase::~BlockDriverComponentBase
virtual ~BlockDriverComponentBase(void)
Definition: BlockDriverComponentAc.cpp:460
Drv::DataBuffer
Definition: DataBuffer.hpp:9
Drv::BlockDriverComponentBase::NUM_SCHED_INPUT_PORTS
@ NUM_SCHED_INPUT_PORTS
Definition: BlockDriverComponentAc.hpp:340
Fw::InputTlmPort
Definition: TlmPortAc.hpp:29
Drv::BlockDriverComponentBase::PingOut_out
void PingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Definition: BlockDriverComponentAc.cpp:489
Drv::BlockDriverComponentBase::PingIn_handlerBase
void PingIn_handlerBase(NATIVE_INT_TYPE portNum, U32 key)
Definition: BlockDriverComponentAc.cpp:865
PRIVATE
#define PRIVATE
overridable private for unit testing
Definition: BasicTypes.hpp:118
Drv::BlockDriverComponentBase::getNum_Tlm_OutputPorts
NATIVE_INT_TYPE getNum_Tlm_OutputPorts(void)
Definition: BlockDriverComponentAc.cpp:551
Fw::Time
Definition: Time.hpp:10
TlmPortAc.hpp
Drv::BlockDriverComponentBase::m_p_PingIn_in
static void m_p_PingIn_in(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, U32 key)
Definition: BlockDriverComponentAc.cpp:742
Drv::BlockDriverComponentBase::BufferIn_handler
virtual void BufferIn_handler(NATIVE_INT_TYPE portNum, Drv::DataBuffer &buff)=0
Handler for input port BufferIn.
Fw::QueuedComponentBase::doDispatch
virtual MsgDispatchStatus doDispatch(void)=0
method to dispatch a single message in the queue.
Fw::OutputTlmPort
Definition: TlmPortAc.hpp:50
Drv::BlockDriverComponentBase::get_BufferIn_InputPort
Drv::InputDataBufferPort * get_BufferIn_InputPort(NATIVE_INT_TYPE portNum)
Definition: BlockDriverComponentAc.cpp:100
Drv::BlockDriverComponentBase
Auto-generated base for BlockDriver component.
Definition: BlockDriverComponentAc.hpp:41
Drv::BlockDriverComponentBase::m_PingOut_OutputPort
Svc::OutputPingPort m_PingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS]
Definition: BlockDriverComponentAc.hpp:536
Drv::BlockDriverComponentBase::m_BufferIn_InputPort
Drv::InputDataBufferPort m_BufferIn_InputPort[NUM_BUFFERIN_INPUT_PORTS]
Definition: BlockDriverComponentAc.hpp:514
Drv
Definition: BlockDriverComponentAc.cpp:22
Drv::BlockDriverComponentBase::NUM_PINGIN_INPUT_PORTS
@ NUM_PINGIN_INPUT_PORTS
Definition: BlockDriverComponentAc.hpp:342
Drv::BlockDriverComponentBase::set_BufferOut_OutputPort
void set_BufferOut_OutputPort(NATIVE_INT_TYPE portNum, Drv::InputDataBufferPort *port)
Definition: BlockDriverComponentAc.cpp:128
TimerVal.hpp
Drv::BlockDriverComponentBase::m_BufferOut_OutputPort
Drv::OutputDataBufferPort m_BufferOut_OutputPort[NUM_BUFFEROUT_OUTPUT_PORTS]
Definition: BlockDriverComponentAc.hpp:532
InputSerializePort.hpp
Drv::BlockDriverComponentBase::BufferIn_preMsgHook
virtual void BufferIn_preMsgHook(NATIVE_INT_TYPE portNum, Drv::DataBuffer &buff)
Definition: BlockDriverComponentAc.cpp:931
Drv::BlockDriverComponentBase::getNum_BufferIn_InputPorts
NATIVE_INT_TYPE getNum_BufferIn_InputPorts(void)
Definition: BlockDriverComponentAc.cpp:511
Drv::BlockDriverComponentBase::getNum_PingOut_OutputPorts
NATIVE_INT_TYPE getNum_PingOut_OutputPorts(void)
Definition: BlockDriverComponentAc.cpp:543
Svc::InputCyclePort
Definition: CyclePortAc.hpp:28
Fw::PassiveComponentBase
Definition: PassiveComponentBase.hpp:10
Drv::BlockDriverComponentBase::set_PingOut_OutputPort
void set_PingOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
Definition: BlockDriverComponentAc.cpp:138
Svc::TimerVal
Serializable class for carrying timer values.
Definition: TimerVal.hpp:22
Fw::ObjBase::init
void init(void)
Object initializer.
Definition: ObjBase.cpp:26
Drv::BlockDriverComponentBase::cycleStart
PROTECTED Svc::TimerVal & cycleStart
Definition: BlockDriverComponentAc.hpp:294
Svc::InputPingPort
Definition: PingPortAc.hpp:27
Drv::BlockDriverComponentBase::isConnected_Tlm_OutputPort
bool isConnected_Tlm_OutputPort(NATIVE_INT_TYPE portNum)
Definition: BlockDriverComponentAc.cpp:601
ActiveComponentBase.hpp
Drv::BlockDriverComponentBase::PingIn_handler
virtual void PingIn_handler(NATIVE_INT_TYPE portNum, U32 key)=0
Handler for input port PingIn.
Drv::BlockDriverComponentBase::context
PROTECTED NATIVE_UINT_TYPE context
Definition: BlockDriverComponentAc.hpp:207
Svc::OutputPingPort
Definition: PingPortAc.hpp:48
Svc::InputSchedPort
Definition: SchedPortAc.hpp:27
TlmString.hpp
TlmBuffer.hpp
Fw::QueuedComponentBase::MsgDispatchStatus
MsgDispatchStatus
Definition: QueuedComponentBase.hpp:25
Drv::BlockDriverComponentBase::set_CycleOut_OutputPort
void set_CycleOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputCyclePort *port)
Definition: BlockDriverComponentAc.cpp:118
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
Drv::BlockDriverComponentBase::PROTECTED
PROTECTED PROTECTED
Definition: BlockDriverComponentAc.hpp:450
Drv::BlockDriverComponentBase::NUM_TLM_OUTPUT_PORTS
@ NUM_TLM_OUTPUT_PORTS
Definition: BlockDriverComponentAc.hpp:386
Drv::BlockDriverComponentBase::PingIn_preMsgHook
virtual void PingIn_preMsgHook(NATIVE_INT_TYPE portNum, U32 key)
Definition: BlockDriverComponentAc.cpp:940
PingPortAc.hpp
Drv::BlockDriverComponentBase::NUM_BUFFERIN_INPUT_PORTS
@ NUM_BUFFERIN_INPUT_PORTS
Definition: BlockDriverComponentAc.hpp:341
Drv::BlockDriverComponentBase::getNum_Time_OutputPorts
NATIVE_INT_TYPE getNum_Time_OutputPorts(void)
Definition: BlockDriverComponentAc.cpp:559
Drv::BlockDriverComponentBase::m_p_BufferIn_in
static void m_p_BufferIn_in(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, Drv::DataBuffer &buff)
Definition: BlockDriverComponentAc.cpp:729
Drv::BlockDriverComponentBase::NUM_PINGOUT_OUTPUT_PORTS
@ NUM_PINGOUT_OUTPUT_PORTS
Definition: BlockDriverComponentAc.hpp:385
Svc::OutputCyclePort
Definition: CyclePortAc.hpp:49
CyclePortAc.hpp
Drv::BlockDriverComponentBase::isConnected_BufferOut_OutputPort
bool isConnected_BufferOut_OutputPort(NATIVE_INT_TYPE portNum)
Definition: BlockDriverComponentAc.cpp:581
Fw::ActiveComponentBase
Definition: ActiveComponentBase.hpp:20
Drv::BlockDriverComponentBase::NUM_CYCLEOUT_OUTPUT_PORTS
@ NUM_CYCLEOUT_OUTPUT_PORTS
Definition: BlockDriverComponentAc.hpp:383
Drv::BlockDriverComponentBase::get_PingIn_InputPort
Svc::InputPingPort * get_PingIn_InputPort(NATIVE_INT_TYPE portNum)
Definition: BlockDriverComponentAc.cpp:107
Drv::BlockDriverComponentBase::NUM_TIME_OUTPUT_PORTS
@ NUM_TIME_OUTPUT_PORTS
Definition: BlockDriverComponentAc.hpp:387
Drv::BlockDriverComponentBase::getNum_PingIn_InputPorts
NATIVE_INT_TYPE getNum_PingIn_InputPorts(void)
Definition: BlockDriverComponentAc.cpp:535
FpConfig.hpp
ISF configuration file.
Drv::BlockDriverComponentBase::NUM_BUFFEROUT_OUTPUT_PORTS
@ NUM_BUFFEROUT_OUTPUT_PORTS
Definition: BlockDriverComponentAc.hpp:384
Drv::BlockDriverComponentBase::get_Sched_InputPort
Svc::InputSchedPort * get_Sched_InputPort(NATIVE_INT_TYPE portNum)
Definition: BlockDriverComponentAc.cpp:93
Drv::BlockDriverComponentBase::portNum
PRIVATE NATIVE_INT_TYPE portNum
Definition: BlockDriverComponentAc.hpp:556
Drv::InputDataBufferPort
Definition: DataBufferPortAc.hpp:28
Drv::OutputDataBufferPort
Definition: DataBufferPortAc.hpp:49
Drv::BlockDriverComponentBase::BlockDriverComponentBaseFriend
friend class BlockDriverComponentBaseFriend
Definition: BlockDriverComponentAc.hpp:49
SchedPortAc.hpp
Drv::BlockDriverComponentBase::getNum_BufferOut_OutputPorts
NATIVE_INT_TYPE getNum_BufferOut_OutputPorts(void)
Definition: BlockDriverComponentAc.cpp:527
DataBuffer.hpp
Fw::OutputTimePort
Definition: TimePortAc.hpp:49
Time.hpp
Drv::BlockDriverComponentBase::BufferIn_handlerBase
void BufferIn_handlerBase(NATIVE_INT_TYPE portNum, Drv::DataBuffer &buff)
Definition: BlockDriverComponentAc.cpp:812
DataBufferPortAc.hpp
Drv::BlockDriverComponentBase::m_Time_OutputPort
Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS]
Definition: BlockDriverComponentAc.hpp:544
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
InternalInterfaceString.hpp
Drv::BlockDriverComponentBase::set_Tlm_OutputPort
void set_Tlm_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
Definition: BlockDriverComponentAc.cpp:148
Drv::BlockDriverComponentBase::isConnected_PingOut_OutputPort
bool isConnected_PingOut_OutputPort(NATIVE_INT_TYPE portNum)
Definition: BlockDriverComponentAc.cpp:591
OutputSerializePort.hpp
TimePortAc.hpp
Drv::BlockDriverComponentBase::m_Tlm_OutputPort
Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS]
Definition: BlockDriverComponentAc.hpp:540
Drv::BlockDriverComponentBase::m_PingIn_InputPort
Svc::InputPingPort m_PingIn_InputPort[NUM_PINGIN_INPUT_PORTS]
Definition: BlockDriverComponentAc.hpp:518
Drv::BlockDriverComponentBase::BufferOut_out
void BufferOut_out(NATIVE_INT_TYPE portNum, Drv::DataBuffer &buff)
Definition: BlockDriverComponentAc.cpp:479