F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
TlmChanComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TlmChanComponentAc.hpp
3 // \author Auto-generated
4 // \brief hpp file for TlmChan 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 TLMCHAN_COMP_HPP_
14 #define TLMCHAN_COMP_HPP_
15 
16 #include <FpConfig.hpp>
20 #include <Os/Mutex.hpp>
21 #include <Fw/Tlm/TlmBuffer.hpp>
22 #include <Fw/Time/Time.hpp>
23 #include <Fw/Com/ComBuffer.hpp>
24 #include <Fw/Tlm/TlmPortAc.hpp>
25 #include <Fw/Com/ComPortAc.hpp>
27 #include <Svc/Ping/PingPortAc.hpp>
28 
29 namespace Svc {
30 
36  {
37 
38  // ----------------------------------------------------------------------
39  // Friend classes
40  // ----------------------------------------------------------------------
41 
45 
46  public:
47 
48  // ----------------------------------------------------------------------
49  // Getters for typed input ports
50  // ----------------------------------------------------------------------
51 
58  );
59 
66  );
67 
74  );
75 
82  );
83 
84  public:
85 
86  // ----------------------------------------------------------------------
87  // Connect typed input ports to typed output ports
88  // ----------------------------------------------------------------------
89 
94  Fw::InputComPort *port
95  );
96 
101  Svc::InputPingPort *port
102  );
103 
104 #if FW_PORT_SERIALIZATION
105 
106  public:
107 
108  // ----------------------------------------------------------------------
109  // Connect serialization input ports to typed output ports
110  // ----------------------------------------------------------------------
111 
116  Fw::InputSerializePort *port
117  );
118 
123  Fw::InputSerializePort *port
124  );
125 
126 #endif
127 
129 
130  // ----------------------------------------------------------------------
131  // Component construction, initialization, and destruction
132  // ----------------------------------------------------------------------
133 
134 #if FW_OBJECT_NAMES == 1
138  const char* compName
139  );
140 #else
141  TlmChanComponentBase(void);
144 #endif
145 
148  void init(
149  NATIVE_INT_TYPE queueDepth,
150  NATIVE_INT_TYPE instance = 0
151  );
152 
155  virtual ~TlmChanComponentBase(void);
156 
158 
159  // ----------------------------------------------------------------------
161  // ----------------------------------------------------------------------
164  // ----------------------------------------------------------------------
165 
168  virtual void lock(void);
169 
172  virtual void unLock(void);
173 
175 
176  // ----------------------------------------------------------------------
177  // Handlers to implement for typed input ports
178  // ----------------------------------------------------------------------
179 
181  //
182  virtual void TlmRecv_handler(
187  ) = 0;
188 
190  //
191  virtual void TlmGet_handler(
193  FwChanIdType id,
194  Fw::Time &timeTag,
196  ) = 0;
197 
199  //
200  virtual void Run_handler(
203  ) = 0;
204 
206  //
207  virtual void pingIn_handler(
209  U32 key
210  ) = 0;
211 
213 
214  // ----------------------------------------------------------------------
215  // Port handler base-class functions for typed input ports.
216  // ----------------------------------------------------------------------
217  // Call these functions directly to bypass the corresponding ports.
218  // ----------------------------------------------------------------------
219 
222  void TlmRecv_handlerBase(
224  FwChanIdType id,
225  Fw::Time &timeTag,
227  );
228 
231  void TlmGet_handlerBase(
233  FwChanIdType id,
234  Fw::Time &timeTag,
236  );
237 
240  void Run_handlerBase(
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 Run_preMsgHook(
267  );
268 
271  virtual void pingIn_preMsgHook(
273  U32 key
274  );
275 
277 
278  // ----------------------------------------------------------------------
279  // Invocation functions for typed output ports
280  // ----------------------------------------------------------------------
281 
284  void PktSend_out(
287  U32 context
288  );
289 
292  void pingOut_out(
294  U32 key
295  );
296 
298 
299  // ----------------------------------------------------------------------
300  // Getters for numbers of input ports
301  // ----------------------------------------------------------------------
302 
307  NATIVE_INT_TYPE getNum_TlmRecv_InputPorts(void);
308 
314 
320 
326 
327 
328  // ----------------------------------------------------------------------
329  // Enumerations for number of ports
330  // ----------------------------------------------------------------------
331 
332  enum {
337  };
338 
340 
341  // ----------------------------------------------------------------------
342  // Getters for numbers of output ports
343  // ----------------------------------------------------------------------
344 
349  NATIVE_INT_TYPE getNum_PktSend_OutputPorts(void);
350 
356 
357 
358  enum {
361  };
362 
364 
365  // ----------------------------------------------------------------------
366  // Connection status queries for output ports
367  // ----------------------------------------------------------------------
368 
373  bool isConnected_PktSend_OutputPort(
375  );
376 
383  );
384 
386 
387  // ----------------------------------------------------------------------
388  // Event logging functions
389  // ----------------------------------------------------------------------
390 
391 
392  PRIVATE:
393 
394  // ----------------------------------------------------------------------
395  // Typed input ports
396  // ----------------------------------------------------------------------
397 
400  Fw::InputTlmPort m_TlmRecv_InputPort[NUM_TLMRECV_INPUT_PORTS];
401 
405 
409 
413 
415 
416  // ----------------------------------------------------------------------
417  // Typed output ports
418  // ----------------------------------------------------------------------
419 
422  Fw::OutputComPort m_PktSend_OutputPort[NUM_PKTSEND_OUTPUT_PORTS];
423 
427 
429 
430  // ----------------------------------------------------------------------
431  // Calls for messages received on typed input ports
432  // ----------------------------------------------------------------------
433 
436  static void m_p_TlmRecv_in(
437  Fw::PassiveComponentBase* callComp,
442  );
443 
446  static void m_p_TlmGet_in(
447  Fw::PassiveComponentBase* callComp,
449  FwChanIdType id,
450  Fw::Time &timeTag,
452  );
453 
456  static void m_p_Run_in(
457  Fw::PassiveComponentBase* callComp,
460  );
461 
464  static void m_p_pingIn_in(
465  Fw::PassiveComponentBase* callComp,
467  U32 key
468  );
469 
471 
472  // ----------------------------------------------------------------------
473  // Message dispatch functions
474  // ----------------------------------------------------------------------
475 
478  virtual MsgDispatchStatus doDispatch(void);
479 
481 
482  // ----------------------------------------------------------------------
483  // Mutexes
484  // ----------------------------------------------------------------------
485 
488  Os::Mutex m_guardedPortMutex;
489 
490 
491 
492  };
493 
494 } // end namespace Svc
495 #endif
Svc::TlmChanComponentBase::m_Run_InputPort
Svc::InputSchedPort m_Run_InputPort[NUM_RUN_INPUT_PORTS]
Definition: TlmChanComponentAc.hpp:408
Svc::TlmChanComponentBase::Run_handler
virtual void Run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)=0
Handler for input port Run.
Fw::InputTlmPort
Definition: TlmPortAc.hpp:29
Svc::TlmChanComponentBase::m_p_Run_in
static void m_p_Run_in(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Definition: TlmChanComponentAc.cpp:512
Svc::TlmChanComponentBase::set_PktSend_OutputPort
void set_PktSend_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputComPort *port)
Definition: TlmChanComponentAc.cpp:117
Svc::TlmChanComponentBase::NUM_RUN_INPUT_PORTS
@ NUM_RUN_INPUT_PORTS
Definition: TlmChanComponentAc.hpp:335
PRIVATE
#define PRIVATE
overridable private for unit testing
Definition: BasicTypes.hpp:118
Fw::Time
Definition: Time.hpp:10
TlmPortAc.hpp
Fw::QueuedComponentBase::doDispatch
virtual MsgDispatchStatus doDispatch(void)=0
method to dispatch a single message in the queue.
Fw::TlmBuffer
Definition: TlmBuffer.hpp:21
FwChanIdType
#define FwChanIdType
Type representation for a channel id.
Definition: FpConfig.hpp:66
Svc::TlmChanComponentBase::getNum_TlmGet_InputPorts
NATIVE_INT_TYPE getNum_TlmGet_InputPorts(void)
Definition: TlmChanComponentAc.cpp:402
Svc::TlmChanComponentBase::NUM_PINGOUT_OUTPUT_PORTS
@ NUM_PINGOUT_OUTPUT_PORTS
Definition: TlmChanComponentAc.hpp:360
Svc::TlmChanComponentBase::get_TlmGet_InputPort
Fw::InputTlmPort * get_TlmGet_InputPort(NATIVE_INT_TYPE portNum)
Definition: TlmChanComponentAc.cpp:92
Svc::TlmChanComponentBase::NUM_TLMRECV_INPUT_PORTS
@ NUM_TLMRECV_INPUT_PORTS
Definition: TlmChanComponentAc.hpp:333
Svc::TlmChanComponentBase::data
PROTECTED Fw::ComBuffer & data
Definition: TlmChanComponentAc.hpp:286
Svc::TlmChanComponentBase::pingIn_handler
virtual void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key)=0
Handler for input port pingIn.
ComBuffer.hpp
Svc::TlmChanComponentBase::m_pingOut_OutputPort
Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS]
Definition: TlmChanComponentAc.hpp:426
Svc::TlmChanComponentBase::set_pingOut_OutputPort
void set_pingOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
Definition: TlmChanComponentAc.cpp:127
Svc::TlmChanComponentBase::timeTag
PROTECTED FwChanIdType Fw::Time & timeTag
Definition: TlmChanComponentAc.hpp:185
PROTECTED
#define PROTECTED
overridable protected for unit testing
Definition: BasicTypes.hpp:114
InputSerializePort.hpp
Svc::TlmChanComponentBase::m_p_TlmGet_in
static void m_p_TlmGet_in(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Definition: TlmChanComponentAc.cpp:499
Svc::TlmChanComponentBase::portNum
PRIVATE NATIVE_INT_TYPE portNum
Definition: TlmChanComponentAc.hpp:438
Svc::TlmChanComponentBase::context
PROTECTED NATIVE_UINT_TYPE context
Definition: TlmChanComponentAc.hpp:267
Svc::TlmChanComponentBase::get_TlmRecv_InputPort
Fw::InputTlmPort * get_TlmRecv_InputPort(NATIVE_INT_TYPE portNum)
Definition: TlmChanComponentAc.cpp:85
ComPortAc.hpp
Fw::InputComPort
Definition: ComPortAc.hpp:28
Svc::TlmChanComponentBase::NUM_PINGIN_INPUT_PORTS
@ NUM_PINGIN_INPUT_PORTS
Definition: TlmChanComponentAc.hpp:336
Fw::PassiveComponentBase
Definition: PassiveComponentBase.hpp:10
Fw::ObjBase::init
void init(void)
Object initializer.
Definition: ObjBase.cpp:26
Svc::TlmChanComponentBase::pingIn_preMsgHook
virtual void pingIn_preMsgHook(NATIVE_INT_TYPE portNum, U32 key)
Definition: TlmChanComponentAc.cpp:703
Svc::TlmChanComponentBase::NUM_TLMGET_INPUT_PORTS
@ NUM_TLMGET_INPUT_PORTS
Definition: TlmChanComponentAc.hpp:334
Svc::TlmChanComponentBase::m_pingIn_InputPort
Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS]
Definition: TlmChanComponentAc.hpp:412
Svc::InputPingPort
Definition: PingPortAc.hpp:27
ActiveComponentBase.hpp
Svc::OutputPingPort
Definition: PingPortAc.hpp:48
Svc::InputSchedPort
Definition: SchedPortAc.hpp:27
Svc::TlmChanComponentBase::get_Run_InputPort
Svc::InputSchedPort * get_Run_InputPort(NATIVE_INT_TYPE portNum)
Definition: TlmChanComponentAc.cpp:99
TlmBuffer.hpp
Os::Mutex
Definition: Mutex.hpp:8
Fw::QueuedComponentBase::MsgDispatchStatus
MsgDispatchStatus
Definition: QueuedComponentBase.hpp:25
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
PingPortAc.hpp
Svc::TlmChanComponentBase::getNum_pingIn_InputPorts
NATIVE_INT_TYPE getNum_pingIn_InputPorts(void)
Definition: TlmChanComponentAc.cpp:426
Svc::TlmChanComponentBase
Auto-generated base for TlmChan component.
Definition: TlmChanComponentAc.hpp:36
Fw::OutputComPort
Definition: ComPortAc.hpp:49
Fw::ActiveComponentBase
Definition: ActiveComponentBase.hpp:20
Svc::TlmChanComponentBase::val
PROTECTED FwChanIdType Fw::Time Fw::TlmBuffer & val
Definition: TlmChanComponentAc.hpp:187
Svc::TlmChanComponentBase::TlmChanComponentBaseFriend
friend class TlmChanComponentBaseFriend
Definition: TlmChanComponentAc.hpp:44
Svc::TlmChanComponentBase::m_TlmGet_InputPort
Fw::InputTlmPort m_TlmGet_InputPort[NUM_TLMGET_INPUT_PORTS]
Definition: TlmChanComponentAc.hpp:404
Svc::TlmChanComponentBase::Run_handlerBase
void Run_handlerBase(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Definition: TlmChanComponentAc.cpp:584
Svc::TlmChanComponentBase::pingIn_handlerBase
void pingIn_handlerBase(NATIVE_INT_TYPE portNum, U32 key)
Definition: TlmChanComponentAc.cpp:637
Svc::TlmChanComponentBase::get_pingIn_InputPort
Svc::InputPingPort * get_pingIn_InputPort(NATIVE_INT_TYPE portNum)
Definition: TlmChanComponentAc.cpp:106
FpConfig.hpp
ISF configuration file.
Svc::TlmChanComponentBase::TlmGet_handlerBase
void TlmGet_handlerBase(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Definition: TlmChanComponentAc.cpp:563
Svc::TlmChanComponentBase::isConnected_pingOut_OutputPort
bool isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
Definition: TlmChanComponentAc.cpp:456
Svc::TlmChanComponentBase::~TlmChanComponentBase
virtual ~TlmChanComponentBase(void)
Definition: TlmChanComponentAc.cpp:361
Svc::TlmChanComponentBase::m_p_pingIn_in
static void m_p_pingIn_in(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, U32 key)
Definition: TlmChanComponentAc.cpp:525
Svc
Definition: ActiveLoggerComponentAc.cpp:22
SchedPortAc.hpp
Svc::TlmChanComponentBase::NUM_PKTSEND_OUTPUT_PORTS
@ NUM_PKTSEND_OUTPUT_PORTS
Definition: TlmChanComponentAc.hpp:359
Svc::TlmChanComponentBase::getNum_pingOut_OutputPorts
NATIVE_INT_TYPE getNum_pingOut_OutputPorts(void)
Definition: TlmChanComponentAc.cpp:434
Svc::TlmChanComponentBase::getNum_Run_InputPorts
NATIVE_INT_TYPE getNum_Run_InputPorts(void)
Definition: TlmChanComponentAc.cpp:410
Svc::TlmChanComponentBase::TlmGet_handler
virtual void TlmGet_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmGet.
Svc::TlmChanComponentBase::unLock
virtual void unLock(void)
Definition: TlmChanComponentAc.cpp:476
Mutex.hpp
Time.hpp
Svc::TlmChanComponentBase::pingOut_out
void pingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Definition: TlmChanComponentAc.cpp:380
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
Fw::ComBuffer
Definition: ComBuffer.hpp:21
OutputSerializePort.hpp