F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
11#include "FpConfig.hpp"
16#include "Fw/Tlm/TlmPortAc.hpp"
17#include "Fw/Tlm/TlmString.hpp"
22
23namespace Drv {
24
31 {
32
33 // ----------------------------------------------------------------------
34 // Friend classes
35 // ----------------------------------------------------------------------
36
39
40 PROTECTED:
41
42 // ----------------------------------------------------------------------
43 // Constants
44 // ----------------------------------------------------------------------
45
47 enum {
51 };
52
54 enum {
57 };
58
60 enum {
64 };
65
67 enum {
69 };
70
71 public:
72
73 // ----------------------------------------------------------------------
74 // Component initialization
75 // ----------------------------------------------------------------------
76
78 void init(
79 NATIVE_INT_TYPE queueDepth,
80 NATIVE_INT_TYPE instance = 0
81 );
82
83 public:
84
85 // ----------------------------------------------------------------------
86 // Getters for typed input ports
87 // ----------------------------------------------------------------------
88
93 NATIVE_INT_TYPE portNum
94 );
95
100 NATIVE_INT_TYPE portNum
101 );
102
107 NATIVE_INT_TYPE portNum
108 );
109
110 public:
111
112 // ----------------------------------------------------------------------
113 // Connect input ports to special output ports
114 // ----------------------------------------------------------------------
115
118 NATIVE_INT_TYPE portNum,
119 Fw::InputTimePort* port
120 );
121
124 NATIVE_INT_TYPE portNum,
125 Fw::InputTlmPort* port
126 );
127
128 public:
129
130 // ----------------------------------------------------------------------
131 // Connect typed input ports to typed output ports
132 // ----------------------------------------------------------------------
133
136 NATIVE_INT_TYPE portNum,
138 );
139
142 NATIVE_INT_TYPE portNum,
144 );
145
148 NATIVE_INT_TYPE portNum,
149 Svc::InputPingPort* port
150 );
151
152#if FW_PORT_SERIALIZATION
153
154 public:
155
156 // ----------------------------------------------------------------------
157 // Connect serial input ports to special output ports
158 // ----------------------------------------------------------------------
159
162 NATIVE_INT_TYPE portNum,
163 Fw::InputSerializePort* port
164 );
165
168 NATIVE_INT_TYPE portNum,
169 Fw::InputSerializePort* port
170 );
171
172#endif
173
174#if FW_PORT_SERIALIZATION
175
176 public:
177
178 // ----------------------------------------------------------------------
179 // Connect serial input ports to typed output ports
180 // ----------------------------------------------------------------------
181
184 NATIVE_INT_TYPE portNum,
185 Fw::InputSerializePort* port
186 );
187
190 NATIVE_INT_TYPE portNum,
191 Fw::InputSerializePort* port
192 );
193
196 NATIVE_INT_TYPE portNum,
197 Fw::InputSerializePort* port
198 );
199
200#endif
201
202 PROTECTED:
203
204 // ----------------------------------------------------------------------
205 // Component construction and destruction
206 // ----------------------------------------------------------------------
207
210 const char* compName = ""
211 );
212
215
216 PROTECTED:
217
218 // ----------------------------------------------------------------------
219 // Getters for numbers of typed input ports
220 // ----------------------------------------------------------------------
221
226
231
236
237 PROTECTED:
238
239 // ----------------------------------------------------------------------
240 // Getters for numbers of special output ports
241 // ----------------------------------------------------------------------
242
247
252
253 PROTECTED:
254
255 // ----------------------------------------------------------------------
256 // Getters for numbers of typed output ports
257 // ----------------------------------------------------------------------
258
263
268
273
274 PROTECTED:
275
276 // ----------------------------------------------------------------------
277 // Connection status queries for special output ports
278 // ----------------------------------------------------------------------
279
284 NATIVE_INT_TYPE portNum
285 );
286
291 NATIVE_INT_TYPE portNum
292 );
293
294 PROTECTED:
295
296 // ----------------------------------------------------------------------
297 // Connection status queries for typed output ports
298 // ----------------------------------------------------------------------
299
304 NATIVE_INT_TYPE portNum
305 );
306
311 NATIVE_INT_TYPE portNum
312 );
313
318 NATIVE_INT_TYPE portNum
319 );
320
321 PROTECTED:
322
323 // ----------------------------------------------------------------------
324 // Handlers to implement for typed input ports
325 // ----------------------------------------------------------------------
326
328 virtual void BufferIn_handler(
329 NATIVE_INT_TYPE portNum,
330 Drv::DataBuffer& buff
331 ) = 0;
332
334 virtual void PingIn_handler(
335 NATIVE_INT_TYPE portNum,
336 U32 key
337 ) = 0;
338
340 virtual void Sched_handler(
341 NATIVE_INT_TYPE portNum,
342 NATIVE_UINT_TYPE context
343 ) = 0;
344
345 PROTECTED:
346
347 // ----------------------------------------------------------------------
348 // Port handler base-class functions for typed input ports
349 //
350 // Call these functions directly to bypass the corresponding ports
351 // ----------------------------------------------------------------------
352
355 NATIVE_INT_TYPE portNum,
356 Drv::DataBuffer& buff
357 );
358
361 NATIVE_INT_TYPE portNum,
362 U32 key
363 );
364
367 NATIVE_INT_TYPE portNum,
368 NATIVE_UINT_TYPE context
369 );
370
371 PROTECTED:
372
373 // ----------------------------------------------------------------------
374 // Pre-message hooks for typed async input ports
375 //
376 // Each of these functions is invoked just before processing a message
377 // on the corresponding port. By default, they do nothing. You can
378 // override them to provide specific pre-message behavior.
379 // ----------------------------------------------------------------------
380
382 virtual void BufferIn_preMsgHook(
383 NATIVE_INT_TYPE portNum,
384 Drv::DataBuffer& buff
385 );
386
388 virtual void PingIn_preMsgHook(
389 NATIVE_INT_TYPE portNum,
390 U32 key
391 );
392
394 virtual void Sched_preMsgHook(
395 NATIVE_INT_TYPE portNum,
396 NATIVE_UINT_TYPE context
397 );
398
399 PROTECTED:
400
401 // ----------------------------------------------------------------------
402 // Invocation functions for typed output ports
403 // ----------------------------------------------------------------------
404
406 void BufferOut_out(
407 NATIVE_INT_TYPE portNum,
408 Drv::DataBuffer& buff
409 );
410
412 void CycleOut_out(
413 NATIVE_INT_TYPE portNum,
414 Svc::TimerVal& cycleStart
415 );
416
418 void PingOut_out(
419 NATIVE_INT_TYPE portNum,
420 U32 key
421 );
422
423 PROTECTED:
424
425 // ----------------------------------------------------------------------
426 // Internal interface handlers
427 // ----------------------------------------------------------------------
428
431 U32 interrupt
432 ) = 0;
433
434 PROTECTED:
435
436 // ----------------------------------------------------------------------
437 // Internal interface base-class functions
438 // ----------------------------------------------------------------------
439
442 U32 interrupt
443 );
444
445 PROTECTED:
446
447 // ----------------------------------------------------------------------
448 // Telemetry write functions
449 // ----------------------------------------------------------------------
450
455 U32 arg,
456 Fw::Time _tlmTime = Fw::Time()
457 );
458
459 PROTECTED:
460
461 // ----------------------------------------------------------------------
462 // Time
463 // ----------------------------------------------------------------------
464
469
470 PRIVATE:
471
472 // ----------------------------------------------------------------------
473 // Message dispatch functions
474 // ----------------------------------------------------------------------
475
477 virtual MsgDispatchStatus doDispatch();
478
479 PRIVATE:
480
481 // ----------------------------------------------------------------------
482 // Calls for messages received on typed input ports
483 // ----------------------------------------------------------------------
484
486 static void m_p_BufferIn_in(
487 Fw::PassiveComponentBase* callComp,
488 NATIVE_INT_TYPE portNum,
489 Drv::DataBuffer& buff
490 );
491
493 static void m_p_PingIn_in(
494 Fw::PassiveComponentBase* callComp,
495 NATIVE_INT_TYPE portNum,
496 U32 key
497 );
498
500 static void m_p_Sched_in(
501 Fw::PassiveComponentBase* callComp,
502 NATIVE_INT_TYPE portNum,
503 NATIVE_UINT_TYPE context
504 );
505
506 PRIVATE:
507
508 // ----------------------------------------------------------------------
509 // Typed input ports
510 // ----------------------------------------------------------------------
511
514
516 Svc::InputPingPort m_PingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
517
520
521 PRIVATE:
522
523 // ----------------------------------------------------------------------
524 // Special output ports
525 // ----------------------------------------------------------------------
526
528 Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
529
531 Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
532
533 PRIVATE:
534
535 // ----------------------------------------------------------------------
536 // Typed output ports
537 // ----------------------------------------------------------------------
538
541
543 Svc::OutputCyclePort m_CycleOut_OutputPort[NUM_CYCLEOUT_OUTPUT_PORTS];
544
546 Svc::OutputPingPort m_PingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
547
548 };
549
550}
551
552#endif
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
C++-compatible configuration header for fprime configuration.
Auto-generated base for BlockDriver component.
void set_PingOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
Connect port to PingOut[portNum].
void CycleOut_out(NATIVE_INT_TYPE portNum, Svc::TimerVal &cycleStart)
Invoke output port CycleOut.
bool isConnected_CycleOut_OutputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_BufferOut_OutputPorts() const
void set_CycleOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputCyclePort *port)
Connect port to CycleOut[portNum].
virtual void PingIn_preMsgHook(NATIVE_INT_TYPE portNum, U32 key)
Pre-message hook for async input port PingIn.
friend class BlockDriverComponentBaseFriend
Friend class for white-box testing.
bool isConnected_Tlm_OutputPort(NATIVE_INT_TYPE portNum)
bool isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_Tlm_OutputPorts() const
void tlmWrite_BD_Cycles(U32 arg, Fw::Time _tlmTime=Fw::Time())
bool isConnected_BufferOut_OutputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_CycleOut_OutputPorts() const
void InterruptReport_internalInterfaceInvoke(U32 interrupt)
Internal interface base-class function for InterruptReport.
@ CHANNELID_BD_CYCLES
Channel ID for BD_Cycles.
virtual void PingIn_handler(NATIVE_INT_TYPE portNum, U32 key)=0
Handler for input port PingIn.
virtual void Sched_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)=0
Handler for input port Sched.
void BufferOut_out(NATIVE_INT_TYPE portNum, Drv::DataBuffer &buff)
Invoke output port BufferOut.
BlockDriverComponentBase(const char *compName="")
Construct BlockDriverComponentBase object.
NATIVE_INT_TYPE getNum_PingIn_InputPorts() const
NATIVE_INT_TYPE getNum_PingOut_OutputPorts() const
void set_Tlm_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
NATIVE_INT_TYPE getNum_Time_OutputPorts() const
void set_BufferOut_OutputPort(NATIVE_INT_TYPE portNum, Drv::InputDataBufferPort *port)
Connect port to BufferOut[portNum].
NATIVE_INT_TYPE getNum_Sched_InputPorts() const
virtual void InterruptReport_internalInterfaceHandler(U32 interrupt)=0
Internal interface handler for InterruptReport.
void Sched_handlerBase(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Handler base-class function for input port Sched.
void BufferIn_handlerBase(NATIVE_INT_TYPE portNum, Drv::DataBuffer &buff)
Handler base-class function for input port BufferIn.
virtual void BufferIn_preMsgHook(NATIVE_INT_TYPE portNum, Drv::DataBuffer &buff)
Pre-message hook for async input port BufferIn.
NATIVE_INT_TYPE getNum_BufferIn_InputPorts() const
virtual ~BlockDriverComponentBase()
Destroy BlockDriverComponentBase object.
bool isConnected_PingOut_OutputPort(NATIVE_INT_TYPE portNum)
Svc::InputSchedPort * get_Sched_InputPort(NATIVE_INT_TYPE portNum)
Svc::InputPingPort * get_PingIn_InputPort(NATIVE_INT_TYPE portNum)
void PingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Invoke output port PingOut.
void PingIn_handlerBase(NATIVE_INT_TYPE portNum, U32 key)
Handler base-class function for input port PingIn.
virtual void Sched_preMsgHook(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Pre-message hook for async input port Sched.
virtual void BufferIn_handler(NATIVE_INT_TYPE portNum, Drv::DataBuffer &buff)=0
Handler for input port BufferIn.
Drv::InputDataBufferPort * get_BufferIn_InputPort(NATIVE_INT_TYPE portNum)
void set_Time_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void init()
Object initializer.
Definition ObjBase.cpp:27
Serializable class for carrying timer values.
Definition TimerVal.hpp:22