Orocos Real-Time Toolkit  2.6.0
Public Types | Public Member Functions
RTT::internal::TsPool< T > Class Template Reference

A multi-reader multi-writer MemoryPool implementation. More...

#include <rtt/internal/TsPool.hpp>

List of all members.

Public Types

typedef T value_t
typedef unsigned int size_type

Public Member Functions

 TsPool (unsigned int ssize, const T &sample=T())
 Creates a fixed size memory pool holding ssize blocks of memory that can hold an object of class T.
void clear ()
 Clears all internal management data of this Memory Pool.
void data_sample (const T &sample)
 Initializes every element of the pool with the given sample and clears the pool.
value_t * allocate ()
bool deallocate (T *Value)
unsigned int size ()
 Return the number of elements that are available to be allocated.
unsigned int capacity ()
 The maximum number of elements available for allocation.

Detailed Description

template<typename T>
class RTT::internal::TsPool< T >

A multi-reader multi-writer MemoryPool implementation.

It can hold max 65535 elements of type T.

Definition at line 62 of file TsPool.hpp.


Member Function Documentation

template<typename T>
unsigned int RTT::internal::TsPool< T >::capacity ( ) [inline]

The maximum number of elements available for allocation.

Returns:
The maximum size.

Definition at line 222 of file TsPool.hpp.

template<typename T>
void RTT::internal::TsPool< T >::clear ( ) [inline]

Clears all internal management data of this Memory Pool.

All data blobs are considered to be owned by the pool again.

Definition at line 137 of file TsPool.hpp.

Referenced by RTT::internal::TsPool< Item >::data_sample().

template<typename T>
void RTT::internal::TsPool< T >::data_sample ( const T &  sample) [inline]

Initializes every element of the pool with the given sample and clears the pool.

Definition at line 153 of file TsPool.hpp.

Referenced by RTT::base::BufferLockFree< T >::BufferLockFree(), RTT::base::BufferLockFree< T >::data_sample(), and RTT::internal::TsPool< Item >::TsPool().

template<typename T>
unsigned int RTT::internal::TsPool< T >::size ( ) [inline]

Return the number of elements that are available to be allocated.

This function is not thread-safe and should not be used when concurrent allocate()/deallocate() functions are running.

Returns:
the number of elements left to allocate.

Definition at line 205 of file TsPool.hpp.


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