F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
DpManagerComponentAc.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title DpManagerComponentAc.hpp
3// \author Generated by fpp-to-cpp
4// \brief hpp file for DpManager component base class
5// ======================================================================
6
7#ifndef Svc_DpManagerComponentAc_HPP
8#define Svc_DpManagerComponentAc_HPP
9
10#include "FpConfig.hpp"
13#include "Fw/Cmd/CmdPortAc.hpp"
16#include "Fw/Cmd/CmdString.hpp"
18#include "Fw/Dp/DpGetPortAc.hpp"
22#include "Fw/Log/LogPortAc.hpp"
23#include "Fw/Log/LogString.hpp"
24#if FW_ENABLE_TEXT_LOGGING == 1
26#endif
30#include "Fw/Tlm/TlmPortAc.hpp"
31#include "Fw/Tlm/TlmString.hpp"
33
34namespace Svc {
35
42 {
43
44 // ----------------------------------------------------------------------
45 // Friend classes
46 // ----------------------------------------------------------------------
47
50
51 PROTECTED:
52
53 // ----------------------------------------------------------------------
54 // Constants
55 // ----------------------------------------------------------------------
56
58 enum {
60 };
61
63 enum {
68 };
69
71 enum {
78 };
79
81 enum {
85 };
86
88 enum {
90 };
91
93 enum {
95 };
96
98 enum {
100 };
101
103 enum {
108 };
109
110 public:
111
112 // ----------------------------------------------------------------------
113 // Component initialization
114 // ----------------------------------------------------------------------
115
117 void init(
118 FwSizeType queueDepth,
119 FwEnumStoreType instance = 0
120 );
121
122 public:
123
124 // ----------------------------------------------------------------------
125 // Getters for special input ports
126 // ----------------------------------------------------------------------
127
132 FwIndexType portNum
133 );
134
135 public:
136
137 // ----------------------------------------------------------------------
138 // Getters for typed input ports
139 // ----------------------------------------------------------------------
140
145 FwIndexType portNum
146 );
147
152 FwIndexType portNum
153 );
154
159 FwIndexType portNum
160 );
161
166 FwIndexType portNum
167 );
168
169 public:
170
171 // ----------------------------------------------------------------------
172 // Connect input ports to special output ports
173 // ----------------------------------------------------------------------
174
177 FwIndexType portNum,
179 );
180
183 FwIndexType portNum,
185 );
186
189 FwIndexType portNum,
190 Fw::InputLogPort* port
191 );
192
193#if FW_ENABLE_TEXT_LOGGING == 1
194
196 void set_textEventOut_OutputPort(
197 FwIndexType portNum,
199 );
200
201#endif
202
205 FwIndexType portNum,
206 Fw::InputTimePort* port
207 );
208
211 FwIndexType portNum,
212 Fw::InputTlmPort* port
213 );
214
215 public:
216
217 // ----------------------------------------------------------------------
218 // Connect typed input ports to typed output ports
219 // ----------------------------------------------------------------------
220
223 FwIndexType portNum,
225 );
226
229 FwIndexType portNum,
231 );
232
235 FwIndexType portNum,
237 );
238
239#if FW_PORT_SERIALIZATION
240
241 public:
242
243 // ----------------------------------------------------------------------
244 // Connect serial input ports to special output ports
245 // ----------------------------------------------------------------------
246
249 FwIndexType portNum,
250 Fw::InputSerializePort* port
251 );
252
255 FwIndexType portNum,
256 Fw::InputSerializePort* port
257 );
258
261 FwIndexType portNum,
262 Fw::InputSerializePort* port
263 );
264
265#if FW_ENABLE_TEXT_LOGGING == 1
266
268 void set_textEventOut_OutputPort(
269 FwIndexType portNum,
270 Fw::InputSerializePort* port
271 );
272
273#endif
274
277 FwIndexType portNum,
278 Fw::InputSerializePort* port
279 );
280
283 FwIndexType portNum,
284 Fw::InputSerializePort* port
285 );
286
287#endif
288
289#if FW_PORT_SERIALIZATION
290
291 public:
292
293 // ----------------------------------------------------------------------
294 // Connect serial input ports to typed output ports
295 // ----------------------------------------------------------------------
296
299 FwIndexType portNum,
300 Fw::InputSerializePort* port
301 );
302
305 FwIndexType portNum,
306 Fw::InputSerializePort* port
307 );
308
309#endif
310
311 public:
312
313 // ----------------------------------------------------------------------
314 // Command registration
315 // ----------------------------------------------------------------------
316
320 void regCommands();
321
322 PROTECTED:
323
324 // ----------------------------------------------------------------------
325 // Component construction and destruction
326 // ----------------------------------------------------------------------
327
330 const char* compName = ""
331 );
332
334 virtual ~DpManagerComponentBase();
335
336 PROTECTED:
337
338 // ----------------------------------------------------------------------
339 // Getters for numbers of special input ports
340 // ----------------------------------------------------------------------
341
346
347 PROTECTED:
348
349 // ----------------------------------------------------------------------
350 // Getters for numbers of typed input ports
351 // ----------------------------------------------------------------------
352
357
362
367
372
373 PROTECTED:
374
375 // ----------------------------------------------------------------------
376 // Getters for numbers of special output ports
377 // ----------------------------------------------------------------------
378
383
388
393
394#if FW_ENABLE_TEXT_LOGGING == 1
395
399 FwIndexType getNum_textEventOut_OutputPorts() const;
400
401#endif
402
407
412
413 PROTECTED:
414
415 // ----------------------------------------------------------------------
416 // Getters for numbers of typed output ports
417 // ----------------------------------------------------------------------
418
423
428
433
434 PROTECTED:
435
436 // ----------------------------------------------------------------------
437 // Connection status queries for special output ports
438 // ----------------------------------------------------------------------
439
444 FwIndexType portNum
445 );
446
451 FwIndexType portNum
452 );
453
458 FwIndexType portNum
459 );
460
461#if FW_ENABLE_TEXT_LOGGING == 1
462
466 bool isConnected_textEventOut_OutputPort(
467 FwIndexType portNum
468 );
469
470#endif
471
476 FwIndexType portNum
477 );
478
483 FwIndexType portNum
484 );
485
486 PROTECTED:
487
488 // ----------------------------------------------------------------------
489 // Connection status queries for typed output ports
490 // ----------------------------------------------------------------------
491
496 FwIndexType portNum
497 );
498
503 FwIndexType portNum
504 );
505
510 FwIndexType portNum
511 );
512
513 PROTECTED:
514
515 // ----------------------------------------------------------------------
516 // Handlers to implement for typed input ports
517 // ----------------------------------------------------------------------
518
521 FwIndexType portNum,
522 FwDpIdType id,
523 FwSizeType dataSize,
524 Fw::Buffer& buffer
525 ) = 0;
526
529 FwIndexType portNum,
530 FwDpIdType id,
531 FwSizeType dataSize
532 ) = 0;
533
536 FwIndexType portNum,
537 FwDpIdType id,
538 const Fw::Buffer& buffer
539 ) = 0;
540
542 virtual void schedIn_handler(
543 FwIndexType portNum,
544 U32 context
545 ) = 0;
546
547 PROTECTED:
548
549 // ----------------------------------------------------------------------
550 // Port handler base-class functions for typed input ports
551 //
552 // Call these functions directly to bypass the corresponding ports
553 // ----------------------------------------------------------------------
554
557 FwIndexType portNum,
558 FwDpIdType id,
559 FwSizeType dataSize,
560 Fw::Buffer& buffer
561 );
562
565 FwIndexType portNum,
566 FwDpIdType id,
567 FwSizeType dataSize
568 );
569
572 FwIndexType portNum,
573 FwDpIdType id,
574 const Fw::Buffer& buffer
575 );
576
579 FwIndexType portNum,
580 U32 context
581 );
582
583 PROTECTED:
584
585 // ----------------------------------------------------------------------
586 // Pre-message hooks for typed async input ports
587 //
588 // Each of these functions is invoked just before processing a message
589 // on the corresponding port. By default, they do nothing. You can
590 // override them to provide specific pre-message behavior.
591 // ----------------------------------------------------------------------
592
594 virtual void productRequestIn_preMsgHook(
595 FwIndexType portNum,
596 FwDpIdType id,
597 FwSizeType dataSize
598 );
599
601 virtual void productSendIn_preMsgHook(
602 FwIndexType portNum,
603 FwDpIdType id,
604 const Fw::Buffer& buffer
605 );
606
608 virtual void schedIn_preMsgHook(
609 FwIndexType portNum,
610 U32 context
611 );
612
613 PROTECTED:
614
615 // ----------------------------------------------------------------------
616 // Invocation functions for typed output ports
617 // ----------------------------------------------------------------------
618
621 FwIndexType portNum,
622 U32 size
623 );
624
627 FwIndexType portNum,
628 FwDpIdType id,
629 const Fw::Buffer& buffer,
630 const Fw::Success& status
631 );
632
635 FwIndexType portNum,
636 Fw::Buffer& fwBuffer
637 );
638
639 PROTECTED:
640
641 // ----------------------------------------------------------------------
642 // Command response
643 // ----------------------------------------------------------------------
644
646 void cmdResponse_out(
647 FwOpcodeType opCode,
648 U32 cmdSeq,
649 Fw::CmdResponse response
650 );
651
652 PROTECTED:
653
654 // ----------------------------------------------------------------------
655 // Command handlers to implement
656 // ----------------------------------------------------------------------
657
662 FwOpcodeType opCode,
663 U32 cmdSeq
664 ) = 0;
665
666 PROTECTED:
667
668 // ----------------------------------------------------------------------
669 // Command handler base-class functions
670 //
671 // Call these functions directly to bypass the command input port
672 // ----------------------------------------------------------------------
673
678 FwOpcodeType opCode,
679 U32 cmdSeq,
680 Fw::CmdArgBuffer& args
681 );
682
683 PROTECTED:
684
685 // ----------------------------------------------------------------------
686 // Pre-message hooks for async commands
687 //
688 // Each of these functions is invoked just before processing the
689 // corresponding command. By default they do nothing. You can
690 // override them to provide specific pre-command behavior.
691 // ----------------------------------------------------------------------
692
695 FwOpcodeType opCode,
696 U32 cmdSeq
697 );
698
699 PROTECTED:
700
701 // ----------------------------------------------------------------------
702 // Event logging functions
703 // ----------------------------------------------------------------------
704
709 U32 id
710 );
711
712 PROTECTED:
713
714 // ----------------------------------------------------------------------
715 // Event throttle reset functions
716 // ----------------------------------------------------------------------
717
720
721 PROTECTED:
722
723 // ----------------------------------------------------------------------
724 // Telemetry write functions
725 // ----------------------------------------------------------------------
726
731 U32 arg,
732 Fw::Time _tlmTime = Fw::Time()
733 );
734
739 U32 arg,
740 Fw::Time _tlmTime = Fw::Time()
741 );
742
747 U32 arg,
748 Fw::Time _tlmTime = Fw::Time()
749 );
750
755 U64 arg,
756 Fw::Time _tlmTime = Fw::Time()
757 );
758
759 PROTECTED:
760
761 // ----------------------------------------------------------------------
762 // Time
763 // ----------------------------------------------------------------------
764
769
770 PRIVATE:
771
772 // ----------------------------------------------------------------------
773 // Message dispatch functions
774 // ----------------------------------------------------------------------
775
777 virtual MsgDispatchStatus doDispatch();
778
779 PRIVATE:
780
781 // ----------------------------------------------------------------------
782 // Calls for messages received on special input ports
783 // ----------------------------------------------------------------------
784
786 static void m_p_cmdIn_in(
787 Fw::PassiveComponentBase* callComp,
788 FwIndexType portNum,
789 FwOpcodeType opCode,
790 U32 cmdSeq,
791 Fw::CmdArgBuffer& args
792 );
793
794 PRIVATE:
795
796 // ----------------------------------------------------------------------
797 // Calls for messages received on typed input ports
798 // ----------------------------------------------------------------------
799
801 static Fw::Success m_p_productGetIn_in(
802 Fw::PassiveComponentBase* callComp,
803 FwIndexType portNum,
804 FwDpIdType id,
805 FwSizeType dataSize,
806 Fw::Buffer& buffer
807 );
808
810 static void m_p_productRequestIn_in(
811 Fw::PassiveComponentBase* callComp,
812 FwIndexType portNum,
813 FwDpIdType id,
814 FwSizeType dataSize
815 );
816
818 static void m_p_productSendIn_in(
819 Fw::PassiveComponentBase* callComp,
820 FwIndexType portNum,
821 FwDpIdType id,
822 const Fw::Buffer& buffer
823 );
824
826 static void m_p_schedIn_in(
827 Fw::PassiveComponentBase* callComp,
828 FwIndexType portNum,
829 U32 context
830 );
831
832 PRIVATE:
833
834 // ----------------------------------------------------------------------
835 // Special input ports
836 // ----------------------------------------------------------------------
837
839 Fw::InputCmdPort m_cmdIn_InputPort[NUM_CMDIN_INPUT_PORTS];
840
841 PRIVATE:
842
843 // ----------------------------------------------------------------------
844 // Typed input ports
845 // ----------------------------------------------------------------------
846
848 Fw::InputDpGetPort m_productGetIn_InputPort[NUM_PRODUCTGETIN_INPUT_PORTS];
849
851 Fw::InputDpRequestPort m_productRequestIn_InputPort[NUM_PRODUCTREQUESTIN_INPUT_PORTS];
852
854 Fw::InputDpSendPort m_productSendIn_InputPort[NUM_PRODUCTSENDIN_INPUT_PORTS];
855
857 Svc::InputSchedPort m_schedIn_InputPort[NUM_SCHEDIN_INPUT_PORTS];
858
859 PRIVATE:
860
861 // ----------------------------------------------------------------------
862 // Special output ports
863 // ----------------------------------------------------------------------
864
866 Fw::OutputCmdRegPort m_cmdRegIn_OutputPort[NUM_CMDREGIN_OUTPUT_PORTS];
867
870
872 Fw::OutputLogPort m_eventOut_OutputPort[NUM_EVENTOUT_OUTPUT_PORTS];
873
874#if FW_ENABLE_TEXT_LOGGING == 1
875
877 Fw::OutputLogTextPort m_textEventOut_OutputPort[NUM_TEXTEVENTOUT_OUTPUT_PORTS];
878
879#endif
880
882 Fw::OutputTimePort m_timeGetOut_OutputPort[NUM_TIMEGETOUT_OUTPUT_PORTS];
883
885 Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
886
887 PRIVATE:
888
889 // ----------------------------------------------------------------------
890 // Typed output ports
891 // ----------------------------------------------------------------------
892
895
897 Fw::OutputDpResponsePort m_productResponseOut_OutputPort[NUM_PRODUCTRESPONSEOUT_OUTPUT_PORTS];
898
901
902 PRIVATE:
903
904 // ----------------------------------------------------------------------
905 // Counter values for event throttling
906 // ----------------------------------------------------------------------
907
909 FwIndexType m_BufferAllocationFailedThrottle;
910
911 PRIVATE:
912
913 // ----------------------------------------------------------------------
914 // First update flags for telemetry channels
915 // ----------------------------------------------------------------------
916
918 bool m_first_update_NumSuccessfulAllocations;
919
921 bool m_first_update_NumFailedAllocations;
922
924 bool m_first_update_NumDataProducts;
925
927 bool m_first_update_NumBytes;
928
929 PRIVATE:
930
931 // ----------------------------------------------------------------------
932 // Last value storage for telemetry channels
933 // ----------------------------------------------------------------------
934
936 U32 m_last_NumSuccessfulAllocations;
937
939 U32 m_last_NumFailedAllocations;
940
942 U32 m_last_NumDataProducts;
943
945 U64 m_last_NumBytes;
946
947 };
948
949}
950
951#endif
I32 FwEnumStoreType
Definition FpConfig.h:64
U32 FwDpIdType
Definition FpConfig.h:115
U32 FwOpcodeType
Definition FpConfig.h:91
PlatformSizeType FwSizeType
Definition FpConfig.h:35
PlatformIndexType FwIndexType
Definition FpConfig.h:25
C++-compatible configuration header for fprime configuration.
Enum representing a command response.
void init()
Object initializer.
Definition ObjBase.cpp:27
Success/Failure.
Auto-generated base for DpManager component.
FwIndexType getNum_cmdRegIn_OutputPorts() const
bool isConnected_productResponseOut_OutputPort(FwIndexType portNum)
friend class DpManagerComponentBaseFriend
Friend class for white-box testing.
@ OPCODE_CLEAR_EVENT_THROTTLE
Clear event throttling.
bool isConnected_timeGetOut_OutputPort(FwIndexType portNum)
virtual void CLEAR_EVENT_THROTTLE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CLEAR_EVENT_THROTTLE.
void regCommands()
Register commands with the Command Dispatcher.
virtual void schedIn_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port schedIn.
FwIndexType getNum_timeGetOut_OutputPorts() const
void set_productSendOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to productSendOut[portNum].
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
void tlmWrite_NumDataProducts(U32 arg, Fw::Time _tlmTime=Fw::Time())
@ EVENTID_BUFFERALLOCATIONFAILED
Buffer allocation failed.
void set_timeGetOut_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeGetOut[portNum].
FwIndexType getNum_tlmOut_OutputPorts() const
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
void log_WARNING_HI_BufferAllocationFailed_ThrottleClear()
Reset throttle value for BufferAllocationFailed.
FwIndexType getNum_productSendIn_InputPorts() const
FwIndexType getNum_cmdIn_InputPorts() const
virtual Fw::Success productGetIn_handler(FwIndexType portNum, FwDpIdType id, FwSizeType dataSize, Fw::Buffer &buffer)=0
Handler for input port productGetIn.
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
FwIndexType getNum_productSendOut_OutputPorts() const
bool isConnected_bufferGetOut_OutputPort(FwIndexType portNum)
void tlmWrite_NumSuccessfulAllocations(U32 arg, Fw::Time _tlmTime=Fw::Time())
virtual void productRequestIn_preMsgHook(FwIndexType portNum, FwDpIdType id, FwSizeType dataSize)
Pre-message hook for async input port productRequestIn.
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
bool isConnected_productSendOut_OutputPort(FwIndexType portNum)
FwIndexType getNum_productResponseOut_OutputPorts() const
virtual ~DpManagerComponentBase()
Destroy DpManagerComponentBase object.
@ CHANNELID_NUMSUCCESSFULALLOCATIONS
Channel ID for NumSuccessfulAllocations.
@ CHANNELID_NUMBYTES
Channel ID for NumBytes.
@ CHANNELID_NUMFAILEDALLOCATIONS
Channel ID for NumFailedAllocations.
@ CHANNELID_NUMDATAPRODUCTS
Channel ID for NumDataProducts.
FwIndexType getNum_productGetIn_InputPorts() const
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
Fw::InputDpSendPort * get_productSendIn_InputPort(FwIndexType portNum)
void CLEAR_EVENT_THROTTLE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
FwIndexType getNum_cmdResponseOut_OutputPorts() const
void tlmWrite_NumBytes(U64 arg, Fw::Time _tlmTime=Fw::Time())
void set_cmdRegIn_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegIn[portNum].
bool isConnected_eventOut_OutputPort(FwIndexType portNum)
void productRequestIn_handlerBase(FwIndexType portNum, FwDpIdType id, FwSizeType dataSize)
Handler base-class function for input port productRequestIn.
Fw::Success productGetIn_handlerBase(FwIndexType portNum, FwDpIdType id, FwSizeType dataSize, Fw::Buffer &buffer)
Handler base-class function for input port productGetIn.
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
FwIndexType getNum_eventOut_OutputPorts() const
Fw::Buffer bufferGetOut_out(FwIndexType portNum, U32 size)
Invoke output port bufferGetOut.
virtual void productRequestIn_handler(FwIndexType portNum, FwDpIdType id, FwSizeType dataSize)=0
Handler for input port productRequestIn.
void set_productResponseOut_OutputPort(FwIndexType portNum, Fw::InputDpResponsePort *port)
Connect port to productResponseOut[portNum].
bool isConnected_cmdRegIn_OutputPort(FwIndexType portNum)
virtual void CLEAR_EVENT_THROTTLE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
@ EVENTID_BUFFERALLOCATIONFAILED_THROTTLE
Throttle reset count for BufferAllocationFailed.
Fw::InputDpGetPort * get_productGetIn_InputPort(FwIndexType portNum)
virtual void productSendIn_handler(FwIndexType portNum, FwDpIdType id, const Fw::Buffer &buffer)=0
Handler for input port productSendIn.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void set_bufferGetOut_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferGetOut[portNum].
virtual void productSendIn_preMsgHook(FwIndexType portNum, FwDpIdType id, const Fw::Buffer &buffer)
Pre-message hook for async input port productSendIn.
void tlmWrite_NumFailedAllocations(U32 arg, Fw::Time _tlmTime=Fw::Time())
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
void productSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port productSendOut.
void productResponseOut_out(FwIndexType portNum, FwDpIdType id, const Fw::Buffer &buffer, const Fw::Success &status)
Invoke output port productResponseOut.
FwIndexType getNum_schedIn_InputPorts() const
void productSendIn_handlerBase(FwIndexType portNum, FwDpIdType id, const Fw::Buffer &buffer)
Handler base-class function for input port productSendIn.
FwIndexType getNum_productRequestIn_InputPorts() const
Fw::InputDpRequestPort * get_productRequestIn_InputPort(FwIndexType portNum)
FwIndexType getNum_bufferGetOut_OutputPorts() const
#define U64(C)
Definition sha.h:176