Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

room_array< T > Class Template Reference

#include <number.h>

List of all members.

Public Member Functions

 room_array (size_t size, byte_allocator *allocator_=0)
 constructor
 room_array (const room_array< T > &src)
 copy constructor
room_array< T > & operator= (const room_array< T > &src)
 assigns operator
 ~room_array ()
 destructor
room_array< T > & operator>> (size_t shift)
 operator >> moves right n bytes
room_array< T > & operator<< (size_t shift)
 oparator << moves left n bytes
room_array< T > & resize (size_t size, bool clean=false)
 resizes internal buffer if required
room_array< T > & reserve (size_t size)
 allocates additional space if any preserving internal data
void swap (room_array &src)
 swaps bytes between arrays
 operator T * ()
 operator T*
 operator const T * () const
 operator const T*
size_t size () const
 retruns the size of buffer
room_array< T > & fill (const T &src, size_t len)
 fills out internal buffer
room_array< T > & copy (const T *src, size_t len)
 copies to internal buffer
void back (T *src, size_t len) const
 copies from internal buffer
room_array< T > & clear ()
 clears internal buffer
byte_allocatorget_allocator ()
 returns pointer to allocator

Private Types

enum  room_size { S = sizeof(T) }

Private Attributes

byte_allocator_allocator
 pointer to external allocator
T * _buffer
 internal buffer
size_t _size
 buffer size


Detailed Description

template<class T>
class room_array< T >

Definition at line 38 of file number.h.


Member Enumeration Documentation

template<class T>
enum room_array::room_size [private]

Enumerator:
S 

Definition at line 41 of file number.h.


Constructor & Destructor Documentation

template<class T>
BEGIN_TERIMBER_NAMESPACE room_array< T >::room_array ( size_t  size,
byte_allocator allocator_ = 0 
) [inline]

constructor

Parameters:
size  size
allocator_  external allocator

Definition at line 37 of file number.hpp.

References room_array< T >::_allocator, room_array< T >::_buffer, room_array< T >::_size, byte_allocator::allocate(), and room_array< T >::S.

template<class T>
room_array< T >::room_array ( const room_array< T > &  src  )  [inline]

copy constructor

Definition at line 45 of file number.hpp.

template<class T>
room_array< T >::~room_array (  )  [inline]

destructor

Definition at line 125 of file number.hpp.

References room_array< T >::clear().


Member Function Documentation

template<class T>
room_array< T > & room_array< T >::operator= ( const room_array< T > &  src  )  [inline]

assigns operator

Definition at line 109 of file number.hpp.

References room_array< T >::_buffer, room_array< T >::_size, room_array< T >::resize(), and room_array< T >::S.

template<class T>
room_array< T > & room_array< T >::operator>> ( size_t  shift  )  [inline]

operator >> moves right n bytes

Parameters:
shift  shift

Definition at line 54 of file number.hpp.

References room_array< T >::_buffer, room_array< T >::_size, and room_array< T >::S.

template<class T>
room_array< T > & room_array< T >::operator<< ( size_t  shift  )  [inline]

oparator << moves left n bytes

Parameters:
shift  shift

Definition at line 65 of file number.hpp.

References room_array< T >::_buffer, room_array< T >::_size, and room_array< T >::S.

template<class T>
room_array< T > & room_array< T >::resize ( size_t  size,
bool  clean = false 
) [inline]

resizes internal buffer if required

Parameters:
size  resize buffer
clean  preserve previous data or not

Definition at line 132 of file number.hpp.

References room_array< T >::_allocator, room_array< T >::_buffer, room_array< T >::_size, byte_allocator::allocate(), room_array< T >::clear(), and room_array< T >::S.

Referenced by room_array< T >::operator=(), and room_array< T >::reserve().

template<class T>
room_array< T > & room_array< T >::reserve ( size_t  size  )  [inline]

template<class T>
void room_array< T >::swap ( room_array< T > &  src  )  [inline]

swaps bytes between arrays

Parameters:
src  input array

Definition at line 76 of file number.hpp.

References room_array< T >::_allocator, room_array< T >::_buffer, and room_array< T >::_size.

template<class T>
room_array< T >::operator T * (  )  [inline]

operator T*

Definition at line 82 of file number.h.

template<class T>
room_array< T >::operator const T * (  )  const [inline]

operator const T*

Definition at line 87 of file number.h.

template<class T>
size_t room_array< T >::size (  )  const [inline]

template<class T>
room_array< T > & room_array< T >::fill ( const T &  src,
size_t  len 
) [inline]

fills out internal buffer

Parameters:
src  fill out buffer with src repeating n times
len  count

Definition at line 163 of file number.hpp.

References room_array< T >::_buffer, room_array< T >::_size, and room_array< T >::S.

template<class T>
room_array< T > & room_array< T >::copy ( const T *  src,
size_t  len 
) [inline]

copies to internal buffer

Parameters:
src  external buffer
len  buffer length

Definition at line 172 of file number.hpp.

References room_array< T >::_buffer, room_array< T >::_size, and room_array< T >::S.

Referenced by msg_communicator::init().

template<class T>
void room_array< T >::back ( T *  src,
size_t  len 
) const [inline]

copies from internal buffer

Parameters:
src  [out] preallocated external buffer
len  external buffer length

Definition at line 181 of file number.hpp.

References room_array< T >::_buffer, room_array< T >::_size, and room_array< T >::S.

template<class T>
room_array< T > & room_array< T >::clear (  )  [inline]

template<class T>
byte_allocator * room_array< T >::get_allocator (  )  [inline]

returns pointer to allocator

Definition at line 102 of file number.hpp.

References room_array< T >::_allocator.


Member Data Documentation

template<class T>
byte_allocator* room_array< T >::_allocator [private]


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


© Copyright Terimber 2003-.