F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
ComQueueComponentAc.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title ComQueueComponentAc.hpp
3// \author Generated by fpp-to-cpp
4// \brief hpp file for ComQueue component base class
5// ======================================================================
6
7#ifndef Svc_ComQueueComponentAc_HPP
8#define Svc_ComQueueComponentAc_HPP
9
10#include "FpConfig.hpp"
12#include "Fw/Com/ComPortAc.hpp"
14#include "Fw/Log/LogPortAc.hpp"
15#include "Fw/Log/LogString.hpp"
16#if FW_ENABLE_TEXT_LOGGING == 1
18#endif
23#include "Fw/Tlm/TlmPortAc.hpp"
24#include "Fw/Tlm/TlmString.hpp"
29
30namespace Svc {
31
38 {
39
40 // ----------------------------------------------------------------------
41 // Friend classes
42 // ----------------------------------------------------------------------
43
46
47 PROTECTED:
48
49 // ----------------------------------------------------------------------
50 // Constants
51 // ----------------------------------------------------------------------
52
54 enum {
59 };
60
62 enum {
67 };
68
70 enum {
73 };
74
76 enum {
78 };
79
81 enum {
84 };
85
86 public:
87
88 // ----------------------------------------------------------------------
89 // Component initialization
90 // ----------------------------------------------------------------------
91
93 void init(
94 NATIVE_INT_TYPE queueDepth,
95 NATIVE_INT_TYPE instance = 0
96 );
97
98 public:
99
100 // ----------------------------------------------------------------------
101 // Getters for typed input ports
102 // ----------------------------------------------------------------------
103
108 NATIVE_INT_TYPE portNum
109 );
110
115 NATIVE_INT_TYPE portNum
116 );
117
122 NATIVE_INT_TYPE portNum
123 );
124
129 NATIVE_INT_TYPE portNum
130 );
131
132 public:
133
134 // ----------------------------------------------------------------------
135 // Connect input ports to special output ports
136 // ----------------------------------------------------------------------
137
140 NATIVE_INT_TYPE portNum,
141 Fw::InputLogPort* port
142 );
143
144#if FW_ENABLE_TEXT_LOGGING == 1
145
147 void set_LogText_OutputPort(
148 NATIVE_INT_TYPE portNum,
150 );
151
152#endif
153
156 NATIVE_INT_TYPE portNum,
157 Fw::InputTimePort* port
158 );
159
162 NATIVE_INT_TYPE portNum,
163 Fw::InputTlmPort* port
164 );
165
166 public:
167
168 // ----------------------------------------------------------------------
169 // Connect typed input ports to typed output ports
170 // ----------------------------------------------------------------------
171
174 NATIVE_INT_TYPE portNum,
176 );
177
180 NATIVE_INT_TYPE portNum,
181 Fw::InputComPort* port
182 );
183
184#if FW_PORT_SERIALIZATION
185
186 public:
187
188 // ----------------------------------------------------------------------
189 // Connect serial input ports to special output ports
190 // ----------------------------------------------------------------------
191
194 NATIVE_INT_TYPE portNum,
195 Fw::InputSerializePort* port
196 );
197
198#if FW_ENABLE_TEXT_LOGGING == 1
199
201 void set_LogText_OutputPort(
202 NATIVE_INT_TYPE portNum,
203 Fw::InputSerializePort* port
204 );
205
206#endif
207
210 NATIVE_INT_TYPE portNum,
211 Fw::InputSerializePort* port
212 );
213
216 NATIVE_INT_TYPE portNum,
217 Fw::InputSerializePort* port
218 );
219
220#endif
221
222#if FW_PORT_SERIALIZATION
223
224 public:
225
226 // ----------------------------------------------------------------------
227 // Connect serial input ports to typed output ports
228 // ----------------------------------------------------------------------
229
232 NATIVE_INT_TYPE portNum,
233 Fw::InputSerializePort* port
234 );
235
238 NATIVE_INT_TYPE portNum,
239 Fw::InputSerializePort* port
240 );
241
242#endif
243
244 PROTECTED:
245
246 // ----------------------------------------------------------------------
247 // Component construction and destruction
248 // ----------------------------------------------------------------------
249
252 const char* compName = ""
253 );
254
256 virtual ~ComQueueComponentBase();
257
258 PROTECTED:
259
260 // ----------------------------------------------------------------------
261 // Getters for numbers of typed input ports
262 // ----------------------------------------------------------------------
263
268
273
278
283
284 PROTECTED:
285
286 // ----------------------------------------------------------------------
287 // Getters for numbers of special output ports
288 // ----------------------------------------------------------------------
289
294
295#if FW_ENABLE_TEXT_LOGGING == 1
296
300 NATIVE_INT_TYPE getNum_LogText_OutputPorts() const;
301
302#endif
303
308
313
314 PROTECTED:
315
316 // ----------------------------------------------------------------------
317 // Getters for numbers of typed output ports
318 // ----------------------------------------------------------------------
319
324
329
330 PROTECTED:
331
332 // ----------------------------------------------------------------------
333 // Connection status queries for special output ports
334 // ----------------------------------------------------------------------
335
340 NATIVE_INT_TYPE portNum
341 );
342
343#if FW_ENABLE_TEXT_LOGGING == 1
344
348 bool isConnected_LogText_OutputPort(
349 NATIVE_INT_TYPE portNum
350 );
351
352#endif
353
358 NATIVE_INT_TYPE portNum
359 );
360
365 NATIVE_INT_TYPE portNum
366 );
367
368 PROTECTED:
369
370 // ----------------------------------------------------------------------
371 // Connection status queries for typed output ports
372 // ----------------------------------------------------------------------
373
378 NATIVE_INT_TYPE portNum
379 );
380
385 NATIVE_INT_TYPE portNum
386 );
387
388 PROTECTED:
389
390 // ----------------------------------------------------------------------
391 // Handlers to implement for typed input ports
392 // ----------------------------------------------------------------------
393
396 NATIVE_INT_TYPE portNum,
397 Fw::Buffer& fwBuffer
398 ) = 0;
399
401 virtual void comQueueIn_handler(
402 NATIVE_INT_TYPE portNum,
403 Fw::ComBuffer& data,
404 U32 context
405 ) = 0;
406
409 NATIVE_INT_TYPE portNum,
410 Fw::Success& condition
411 ) = 0;
412
414 virtual void run_handler(
415 NATIVE_INT_TYPE portNum,
416 NATIVE_UINT_TYPE context
417 ) = 0;
418
419 PROTECTED:
420
421 // ----------------------------------------------------------------------
422 // Port handler base-class functions for typed input ports
423 //
424 // Call these functions directly to bypass the corresponding ports
425 // ----------------------------------------------------------------------
426
429 NATIVE_INT_TYPE portNum,
430 Fw::Buffer& fwBuffer
431 );
432
435 NATIVE_INT_TYPE portNum,
436 Fw::ComBuffer& data,
437 U32 context
438 );
439
442 NATIVE_INT_TYPE portNum,
443 Fw::Success& condition
444 );
445
447 void run_handlerBase(
448 NATIVE_INT_TYPE portNum,
449 NATIVE_UINT_TYPE context
450 );
451
452 PROTECTED:
453
454 // ----------------------------------------------------------------------
455 // Pre-message hooks for typed async input ports
456 //
457 // Each of these functions is invoked just before processing a message
458 // on the corresponding port. By default, they do nothing. You can
459 // override them to provide specific pre-message behavior.
460 // ----------------------------------------------------------------------
461
463 virtual void buffQueueIn_preMsgHook(
464 NATIVE_INT_TYPE portNum,
465 Fw::Buffer& fwBuffer
466 );
467
469 virtual void comQueueIn_preMsgHook(
470 NATIVE_INT_TYPE portNum,
471 Fw::ComBuffer& data,
472 U32 context
473 );
474
476 virtual void comStatusIn_preMsgHook(
477 NATIVE_INT_TYPE portNum,
478 Fw::Success& condition
479 );
480
482 virtual void run_preMsgHook(
483 NATIVE_INT_TYPE portNum,
484 NATIVE_UINT_TYPE context
485 );
486
487 PROTECTED:
488
489 // ----------------------------------------------------------------------
490 // Invocation functions for typed output ports
491 // ----------------------------------------------------------------------
492
495 NATIVE_INT_TYPE portNum,
496 Fw::Buffer& fwBuffer
497 );
498
500 void comQueueSend_out(
501 NATIVE_INT_TYPE portNum,
502 Fw::ComBuffer& data,
503 U32 context
504 );
505
506 PROTECTED:
507
508 // ----------------------------------------------------------------------
509 // Event logging functions
510 // ----------------------------------------------------------------------
511
516 Svc::QueueType queueType,
517 U32 index
518 );
519
520 PROTECTED:
521
522 // ----------------------------------------------------------------------
523 // Telemetry write functions
524 // ----------------------------------------------------------------------
525
530 const Svc::ComQueueDepth& arg,
531 Fw::Time _tlmTime = Fw::Time()
532 );
533
538 const Svc::BuffQueueDepth& arg,
539 Fw::Time _tlmTime = Fw::Time()
540 );
541
542 PROTECTED:
543
544 // ----------------------------------------------------------------------
545 // Time
546 // ----------------------------------------------------------------------
547
552
553 PRIVATE:
554
555 // ----------------------------------------------------------------------
556 // Message dispatch functions
557 // ----------------------------------------------------------------------
558
560 virtual MsgDispatchStatus doDispatch();
561
562 PRIVATE:
563
564 // ----------------------------------------------------------------------
565 // Calls for messages received on typed input ports
566 // ----------------------------------------------------------------------
567
569 static void m_p_buffQueueIn_in(
570 Fw::PassiveComponentBase* callComp,
571 NATIVE_INT_TYPE portNum,
572 Fw::Buffer& fwBuffer
573 );
574
576 static void m_p_comQueueIn_in(
577 Fw::PassiveComponentBase* callComp,
578 NATIVE_INT_TYPE portNum,
579 Fw::ComBuffer& data,
580 U32 context
581 );
582
584 static void m_p_comStatusIn_in(
585 Fw::PassiveComponentBase* callComp,
586 NATIVE_INT_TYPE portNum,
587 Fw::Success& condition
588 );
589
591 static void m_p_run_in(
592 Fw::PassiveComponentBase* callComp,
593 NATIVE_INT_TYPE portNum,
594 NATIVE_UINT_TYPE context
595 );
596
597 PRIVATE:
598
599 // ----------------------------------------------------------------------
600 // Typed input ports
601 // ----------------------------------------------------------------------
602
605
607 Fw::InputComPort m_comQueueIn_InputPort[NUM_COMQUEUEIN_INPUT_PORTS];
608
611
614
615 PRIVATE:
616
617 // ----------------------------------------------------------------------
618 // Special output ports
619 // ----------------------------------------------------------------------
620
622 Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
623
624#if FW_ENABLE_TEXT_LOGGING == 1
625
628
629#endif
630
632 Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
633
635 Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
636
637 PRIVATE:
638
639 // ----------------------------------------------------------------------
640 // Typed output ports
641 // ----------------------------------------------------------------------
642
645
647 Fw::OutputComPort m_comQueueSend_OutputPort[NUM_COMQUEUESEND_OUTPUT_PORTS];
648
649 };
650
651}
652
653#endif
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
C++-compatible configuration header for fprime configuration.
void init()
Object initializer.
Definition ObjBase.cpp:27
Success/Failure.
Array of queue depths for Fw::Buffer types.
Auto-generated base for ComQueue component.
bool isConnected_Tlm_OutputPort(NATIVE_INT_TYPE portNum)
void buffQueueSend_out(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Invoke output port buffQueueSend.
Fw::InputComPort * get_comQueueIn_InputPort(NATIVE_INT_TYPE portNum)
void comQueueSend_out(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
Invoke output port comQueueSend.
NATIVE_INT_TYPE getNum_Time_OutputPorts() const
void comQueueIn_handlerBase(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port comQueueIn.
void tlmWrite_comQueueDepth(const Svc::ComQueueDepth &arg, Fw::Time _tlmTime=Fw::Time())
NATIVE_INT_TYPE getNum_comQueueSend_OutputPorts() const
bool isConnected_comQueueSend_OutputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_buffQueueSend_OutputPorts() const
NATIVE_INT_TYPE getNum_Log_OutputPorts() const
void set_Log_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void tlmWrite_buffQueueDepth(const Svc::BuffQueueDepth &arg, Fw::Time _tlmTime=Fw::Time())
void buffQueueIn_handlerBase(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port buffQueueIn.
friend class ComQueueComponentBaseFriend
Friend class for white-box testing.
void set_comQueueSend_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputComPort *port)
Connect port to comQueueSend[portNum].
virtual void comStatusIn_handler(NATIVE_INT_TYPE portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
ComQueueComponentBase(const char *compName="")
Construct ComQueueComponentBase object.
NATIVE_INT_TYPE getNum_comStatusIn_InputPorts() const
Svc::InputSchedPort * get_run_InputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_buffQueueIn_InputPorts() const
@ EVENTID_QUEUEOVERFLOW
Queue overflow event.
virtual void buffQueueIn_preMsgHook(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Pre-message hook for async input port buffQueueIn.
virtual void comQueueIn_handler(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comQueueIn.
bool isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum)
virtual void buffQueueIn_handler(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)=0
Handler for input port buffQueueIn.
virtual void comQueueIn_preMsgHook(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port comQueueIn.
virtual ~ComQueueComponentBase()
Destroy ComQueueComponentBase object.
void set_buffQueueSend_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputBufferSendPort *port)
Connect port to buffQueueSend[portNum].
NATIVE_INT_TYPE getNum_Tlm_OutputPorts() const
virtual void run_preMsgHook(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Pre-message hook for async input port run.
void set_Time_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
virtual void run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)=0
Handler for input port run.
bool isConnected_buffQueueSend_OutputPort(NATIVE_INT_TYPE portNum)
void set_Tlm_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void run_handlerBase(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Handler base-class function for input port run.
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_comQueueIn_InputPorts() const
void log_WARNING_HI_QueueOverflow(Svc::QueueType queueType, U32 index)
NATIVE_INT_TYPE getNum_run_InputPorts() const
bool isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum)
@ CHANNELID_BUFFQUEUEDEPTH
Channel ID for buffQueueDepth.
@ CHANNELID_COMQUEUEDEPTH
Channel ID for comQueueDepth.
virtual void comStatusIn_preMsgHook(NATIVE_INT_TYPE portNum, Fw::Success &condition)
Pre-message hook for async input port comStatusIn.
Fw::InputBufferSendPort * get_buffQueueIn_InputPort(NATIVE_INT_TYPE portNum)
void comStatusIn_handlerBase(NATIVE_INT_TYPE portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
Array of queue depths for Fw::Com types.
An enumeration of queue data types.