F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
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 FwSizeType queueDepth,
80 FwEnumStoreType instance = 0
81 );
82
83 public:
84
85 // ----------------------------------------------------------------------
86 // Getters for typed input ports
87 // ----------------------------------------------------------------------
88
93 FwIndexType portNum
94 );
95
100 FwIndexType portNum
101 );
102
107 FwIndexType portNum
108 );
109
110 public:
111
112 // ----------------------------------------------------------------------
113 // Connect input ports to special output ports
114 // ----------------------------------------------------------------------
115
118 FwIndexType portNum,
119 Fw::InputTimePort* port
120 );
121
124 FwIndexType portNum,
125 Fw::InputTlmPort* port
126 );
127
128 public:
129
130 // ----------------------------------------------------------------------
131 // Connect typed input ports to typed output ports
132 // ----------------------------------------------------------------------
133
136 FwIndexType portNum,
138 );
139
142 FwIndexType portNum,
144 );
145
148 FwIndexType 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 FwIndexType portNum,
163 Fw::InputSerializePort* port
164 );
165
168 FwIndexType 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 FwIndexType portNum,
185 Fw::InputSerializePort* port
186 );
187
190 FwIndexType portNum,
191 Fw::InputSerializePort* port
192 );
193
196 FwIndexType 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 FwIndexType portNum
285 );
286
291 FwIndexType portNum
292 );
293
294 PROTECTED:
295
296 // ----------------------------------------------------------------------
297 // Connection status queries for typed output ports
298 // ----------------------------------------------------------------------
299
304 FwIndexType portNum
305 );
306
311 FwIndexType portNum
312 );
313
318 FwIndexType portNum
319 );
320
321 PROTECTED:
322
323 // ----------------------------------------------------------------------
324 // Handlers to implement for typed input ports
325 // ----------------------------------------------------------------------
326
328 virtual void BufferIn_handler(
329 FwIndexType portNum,
330 Drv::DataBuffer& buff
331 ) = 0;
332
334 virtual void PingIn_handler(
335 FwIndexType portNum,
336 U32 key
337 ) = 0;
338
340 virtual void Sched_handler(
341 FwIndexType portNum,
342 U32 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 FwIndexType portNum,
356 Drv::DataBuffer& buff
357 );
358
361 FwIndexType portNum,
362 U32 key
363 );
364
367 FwIndexType portNum,
368 U32 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 FwIndexType portNum,
384 Drv::DataBuffer& buff
385 );
386
388 virtual void PingIn_preMsgHook(
389 FwIndexType portNum,
390 U32 key
391 );
392
394 virtual void Sched_preMsgHook(
395 FwIndexType portNum,
396 U32 context
397 );
398
399 PROTECTED:
400
401 // ----------------------------------------------------------------------
402 // Invocation functions for typed output ports
403 // ----------------------------------------------------------------------
404
406 void BufferOut_out(
407 FwIndexType portNum,
408 Drv::DataBuffer& buff
409 );
410
412 void CycleOut_out(
413 FwIndexType portNum,
414 Os::RawTime& cycleStart
415 );
416
418 void PingOut_out(
419 FwIndexType 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 ) const;
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 FwIndexType portNum,
489 Drv::DataBuffer& buff
490 );
491
493 static void m_p_PingIn_in(
494 Fw::PassiveComponentBase* callComp,
495 FwIndexType portNum,
496 U32 key
497 );
498
500 static void m_p_Sched_in(
501 Fw::PassiveComponentBase* callComp,
502 FwIndexType portNum,
503 U32 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
I32 FwEnumStoreType
Definition FpConfig.h:64
PlatformSizeType FwSizeType
Definition FpConfig.h:35
PlatformIndexType FwIndexType
Definition FpConfig.h:25
C++-compatible configuration header for fprime configuration.
Auto-generated base for BlockDriver component.
virtual void BufferIn_handler(FwIndexType portNum, Drv::DataBuffer &buff)=0
Handler for input port BufferIn.
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
virtual void Sched_handler(FwIndexType portNum, U32 context)=0
Handler for input port Sched.
void set_PingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to PingOut[portNum].
friend class BlockDriverComponentBaseFriend
Friend class for white-box testing.
void BufferIn_handlerBase(FwIndexType portNum, Drv::DataBuffer &buff)
Handler base-class function for input port BufferIn.
virtual void PingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port PingIn.
void BufferOut_out(FwIndexType portNum, Drv::DataBuffer &buff)
Invoke output port BufferOut.
void PingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port PingIn.
Drv::InputDataBufferPort * get_BufferIn_InputPort(FwIndexType portNum)
void InterruptReport_internalInterfaceInvoke(U32 interrupt)
Internal interface base-class function for InterruptReport.
void CycleOut_out(FwIndexType portNum, Os::RawTime &cycleStart)
Invoke output port CycleOut.
Svc::InputPingPort * get_PingIn_InputPort(FwIndexType portNum)
bool isConnected_BufferOut_OutputPort(FwIndexType portNum)
void set_BufferOut_OutputPort(FwIndexType portNum, Drv::InputDataBufferPort *port)
Connect port to BufferOut[portNum].
void tlmWrite_BD_Cycles(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
@ CHANNELID_BD_CYCLES
Channel ID for BD_Cycles.
virtual void InterruptReport_internalInterfaceHandler(U32 interrupt)=0
Internal interface handler for InterruptReport.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
virtual ~BlockDriverComponentBase()
Destroy BlockDriverComponentBase object.
bool isConnected_Time_OutputPort(FwIndexType portNum)
void PingOut_out(FwIndexType portNum, U32 key)
Invoke output port PingOut.
bool isConnected_CycleOut_OutputPort(FwIndexType portNum)
Svc::InputSchedPort * get_Sched_InputPort(FwIndexType portNum)
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.
virtual void BufferIn_preMsgHook(FwIndexType portNum, Drv::DataBuffer &buff)
Pre-message hook for async input port BufferIn.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void Sched_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Sched.
bool isConnected_PingOut_OutputPort(FwIndexType portNum)
virtual void Sched_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port Sched.
void init()
Object initializer.
Definition ObjBase.cpp:27