F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Svc::BufferManager Class Reference

#include <Svc/BufferManager/BufferManager.hpp>

Inheritance diagram for Svc::BufferManager:
Svc::BufferManagerComponentBase Fw::PassiveComponentBase Fw::ObjBase

Classes

struct  Allocate
 
struct  Entry
 
struct  Free
 

Public Types

enum  Status { SUCCESS, FAILURE }
 
- Public Types inherited from Svc::BufferManagerComponentBase
enum  { NUM_BUFFERSENDIN_INPUT_PORTS = 1, NUM_BUFFERGETCALLEE_INPUT_PORTS = 1 }
 
enum  { NUM_TIMECALLER_OUTPUT_PORTS = 1, NUM_EVENTOUT_OUTPUT_PORTS = 1, NUM_TEXTEVENTOUT_OUTPUT_PORTS = 1, NUM_TLMOUT_OUTPUT_PORTS = 1 }
 

Public Member Functions

 Warnings (BufferManager &bufferManager)
 Construct a Warnings object. More...
 
void update (const Status::t status)
 Update the warning state. More...
 
 ~Store (void)
 
U32 getAllocatedSize (void) const
 
Status allocate (const U32 n, U8 *&result)
 
void free (const U32 size, U8 *const address)
 
 ~AllocationQueue (void)
 
U32 getAllocationSize (void) const
 
Allocate::Status allocate (const U32 size, U32 &id)
 
Free::Status free (const U32 expectedId, U32 &sawId, U32 &size)
 
U32 getNextIndex (const U32 index)
 
 BufferManager (const char *const compName, const U32 storeSize, const U32 maxNumBuffers)
 
void init (const NATIVE_INT_TYPE instance)
 
 ~BufferManager (void)
 
void bufferSendIn_handler (const NATIVE_INT_TYPE portNum, Fw::Buffer &buffer)
 
- Public Member Functions inherited from Svc::BufferManagerComponentBase
Fw::InputBufferSendPortget_bufferSendIn_InputPort (NATIVE_INT_TYPE portNum)
 
Fw::InputBufferGetPortget_bufferGetCallee_InputPort (NATIVE_INT_TYPE portNum)
 
void set_timeCaller_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
 
void set_eventOut_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
 
void set_tlmOut_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
 
void init (NATIVE_INT_TYPE instance=0)
 
virtual ~BufferManagerComponentBase (void)
 
virtual void unLock (void)
 
virtual Fw::Buffer bufferGetCallee_handler (NATIVE_INT_TYPE portNum, U32 size)=0
 Handler for input port bufferGetCallee. More...
 
Fw::Buffer bufferGetCallee_handlerBase (NATIVE_INT_TYPE portNum, U32 size)
 
NATIVE_INT_TYPE getNum_bufferGetCallee_InputPorts (void)
 
NATIVE_INT_TYPE getNum_eventOut_OutputPorts (void)
 
NATIVE_INT_TYPE getNum_tlmOut_OutputPorts (void)
 
bool isConnected_eventOut_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_tlmOut_OutputPort (NATIVE_INT_TYPE portNum)
 
void log_WARNING_HI_StoreSizeExceeded (void)
 
void log_WARNING_HI_TooManyBuffers (void)
 
void tlmWrite_BufferManager_AllocatedSize (U32 arg)
 
- Public Member Functions inherited from Fw::PassiveComponentBase
void setIdBase (const U32)
 Set the ID base. More...
 
U32 getIdBase (void) const
 
virtual ~PassiveComponentBase ()
 Destructor. More...
 
void init (NATIVE_INT_TYPE instance)
 Initialization function. More...
 
NATIVE_INT_TYPE getInstance (void) const
 

Public Attributes

PRIVATE __pad2__: BufferManager& bufferManager
 
State state
 The warning state. More...
 
PRIVATE __pad3__: class Store { public: Store( const U32 size )
 
PRIVATE __pad4__: const U32 totalSize
 
U8 *const memoryBase
 
U32 freeIndex
 Pointer to the first free byte of store memory. More...
 
U32 padSize
 The amount of padding at the end of the store, added to allocations that otherwise would wrap around. More...
 
U32 allocatedSize
 The total allocated size on the store. More...
 
PRIVATE __pad5__: class AllocationQueue { public: AllocationQueue(const U32 size)
 
PRIVATE __pad6__: U32 getNextId(void)
 
PRIVATE __pad7__: const U32 totalSize
 
Entry *const data
 
PRIVATE __pad8__: U32 nextId
 
U32 allocateIndex
 
U32 allocationSize
 
PRIVATE __pad9__: Fw::Buffer bufferGetCallee_handler( NATIVE_INT_TYPE portNum
 The port number. More...
 
PRIVATE U32 size
 
PRIVATE __pad10__: Warnings warnings
 
Store store
 The store. More...
 
AllocationQueue allocationQueue
 The allocation queue. More...
 
- Public Attributes inherited from Svc::BufferManagerComponentBase
PROTECTED __pad0__: BufferManagerComponentBase(void)
 
PROTECTED __pad1__: virtual void lock(void)
 
PROTECTED __pad2__: virtual void bufferSendIn_handler( NATIVE_INT_TYPE portNum
 
PROTECTED Fw::BufferfwBuffer = 0
 
PROTECTED __pad3__: void bufferSendIn_handlerBase( NATIVE_INT_TYPE portNum
 
PROTECTED __pad4__: NATIVE_INT_TYPE getNum_bufferSendIn_InputPorts(void)
 
PROTECTED __pad5__: NATIVE_INT_TYPE getNum_timeCaller_OutputPorts(void)
 
PROTECTED __pad6__: bool isConnected_timeCaller_OutputPort( NATIVE_INT_TYPE portNum )
 
PROTECTED __pad7__: enum { EVENTID_CLEAREDERRORSTATE = 0x00
 
PROTECTED EVENTID_STORESIZEEXCEEDED = 0x01
 
PROTECTED EVENTID_TOOMANYBUFFERS = 0x02
 
PROTECTED PROTECTED: void log_ACTIVITY_HI_ClearedErrorState( void )
 
PROTECTED __pad8__: enum { CHANNELID_BUFFERMANAGER_NUMALLOCATEDBUFFERS = 0x00
 Channel ID for BufferManager_NumAllocatedBuffers. More...
 
PROTECTED CHANNELID_BUFFERMANAGER_ALLOCATEDSIZE = 0x01
 Channel ID for BufferManager_AllocatedSize. More...
 
PROTECTED __pad9__: Fw::Time getTime(void)
 
PRIVATE __pad10__: Fw::InputBufferSendPort m_bufferSendIn_InputPort[NUM_BUFFERSENDIN_INPUT_PORTS]
 
Fw::InputBufferGetPort m_bufferGetCallee_InputPort [NUM_BUFFERGETCALLEE_INPUT_PORTS]
 
PRIVATE __pad11__: Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS]
 
Fw::OutputLogPort m_eventOut_OutputPort [NUM_EVENTOUT_OUTPUT_PORTS]
 
Fw::OutputTlmPort m_tlmOut_OutputPort [NUM_TLMOUT_OUTPUT_PORTS]
 
PRIVATE __pad12__: static void m_p_bufferSendIn_in( Fw::PassiveComponentBase* callComp
 
PRIVATE NATIVE_INT_TYPE portNum
 
PRIVATE NATIVE_INT_TYPE Fw::BufferfwBuffer
 
PRIVATE __pad13__: Os::Mutex m_guardedPortMutex
 
- Public Attributes inherited from Fw::PassiveComponentBase
PROTECTED __pad0__: PassiveComponentBase(const char* name)
 Named constructor. More...
 
PRIVATE __pad1__: U32 m_idBase
 ID base for opcodes etc. More...
 
NATIVE_INT_TYPE m_instance
 instance of component object More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Svc::BufferManagerComponentBase
static Fw::Buffer m_p_bufferGetCallee_in (Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, U32 size)
 
- Protected Member Functions inherited from Fw::ObjBase
 ObjBase (const char *name)
 ObjBase constructor. More...
 
virtual ~ObjBase ()
 Destructor. More...
 
void init (void)
 Object initializer. More...
 

Detailed Description

Definition at line 20 of file BufferManager.hpp.

Member Enumeration Documentation

◆ Status

Enumerator
SUCCESS 
FAILURE 

Definition at line 116 of file BufferManager.hpp.

Constructor & Destructor Documentation

◆ ~Store()

Svc::BufferManager::~Store ( void  )

◆ ~AllocationQueue()

Svc::BufferManager::~AllocationQueue ( void  )

◆ BufferManager()

Svc::BufferManager::BufferManager ( const char *const  compName,
const U32  storeSize,
const U32  maxNumBuffers 
)

Construct object BufferManager

Parameters
compNameThe component name

Definition at line 247 of file BufferManager.cpp.

◆ ~BufferManager()

Svc::BufferManager::~BufferManager ( void  )

Destroy object BufferManager

Definition at line 267 of file BufferManager.cpp.

Member Function Documentation

◆ allocate() [1/2]

Status Svc::BufferManager::allocate ( const U32  n,
U8 *&  result 
)

◆ allocate() [2/2]

Allocate::Status Svc::BufferManager::allocate ( const U32  size,
U32 &  id 
)

◆ bufferSendIn_handler()

void Svc::BufferManager::bufferSendIn_handler ( const NATIVE_INT_TYPE  portNum,
Fw::Buffer buffer 
)

Handler implementation for bufferSendIn

Parameters
portNumThe port number

Definition at line 316 of file BufferManager.cpp.

◆ free() [1/2]

Free::Status Svc::BufferManager::free ( const U32  expectedId,
U32 &  sawId,
U32 &  size 
)

◆ free() [2/2]

void Svc::BufferManager::free ( const U32  size,
U8 *const  address 
)
Parameters
sizeThe allocation size
addressThe allocation address

◆ getAllocatedSize()

U32 Svc::BufferManager::getAllocatedSize ( void  ) const

◆ getAllocationSize()

U32 Svc::BufferManager::getAllocationSize ( void  ) const

◆ getNextIndex()

U32 Svc::BufferManager::getNextIndex ( const U32  index)

◆ init()

void Svc::BufferManager::init ( const NATIVE_INT_TYPE  instance)

Initialize object BufferManager

Parameters
instanceThe instance number

Definition at line 261 of file BufferManager.cpp.

◆ update()

void Svc::BufferManager::update ( const Status::t  status)

Update the warning state.

Parameters
statusThe status

◆ Warnings()

Svc::BufferManager::Warnings ( BufferManager bufferManager)

Construct a Warnings object.

Parameters
bufferManagerThe enclosing BufferManager

Member Data Documentation

◆ __pad10__

PRIVATE Svc::BufferManager::__pad10__

Definition at line 329 of file BufferManager.hpp.

◆ __pad2__

PRIVATE Svc::BufferManager::__pad2__

Definition at line 78 of file BufferManager.hpp.

◆ __pad3__

PRIVATE Svc::BufferManager::__pad3__

Definition at line 88 of file BufferManager.hpp.

◆ __pad4__

PRIVATE Svc::BufferManager::__pad4__

Definition at line 139 of file BufferManager.hpp.

◆ __pad5__

PRIVATE Svc::BufferManager::__pad5__

Definition at line 166 of file BufferManager.hpp.

◆ __pad6__

PRIVATE Svc::BufferManager::__pad6__

Definition at line 241 of file BufferManager.hpp.

◆ __pad7__

PRIVATE Svc::BufferManager::__pad7__

Definition at line 253 of file BufferManager.hpp.

◆ __pad8__

PRIVATE Svc::BufferManager::__pad8__

Definition at line 265 of file BufferManager.hpp.

◆ __pad9__

PRIVATE Svc::BufferManager::__pad9__

The port number.

Definition at line 309 of file BufferManager.hpp.

◆ allocatedSize

U32 Svc::BufferManager::allocatedSize

The total allocated size on the store.

Definition at line 162 of file BufferManager.hpp.

◆ allocateIndex

U32 Svc::BufferManager::allocateIndex

Definition at line 275 of file BufferManager.hpp.

◆ allocationQueue

AllocationQueue Svc::BufferManager::allocationQueue

The allocation queue.

Definition at line 342 of file BufferManager.hpp.

◆ allocationSize

U32 Svc::BufferManager::allocationSize

Definition at line 281 of file BufferManager.hpp.

◆ data

Entry* const Svc::BufferManager::data

Definition at line 263 of file BufferManager.hpp.

◆ freeIndex

U32 Svc::BufferManager::freeIndex

Pointer to the first free byte of store memory.

Definition at line 156 of file BufferManager.hpp.

◆ memoryBase

U8* const Svc::BufferManager::memoryBase

Definition at line 149 of file BufferManager.hpp.

◆ padSize

U32 Svc::BufferManager::padSize

The amount of padding at the end of the store, added to allocations that otherwise would wrap around.

Definition at line 159 of file BufferManager.hpp.

◆ size

PRIVATE U32 Svc::BufferManager::size

Definition at line 319 of file BufferManager.hpp.

◆ state

State Svc::BufferManager::state

The warning state.

Definition at line 84 of file BufferManager.hpp.

◆ store

Store Svc::BufferManager::store

The store.

Definition at line 339 of file BufferManager.hpp.


The documentation for this class was generated from the following files: