Tawara  0.1.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
tawara::BlockAdditions Class Reference

This element is used to specify reference blocks. More...

#include <tawara/block_additions.h>

Inheritance diagram for tawara::BlockAdditions:
Inheritance graph
[legend]
Collaboration diagram for tawara::BlockAdditions:
Collaboration graph
[legend]

Public Types

typedef std::pair< uint64_t,
std::vector< char > > 
Addition
 The type of a single block addition of data. More...
 
typedef boost::shared_ptr
< Addition
AdditionPtr
 A pointer to an addition. More...
 
typedef std::vector
< AdditionPtr >::value_type 
value_type
 The value type of this container. More...
 
typedef std::vector
< AdditionPtr >::size_type 
size_type
 The size type of this container. More...
 
typedef std::vector
< AdditionPtr >::reference 
reference
 The reference type. More...
 
typedef std::vector
< AdditionPtr >
::const_reference 
const_reference
 The constant reference type. More...
 
typedef std::vector
< AdditionPtr >::iterator 
iterator
 The random access iterator type. More...
 
typedef std::vector
< AdditionPtr >
::const_iterator 
const_iterator
 The constant random access iterator type. More...
 
typedef std::vector
< AdditionPtr >
::reverse_iterator 
reverse_iterator
 The reversed random access iterator type. More...
 
typedef std::vector
< AdditionPtr >
::const_reverse_iterator 
const_reverse_iterator
 The constant reversed random access iterator type. More...
 

Public Member Functions

 BlockAdditions ()
 Constructor. More...
 
value_typeat (size_type pos)
 Get the addition at the given position, with bounds checking. More...
 
value_type const & at (size_type pos) const
 Get the addition at the given position, with bounds checking. More...
 
value_typeoperator[] (size_type pos)
 Get a reference to an addition. More...
 
value_type const & operator[] (size_type pos) const
 Get a reference to an addition. More...
 
iterator begin ()
 Get an iterator to the first addition. More...
 
const_iterator begin () const
 Get an iterator to the first addition. More...
 
iterator end ()
 Get an iterator to the position past the last addition. More...
 
const_iterator end () const
 Get an iterator to the position past the last addition. More...
 
reverse_iterator rbegin ()
 Get a reverse iterator to the last addition. More...
 
const_reverse_iterator rbegin () const
 Get a reverse iterator to the last addition. More...
 
reverse_iterator rend ()
 Get a reverse iterator to the position before the first addition. More...
 
const_reverse_iterator rend () const
 Get a reverse iterator to the position before the first addition. More...
 
bool empty () const
 Check if there are no additions. More...
 
size_type count () const
 Get the number of additions. More...
 
size_type max_count () const
 Get the maximum number of additions. More...
 
void clear ()
 Remove all additions. More...
 
void erase (iterator position)
 Erase the addition at the specified iterator. More...
 
void erase (iterator first, iterator last)
 Erase a range of additions. More...
 
void push_back (value_type const &value)
 Add an addition to this block. More...
 
void resize (size_type count)
 Resizes the additions storage. More...
 
void swap (BlockAdditions &other)
 Swaps the contents of this BlockAdditions with another. More...
 
- Public Member Functions inherited from tawara::MasterElement
 MasterElement (uint32_t id, bool crc=false)
 Create a new MasterElement. More...
 
virtual ~MasterElement ()
 Destructor. More...
 
- Public Member Functions inherited from tawara::Element
 Element (tawara::ids::ID id)
 Create a new Element. More...
 
virtual ~Element ()
 Destructor. More...
 
uint32_t id () const
 Get the element's ID. More...
 
std::streampos offset () const
 Get the element's offset in the byte stream. More...
 
virtual std::streamsize size () const
 Get the total size of the element. More...
 
virtual std::streamsize write (std::ostream &output)
 Element writing. More...
 
virtual std::streamsize read (std::istream &input)
 Element reading. More...
 

Protected Member Functions

virtual std::streamsize body_size () const
 Get the size of the body of this element. More...
 
virtual std::streamsize write_body (std::ostream &output)
 Element body writing. More...
 
virtual std::streamsize read_body (std::istream &input, std::streamsize size)
 Element body loading. More...
 
std::streamsize read_addition (std::istream &input, std::streamsize size)
 Loading BlockMore elements. More...
 
- Protected Member Functions inherited from tawara::Element
std::streamsize write_id (std::ostream &output)
 Element ID writing. More...
 
virtual std::streamsize write_size (std::ostream &output)
 Element size writing. More...
 

Protected Attributes

std::vector< AdditionPtradditions_
 
- Protected Attributes inherited from tawara::Element
tawara::ids::ID id_
 
std::streampos offset_
 

Friends

bool operator== (BlockAdditions const &lhs, BlockAdditions const &rhs)
 Equality operator. More...
 

Detailed Description

This element is used to specify reference blocks.

When decoding a block requires data from other blocks, their IDs are listed using this element. It also contains private codec data that can be used in combination with the other blocks and the owning block.

Definition at line 60 of file block_additions.h.

Member Typedef Documentation

typedef std::pair<uint64_t, std::vector<char> > tawara::BlockAdditions::Addition

The type of a single block addition of data.

Definition at line 65 of file block_additions.h.

typedef boost::shared_ptr<Addition> tawara::BlockAdditions::AdditionPtr

A pointer to an addition.

Definition at line 67 of file block_additions.h.

The constant random access iterator type.

Definition at line 79 of file block_additions.h.

The constant reference type.

Definition at line 75 of file block_additions.h.

The constant reversed random access iterator type.

Definition at line 84 of file block_additions.h.

The random access iterator type.

Definition at line 77 of file block_additions.h.

The reference type.

Definition at line 73 of file block_additions.h.

The reversed random access iterator type.

Definition at line 81 of file block_additions.h.

The size type of this container.

Definition at line 71 of file block_additions.h.

The value type of this container.

Definition at line 69 of file block_additions.h.

Constructor & Destructor Documentation

tawara::BlockAdditions::BlockAdditions ( )

Constructor.

Member Function Documentation

value_type& tawara::BlockAdditions::at ( size_type  pos)
inline

Get the addition at the given position, with bounds checking.

Definition at line 92 of file block_additions.h.

value_type const& tawara::BlockAdditions::at ( size_type  pos) const
inline

Get the addition at the given position, with bounds checking.

Definition at line 97 of file block_additions.h.

iterator tawara::BlockAdditions::begin ( )
inline

Get an iterator to the first addition.

Definition at line 112 of file block_additions.h.

const_iterator tawara::BlockAdditions::begin ( ) const
inline

Get an iterator to the first addition.

Definition at line 114 of file block_additions.h.

virtual std::streamsize tawara::BlockAdditions::body_size ( ) const
protectedvirtual

Get the size of the body of this element.

Implements tawara::Element.

void tawara::BlockAdditions::clear ( )
inline

Remove all additions.

Definition at line 141 of file block_additions.h.

size_type tawara::BlockAdditions::count ( ) const
inline

Get the number of additions.

Definition at line 136 of file block_additions.h.

bool tawara::BlockAdditions::empty ( ) const
inline

Check if there are no additions.

Definition at line 134 of file block_additions.h.

iterator tawara::BlockAdditions::end ( )
inline

Get an iterator to the position past the last addition.

Definition at line 116 of file block_additions.h.

const_iterator tawara::BlockAdditions::end ( ) const
inline

Get an iterator to the position past the last addition.

Definition at line 118 of file block_additions.h.

void tawara::BlockAdditions::erase ( iterator  position)
inline

Erase the addition at the specified iterator.

Definition at line 144 of file block_additions.h.

void tawara::BlockAdditions::erase ( iterator  first,
iterator  last 
)
inline

Erase a range of additions.

Definition at line 147 of file block_additions.h.

size_type tawara::BlockAdditions::max_count ( ) const
inline

Get the maximum number of additions.

Definition at line 138 of file block_additions.h.

value_type& tawara::BlockAdditions::operator[] ( size_type  pos)
inline

Get a reference to an addition.

No bounds checking is performed.

Definition at line 103 of file block_additions.h.

value_type const& tawara::BlockAdditions::operator[] ( size_type  pos) const
inline

Get a reference to an addition.

No bounds checking is performed.

Definition at line 108 of file block_additions.h.

void tawara::BlockAdditions::push_back ( value_type const &  value)

Add an addition to this block.

reverse_iterator tawara::BlockAdditions::rbegin ( )
inline

Get a reverse iterator to the last addition.

Definition at line 120 of file block_additions.h.

const_reverse_iterator tawara::BlockAdditions::rbegin ( ) const
inline

Get a reverse iterator to the last addition.

Definition at line 122 of file block_additions.h.

std::streamsize tawara::BlockAdditions::read_addition ( std::istream &  input,
std::streamsize  size 
)
protected

Loading BlockMore elements.

virtual std::streamsize tawara::BlockAdditions::read_body ( std::istream &  input,
std::streamsize  size 
)
protectedvirtual

Element body loading.

Implements tawara::Element.

reverse_iterator tawara::BlockAdditions::rend ( )
inline

Get a reverse iterator to the position before the first addition.

Definition at line 127 of file block_additions.h.

const_reverse_iterator tawara::BlockAdditions::rend ( ) const
inline

Get a reverse iterator to the position before the first addition.

Definition at line 131 of file block_additions.h.

void tawara::BlockAdditions::resize ( size_type  count)
inline

Resizes the additions storage.

Definition at line 154 of file block_additions.h.

void tawara::BlockAdditions::swap ( BlockAdditions other)
inline

Swaps the contents of this BlockAdditions with another.

Definition at line 158 of file block_additions.h.

virtual std::streamsize tawara::BlockAdditions::write_body ( std::ostream &  output)
protectedvirtual

Element body writing.

Implements tawara::Element.

Friends And Related Function Documentation

bool operator== ( BlockAdditions const &  lhs,
BlockAdditions const &  rhs 
)
friend

Equality operator.

Member Data Documentation

std::vector<AdditionPtr> tawara::BlockAdditions::additions_
protected

Definition at line 166 of file block_additions.h.


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