Alchemy  1.0
A framework to robustly process network messages and structured data
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | List of all members
Hg::BitFieldVector< T, A > Struct Template Reference

Represents a set of fields that provide homogeneous bit-field access to each of the data values. More...

#include <bit_field_vector.h>

Inheritance diagram for Hg::BitFieldVector< T, A >:
Hg::vector_trait Hg::sequence_trait Hg::dynamic_size_trait Hg::nested_trait Hg::container_trait

Public Types

typedef A allocator_type
 The allocator used by this vector.
 
typedef user_bit_field_type bit_field_type
 The Hg type required to properly initialized nested structures to provide the natural bit-field syntax.
 
typedef vector_type::const_iterator const_iterator
 A const iterator to a value_type index.
 
typedef const bit_field_type const_reference
 Const Reference to an element in the vector.
 
typedef
vector_type::const_reverse_iterator 
const_reverse_iterator
 A const reverse iterator to a value_type index.
 
typedef vector_type::iterator iterator
 An iterator to a value_type index.
 
typedef bit_field_type reference
 Reference to an element in the vector.
 
typedef
vector_type::reverse_iterator 
reverse_iterator
 A reverse iterator to a value_type index.
 
typedef BitFieldVector< T, A > this_type
 An alias for this classes definition.
 
typedef T user_bit_field_type
 The type of bit-field interface defined by the user to access individual value entries in the vector.
 
typedef T::value_type value_type
 The data type managed by this vector. This is the type of data that will be written to the attached buffer.
 

Public Member Functions

 BitFieldVector ()
 Default Constructor.
 
 BitFieldVector (const BitFieldVector &rhs)
 Copy Constructor.
 
 ~BitFieldVector ()
 Destructor.
 
const_reference at (size_t idx) const
 Accesses the value at the specified index in the vector data..
 
reference at (size_t idx)
 Accesses the value at the specified index in the vector data..
 
const_reference back () const
 Accesses the last valid value in the vector data..
 
reference back ()
 Accesses the last valid value in the vector data..
 
iterator begin ()
 Returns an iterator to the first item in the vector.
 
void clear ()
 Erases every element in the vector.
 
const value_typedata () const
 Returns a pointer to the raw data buffer for the container for reference.
 
value_typedata ()
 Returns a pointer to the raw data buffer for the container for assignment.
 
size_t data_size () const
 Returns the number of bytes required to hold the entire vector of data.
 
bool empty () const
 Indicates if this container contains 0 elements.
 
iterator end ()
 Returns an iterator to the item one passed the end of the vector.
 
iterator erase (iterator pos)
 Removes the specified element from this container. More...
 
iterator erase (iterator first, iterator last)
 Removes the range of specified elements from this container. More...
 
const_reference front () const
 Accesses the first value in the vector data..
 
reference front ()
 Accesses the first value in the vector data..
 
 operator reference ()
 Conversion operator to the value_type reference. More...
 
 operator value_type () const
 Value Conversion Operator (value_type) More...
 
BitFieldVectoroperator= (const BitFieldVector &rhs)
 Assignment operator.
 
const_reference operator[] (size_t idx) const
 Accesses the value at the specified index in the vector data..
 
reference operator[] (size_t idx)
 Accesses the value at the specified index in the vector data..
 
void pop_back ()
 Removes the last element in the container. More...
 
void push_back (const vector_type &value)
 Removes the specified element from this container. More...
 
reverse_iterator rbegin ()
 Returns an iterator to the last item of the vector moving in reverse.
 
reverse_iterator rend ()
 Returns an iterator to the item one passed the beginning of the vector, moving in reverse.
 
void resize (size_t count)
 Changes the number of elements stored. More...
 
void resize (size_t count, value_type value)
 Changes the number of elements stored. More...
 
size_t size () const
 Returns the number of elements within the vector.
 
void swap (BitFieldVector &other)
 Exchanges the contents of this BitFieldVector container with those of other. This version does not invoke any move, copy, or swap operations on the individual elements. More...
 
void swap (value_type &other)
 Exchanges the contents of the container with those of other. This version does not invoke any move, copy, or swap operations on the individual elements. More...
 

Detailed Description

template<typename T, typename A = std::allocator<T>>
struct Hg::BitFieldVector< T, A >

Represents a set of fields that provide homogeneous bit-field access to each of the data values.

This object requires a Hg bit-field definition for the type definition of this object. The base integer type that is defined for the bit-field will be used to define the type for allocation of memory for the vector.

Each field allocated in the vector will accessible either by the base integer type or with the bit-field interface provided supplied to the definition.

Definition at line 49 of file bit_field_vector.h.

Member Function Documentation

template<typename T, typename A = std::allocator<T>>
iterator Hg::BitFieldVector< T, A >::erase ( iterator  pos)
inline

Removes the specified element from this container.

Parameters
posIterator that points to the element to be removed.
Returns
The iterator that follows the last item removed is returned.
Note
All iterators at or after this point of erasure will be invalidated.

Definition at line 359 of file bit_field_vector.h.

template<typename T, typename A = std::allocator<T>>
iterator Hg::BitFieldVector< T, A >::erase ( iterator  first,
iterator  last 
)
inline

Removes the range of specified elements from this container.

Parameters
firstIterator that points to the first element to be removed.
lastIterator that points to the last element to be removed.
Returns
The iterator that follows the last item removed is returned.
Note
All iterators at or after this point of erasure will be invalidated.

Definition at line 372 of file bit_field_vector.h.

template<typename T, typename A = std::allocator<T>>
Hg::BitFieldVector< T, A >::operator reference ( )
inline

Conversion operator to the value_type reference.

Note
The converted vector interface provides direct access values.

Definition at line 216 of file bit_field_vector.h.

template<typename T, typename A = std::allocator<T>>
Hg::BitFieldVector< T, A >::operator value_type ( ) const
inline

Value Conversion Operator (value_type)

Allows the entire BitSet to be extracted and assigned as a value to the host value type.

Definition at line 228 of file bit_field_vector.h.

template<typename T, typename A = std::allocator<T>>
void Hg::BitFieldVector< T, A >::pop_back ( )
inline

Removes the last element in the container.

Note
: Iterators that point to the last element and end will be invalidated after this call.

Definition at line 392 of file bit_field_vector.h.

template<typename T, typename A = std::allocator<T>>
void Hg::BitFieldVector< T, A >::push_back ( const vector_type &  value)
inline

Removes the specified element from this container.

Parameters
posIterator that points to the element to be removed.
Returns
The iterator that follows the last item removed is returned.
Note
All iterators at or after this point of erasure will be invalidated.

Definition at line 384 of file bit_field_vector.h.

template<typename T, typename A = std::allocator<T>>
void Hg::BitFieldVector< T, A >::resize ( size_t  count)
inline

Changes the number of elements stored.

Parameters
nThe number of elements the container should now hold.

Definition at line 199 of file bit_field_vector.h.

template<typename T, typename A = std::allocator<T>>
void Hg::BitFieldVector< T, A >::resize ( size_t  count,
value_type  value 
)
inline

Changes the number of elements stored.

Parameters
nThe number of elements the container should now hold.
valueDefault value to initialize elements if the resize causes new elements to be added to the container.

Definition at line 208 of file bit_field_vector.h.

template<typename T, typename A = std::allocator<T>>
void Hg::BitFieldVector< T, A >::swap ( BitFieldVector< T, A > &  other)
inline

Exchanges the contents of this BitFieldVector container with those of other. This version does not invoke any move, copy, or swap operations on the individual elements.

Iterators and references will remain valid, with the exception to the end iterators.

Parameters
otherThe other vector to swap elements.

Definition at line 407 of file bit_field_vector.h.

template<typename T, typename A = std::allocator<T>>
void Hg::BitFieldVector< T, A >::swap ( value_type other)
inline

Exchanges the contents of the container with those of other. This version does not invoke any move, copy, or swap operations on the individual elements.

Iterators and references will remain valid, with the exception to the end iterators.

Parameters
otherThe other vector to swap elements.

Definition at line 419 of file bit_field_vector.h.


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