F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
BufferManagerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title BufferManagerComponentAc.hpp
3 // \author Auto-generated
4 // \brief hpp file for BufferManager 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 BUFFERMANAGER_COMP_HPP_
14 #define BUFFERMANAGER_COMP_HPP_
15 
16 #include <FpConfig.hpp>
20 #include <Os/Mutex.hpp>
21 #include <Fw/Tlm/TlmString.hpp>
22 #include <Fw/Time/TimePortAc.hpp>
23 #include <Fw/Log/LogString.hpp>
24 #include <Fw/Time/Time.hpp>
25 #include <Fw/Log/LogBuffer.hpp>
26 #include <Fw/Log/TextLogString.hpp>
27 #include <Fw/Tlm/TlmBuffer.hpp>
28 #include <Fw/Time/TimePortAc.hpp>
29 #include <Fw/Log/LogPortAc.hpp>
30 #if FW_ENABLE_TEXT_LOGGING == 1
31 #include <Fw/Log/LogTextPortAc.hpp>
32 #endif
35 #include <Fw/Tlm/TlmPortAc.hpp>
36 
37 namespace Svc {
38 
44  {
45 
46  // ----------------------------------------------------------------------
47  // Friend classes
48  // ----------------------------------------------------------------------
49 
53 
54  public:
55 
56  // ----------------------------------------------------------------------
57  // Getters for typed input ports
58  // ----------------------------------------------------------------------
59 
66  );
67 
74  );
75 
76  public:
77 
78  // ----------------------------------------------------------------------
79  // Connect typed input ports to typed output ports
80  // ----------------------------------------------------------------------
81 
86  Fw::InputTimePort *port
87  );
88 
93  Fw::InputLogPort *port
94  );
95 
96 #if FW_ENABLE_TEXT_LOGGING == 1
97  void set_textEventOut_OutputPort(
101  Fw::InputLogTextPort *port
102  );
103 #endif
104 
109  Fw::InputTlmPort *port
110  );
111 
112 #if FW_PORT_SERIALIZATION
113 
114  public:
115 
116  // ----------------------------------------------------------------------
117  // Connect serialization input ports to typed output ports
118  // ----------------------------------------------------------------------
119 
124  Fw::InputSerializePort *port
125  );
126 
131  Fw::InputSerializePort *port
132  );
133 
134 #if FW_ENABLE_TEXT_LOGGING == 1
135  void set_textEventOut_OutputPort(
139  Fw::InputSerializePort *port
140  );
141 #endif
142 
147  Fw::InputSerializePort *port
148  );
149 
150 #endif
151 
153 
154  // ----------------------------------------------------------------------
155  // Component construction, initialization, and destruction
156  // ----------------------------------------------------------------------
157 
158 #if FW_OBJECT_NAMES == 1
162  const char* compName
163  );
164 #else
168 #endif
169 
172  void init(
173  NATIVE_INT_TYPE instance = 0
174  );
175 
178  virtual ~BufferManagerComponentBase(void);
179 
181 
182  // ----------------------------------------------------------------------
184  // ----------------------------------------------------------------------
187  // ----------------------------------------------------------------------
188 
191  virtual void lock(void);
192 
195  virtual void unLock(void);
196 
198 
199  // ----------------------------------------------------------------------
200  // Handlers to implement for typed input ports
201  // ----------------------------------------------------------------------
202 
204  //
205  virtual void bufferSendIn_handler(
208  ) = 0;
209 
211  //
214  U32 size
215  ) = 0;
216 
218 
219  // ----------------------------------------------------------------------
220  // Port handler base-class functions for typed input ports.
221  // ----------------------------------------------------------------------
222  // Call these functions directly to bypass the corresponding ports.
223  // ----------------------------------------------------------------------
224 
227  void bufferSendIn_handlerBase(
230  );
231 
236  U32 size
237  );
238 
240 
241  // ----------------------------------------------------------------------
242  // Getters for numbers of input ports
243  // ----------------------------------------------------------------------
244 
249  NATIVE_INT_TYPE getNum_bufferSendIn_InputPorts(void);
250 
256 
257 
258  // ----------------------------------------------------------------------
259  // Enumerations for number of ports
260  // ----------------------------------------------------------------------
261 
262  enum {
265  };
266 
268 
269  // ----------------------------------------------------------------------
270  // Getters for numbers of output ports
271  // ----------------------------------------------------------------------
272 
277  NATIVE_INT_TYPE getNum_timeCaller_OutputPorts(void);
278 
284 
285 #if FW_ENABLE_TEXT_LOGGING == 1
286  NATIVE_INT_TYPE getNum_textEventOut_OutputPorts(void);
291 #endif
292 
298 
299 
300  enum {
305  };
306 
308 
309  // ----------------------------------------------------------------------
310  // Connection status queries for output ports
311  // ----------------------------------------------------------------------
312 
317  bool isConnected_timeCaller_OutputPort(
319  );
320 
327  );
328 
329 #if FW_ENABLE_TEXT_LOGGING == 1
330  bool isConnected_textEventOut_OutputPort(
336  );
337 #endif
338 
345  );
346 
348 
349  // ----------------------------------------------------------------------
350  // Event IDs
351  // ----------------------------------------------------------------------
352 
353  enum {
354  EVENTID_CLEAREDERRORSTATE = 0x00, /* The Buffer Manager has cleared its error state */
355  EVENTID_STORESIZEEXCEEDED = 0x01, /* The Buffer Manager received an allocation request that, if granted, would cause the storage buffer to overflow */
356  EVENTID_TOOMANYBUFFERS = 0x02, /* The Buffer Manager received an allocation request that, if granted, would result in too many buffers */
357  };
358 
360 
361  // ----------------------------------------------------------------------
362  // Event logging functions
363  // ----------------------------------------------------------------------
364 
367  /* The Buffer Manager has cleared its error state */
368  void log_ACTIVITY_HI_ClearedErrorState(
369  void
370  );
371 
372 
375  /* The Buffer Manager received an allocation request that, if granted, would cause the storage buffer to overflow */
377  void
378  );
379 
380 
383  /* The Buffer Manager received an allocation request that, if granted, would result in too many buffers */
385  void
386  );
387 
388 
390 
391  // ----------------------------------------------------------------------
392  // Channel IDs
393  // ----------------------------------------------------------------------
394 
395  enum {
396  CHANNELID_BUFFERMANAGER_NUMALLOCATEDBUFFERS = 0x00,
398  };
399 
400  PROTECTED:
401 
402  // ----------------------------------------------------------------------
403  // Telemetry write functions
404  // ----------------------------------------------------------------------
405 
408  /* The number of buffers currently allocated */
409  void tlmWrite_BufferManager_NumAllocatedBuffers(
410  U32 arg
411  );
412 
415  /* The total size of all allocated buffers */
417  U32 arg
418  );
419 
421 
422  // ----------------------------------------------------------------------
423  // Time
424  // ----------------------------------------------------------------------
425 
430  Fw::Time getTime(void);
431 
432 
434 
435  // ----------------------------------------------------------------------
436  // Typed input ports
437  // ----------------------------------------------------------------------
438 
441  Fw::InputBufferSendPort m_bufferSendIn_InputPort[NUM_BUFFERSENDIN_INPUT_PORTS];
442 
446 
448 
449  // ----------------------------------------------------------------------
450  // Typed output ports
451  // ----------------------------------------------------------------------
452 
455  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
456 
460 
461 #if FW_ENABLE_TEXT_LOGGING == 1
462  Fw::OutputLogTextPort m_textEventOut_OutputPort[NUM_TEXTEVENTOUT_OUTPUT_PORTS];
465 #endif
466 
470 
472 
473  // ----------------------------------------------------------------------
474  // Calls for messages received on typed input ports
475  // ----------------------------------------------------------------------
476 
479  static void m_p_bufferSendIn_in(
480  Fw::PassiveComponentBase* callComp,
483  );
484 
488  Fw::PassiveComponentBase* callComp,
490  U32 size
491  );
492 
494 
495  // ----------------------------------------------------------------------
496  // Mutexes
497  // ----------------------------------------------------------------------
498 
501  Os::Mutex m_guardedPortMutex;
502 
503 
504  PRIVATE:
505  // ----------------------------------------------------------------------
506  // Counter values for event throttling
507  // ----------------------------------------------------------------------
508 
509  };
510 
511 } // end namespace Svc
512 #endif
Fw::InputTimePort
Definition: TimePortAc.hpp:28
Svc::BufferManagerComponentBase::isConnected_eventOut_OutputPort
bool isConnected_eventOut_OutputPort(NATIVE_INT_TYPE portNum)
Definition: BufferManagerComponentAc.cpp:391
Fw::InputTlmPort
Definition: TlmPortAc.hpp:29
Svc::BufferManagerComponentBase::bufferGetCallee_handler
virtual Fw::Buffer bufferGetCallee_handler(NATIVE_INT_TYPE portNum, U32 size)=0
Handler for input port bufferGetCallee.
LogBuffer.hpp
PRIVATE
#define PRIVATE
overridable private for unit testing
Definition: BasicTypes.hpp:118
Fw::Time
Definition: Time.hpp:10
TlmPortAc.hpp
Fw::OutputTlmPort
Definition: TlmPortAc.hpp:50
Svc::BufferManagerComponentBase::m_bufferGetCallee_InputPort
Fw::InputBufferGetPort m_bufferGetCallee_InputPort[NUM_BUFFERGETCALLEE_INPUT_PORTS]
Definition: BufferManagerComponentAc.hpp:445
Svc::BufferManagerComponentBase::NUM_BUFFERGETCALLEE_INPUT_PORTS
@ NUM_BUFFERGETCALLEE_INPUT_PORTS
Definition: BufferManagerComponentAc.hpp:264
Svc::BufferManagerComponentBase
Auto-generated base for BufferManager component.
Definition: BufferManagerComponentAc.hpp:44
Svc::BufferManagerComponentBase::isConnected_tlmOut_OutputPort
bool isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE portNum)
Definition: BufferManagerComponentAc.cpp:413
TextLogString.hpp
Fw::Buffer
Definition: BufferSerializableAc.hpp:24
InputSerializePort.hpp
Svc::BufferManagerComponentBase::~BufferManagerComponentBase
virtual ~BufferManagerComponentBase(void)
Definition: BufferManagerComponentAc.cpp:314
Svc::BufferManagerComponentBase::NUM_EVENTOUT_OUTPUT_PORTS
@ NUM_EVENTOUT_OUTPUT_PORTS
Definition: BufferManagerComponentAc.hpp:302
Svc::BufferManagerComponentBase::CHANNELID_BUFFERMANAGER_ALLOCATEDSIZE
PROTECTED CHANNELID_BUFFERMANAGER_ALLOCATEDSIZE
Channel ID for BufferManager_AllocatedSize.
Definition: BufferManagerComponentAc.hpp:397
Fw::PassiveComponentBase
Definition: PassiveComponentBase.hpp:10
LogString.hpp
Fw::ObjBase::init
void init(void)
Object initializer.
Definition: ObjBase.cpp:26
Fw::OutputLogPort
Definition: LogPortAc.hpp:61
Svc::BufferManagerComponentBase::m_p_bufferGetCallee_in
static Fw::Buffer m_p_bufferGetCallee_in(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, U32 size)
Definition: BufferManagerComponentAc.cpp:775
Svc::BufferManagerComponentBase::get_bufferGetCallee_InputPort
Fw::InputBufferGetPort * get_bufferGetCallee_InputPort(NATIVE_INT_TYPE portNum)
Definition: BufferManagerComponentAc.cpp:36
ActiveComponentBase.hpp
Svc::BufferManagerComponentBase::set_timeCaller_OutputPort
void set_timeCaller_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Definition: BufferManagerComponentAc.cpp:47
Fw::InputBufferGetPort
Definition: BufferGetPortAc.hpp:28
TlmString.hpp
BufferGetPortAc.hpp
TlmBuffer.hpp
Os::Mutex
Definition: Mutex.hpp:8
Svc::BufferManagerComponentBase::unLock
virtual void unLock(void)
Definition: BufferManagerComponentAc.cpp:752
Svc::BufferManagerComponentBase::set_tlmOut_OutputPort
void set_tlmOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
Definition: BufferManagerComponentAc.cpp:79
Fw::InputBufferSendPort
Definition: BufferSendPortAc.hpp:28
Svc::BufferManagerComponentBase::getNum_tlmOut_OutputPorts
NATIVE_INT_TYPE getNum_tlmOut_OutputPorts(void)
Definition: BufferManagerComponentAc.cpp:369
Svc::BufferManagerComponentBase::getNum_eventOut_OutputPorts
NATIVE_INT_TYPE getNum_eventOut_OutputPorts(void)
Definition: BufferManagerComponentAc.cpp:335
LogTextPortAc.hpp
Svc::BufferManagerComponentBase::get_bufferSendIn_InputPort
Fw::InputBufferSendPort * get_bufferSendIn_InputPort(NATIVE_INT_TYPE portNum)
Definition: BufferManagerComponentAc.cpp:29
FpConfig.hpp
ISF configuration file.
Svc::BufferManagerComponentBase::NUM_BUFFERSENDIN_INPUT_PORTS
@ NUM_BUFFERSENDIN_INPUT_PORTS
Definition: BufferManagerComponentAc.hpp:263
Svc::BufferManagerComponentBase::PROTECTED
PROTECTED PROTECTED
Definition: BufferManagerComponentAc.hpp:357
Svc::BufferManagerComponentBase::set_eventOut_OutputPort
void set_eventOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Definition: BufferManagerComponentAc.cpp:57
Svc::BufferManagerComponentBase::bufferGetCallee_handlerBase
Fw::Buffer bufferGetCallee_handlerBase(NATIVE_INT_TYPE portNum, U32 size)
Definition: BufferManagerComponentAc.cpp:813
Svc::BufferManagerComponentBase::EVENTID_STORESIZEEXCEEDED
PROTECTED EVENTID_STORESIZEEXCEEDED
Definition: BufferManagerComponentAc.hpp:355
Svc::BufferManagerComponentBase::NUM_TLMOUT_OUTPUT_PORTS
@ NUM_TLMOUT_OUTPUT_PORTS
Definition: BufferManagerComponentAc.hpp:304
Svc
Definition: ActiveLoggerComponentAc.cpp:22
Svc::BufferManagerComponentBase::EVENTID_TOOMANYBUFFERS
PROTECTED EVENTID_TOOMANYBUFFERS
Definition: BufferManagerComponentAc.hpp:356
Svc::BufferManagerComponentBase::log_WARNING_HI_StoreSizeExceeded
void log_WARNING_HI_StoreSizeExceeded(void)
Definition: BufferManagerComponentAc.cpp:584
Svc::BufferManagerComponentBase::portNum
PRIVATE NATIVE_INT_TYPE portNum
Definition: BufferManagerComponentAc.hpp:481
Svc::BufferManagerComponentBase::log_WARNING_HI_TooManyBuffers
void log_WARNING_HI_TooManyBuffers(void)
Definition: BufferManagerComponentAc.cpp:663
Fw::InputLogPort
Definition: LogPortAc.hpp:40
Svc::BufferManagerComponentBase::m_eventOut_OutputPort
Fw::OutputLogPort m_eventOut_OutputPort[NUM_EVENTOUT_OUTPUT_PORTS]
Definition: BufferManagerComponentAc.hpp:459
Fw::OutputTimePort
Definition: TimePortAc.hpp:49
Svc::BufferManagerComponentBase::getNum_bufferGetCallee_InputPorts
NATIVE_INT_TYPE getNum_bufferGetCallee_InputPorts(void)
Definition: BufferManagerComponentAc.cpp:361
Svc::BufferManagerComponentBase::tlmWrite_BufferManager_AllocatedSize
void tlmWrite_BufferManager_AllocatedSize(U32 arg)
Definition: BufferManagerComponentAc.cpp:456
Mutex.hpp
Time.hpp
Svc::BufferManagerComponentBase::fwBuffer
PROTECTED Fw::Buffer & fwBuffer
Definition: BufferManagerComponentAc.hpp:208
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
OutputSerializePort.hpp
Svc::BufferManagerComponentBase::BufferManagerComponentBaseFriend
friend class BufferManagerComponentBaseFriend
Definition: BufferManagerComponentAc.hpp:52
Svc::BufferManagerComponentBase::m_tlmOut_OutputPort
Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS]
Definition: BufferManagerComponentAc.hpp:469
BufferSendPortAc.hpp
TimePortAc.hpp
LogPortAc.hpp
Fw::OutputLogTextPort
Definition: LogTextPortAc.hpp:61
Svc::BufferManagerComponentBase::NUM_TIMECALLER_OUTPUT_PORTS
@ NUM_TIMECALLER_OUTPUT_PORTS
Definition: BufferManagerComponentAc.hpp:301
Fw::InputLogTextPort
Definition: LogTextPortAc.hpp:40
Svc::BufferManagerComponentBase::NUM_TEXTEVENTOUT_OUTPUT_PORTS
@ NUM_TEXTEVENTOUT_OUTPUT_PORTS
Definition: BufferManagerComponentAc.hpp:303