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

The Attachments element stores opaque data attached to a segment. More...

#include <tawara/attachments.h>

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

Public Types

typedef std::vector
< AttachedFile >::value_type 
value_type
 The value type of this container. More...
 
typedef std::vector
< AttachedFile >::size_type 
size_type
 The size type of this container. More...
 
typedef std::vector
< AttachedFile >::reference 
reference
 The reference type. More...
 
typedef std::vector
< AttachedFile >
::const_reference 
const_reference
 The constant reference type. More...
 
typedef std::vector
< AttachedFile >::iterator 
iterator
 The random access iterator type. More...
 
typedef std::vector
< AttachedFile >
::const_iterator 
const_iterator
 The constant random access iterator type. More...
 
typedef std::vector
< AttachedFile >
::reverse_iterator 
reverse_iterator
 The reversed random access iterator type. More...
 
typedef std::vector
< AttachedFile >
::const_reverse_iterator 
const_reverse_iterator
 The constant reversed random access iterator type. More...
 

Public Member Functions

 Attachments ()
 Constructor. More...
 
virtual value_typeat (size_type pos)
 Get the attachment at the given position, with bounds checking. More...
 
virtual value_type const & at (size_type pos) const
 Get the attachment at the given position, with bounds checking. More...
 
virtual value_typeoperator[] (size_type pos)
 Get a reference to an attachment. More...
 
virtual value_type const & operator[] (size_type pos) const
 Get a reference to an attachment. More...
 
virtual iterator begin ()
 Get an iterator to the first attachment. More...
 
virtual const_iterator begin () const
 Get an iterator to the first attachment. More...
 
virtual iterator end ()
 Get an iterator to the position past the last attachment. More...
 
virtual const_iterator end () const
 Get an iterator to the position past the last attachment. More...
 
virtual reverse_iterator rbegin ()
 Get a reverse iterator to the last attachment. More...
 
virtual const_reverse_iterator rbegin () const
 Get a reverse iterator to the last attachment. More...
 
virtual reverse_iterator rend ()
 Get a reverse iterator to the position before the first attachment. More...
 
virtual const_reverse_iterator rend () const
 Get a reverse iterator to the position before the first attachment. More...
 
virtual bool empty () const
 Check if there are no attachments. More...
 
virtual size_type count () const
 Get the number of attachments. More...
 
virtual size_type max_count () const
 Get the maximum number of attachments. More...
 
virtual void clear ()
 Remove all attachments. More...
 
virtual void erase (iterator position)
 Erase the attachment at the specified iterator. More...
 
virtual void erase (iterator first, iterator last)
 Erase a range of attachments. More...
 
virtual void push_back (value_type const &value)
 Add an attachment. More...
 
virtual void resize (size_type count)
 Resizes the attachments storage. More...
 
virtual void swap (Attachments &other)
 Swaps the contents of this Attachments element 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...
 
- 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< AttachedFilefiles_
 
- Protected Attributes inherited from tawara::Element
tawara::ids::ID id_
 
std::streampos offset_
 

Friends

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

Detailed Description

The Attachments element stores opaque data attached to a segment.

The Attachments element is used to store binary blobs that are attached to the segment. An attachment may contain any data at all. Because attachments can be linked to specific tracks, they are sometimes used for storing such things as the definition file (e.g. an IDL file) of the data type stored in the track, or a binary library containing a decoder for the track's codec.

Definition at line 185 of file attachments.h.

Member Typedef Documentation

The constant random access iterator type.

Definition at line 200 of file attachments.h.

The constant reference type.

Definition at line 196 of file attachments.h.

The constant reversed random access iterator type.

Definition at line 205 of file attachments.h.

The random access iterator type.

Definition at line 198 of file attachments.h.

The reference type.

Definition at line 194 of file attachments.h.

The reversed random access iterator type.

Definition at line 202 of file attachments.h.

The size type of this container.

Definition at line 192 of file attachments.h.

The value type of this container.

Definition at line 190 of file attachments.h.

Constructor & Destructor Documentation

tawara::Attachments::Attachments ( )

Constructor.

Member Function Documentation

virtual value_type& tawara::Attachments::at ( size_type  pos)
inlinevirtual

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

Returns
A reference to the specified attachment.
Exceptions
std::out_of_rangeif the position is invalid.

Definition at line 216 of file attachments.h.

virtual value_type const& tawara::Attachments::at ( size_type  pos) const
inlinevirtual

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

Returns
A reference to the specified attachment.
Exceptions
std::out_of_rangeif the position is invalid.

Definition at line 224 of file attachments.h.

virtual iterator tawara::Attachments::begin ( )
inlinevirtual

Get an iterator to the first attachment.

Definition at line 245 of file attachments.h.

virtual const_iterator tawara::Attachments::begin ( ) const
inlinevirtual

Get an iterator to the first attachment.

Definition at line 247 of file attachments.h.

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

Get the size of the body of this element.

Implements tawara::Element.

virtual void tawara::Attachments::clear ( )
inlinevirtual

Remove all attachments.

Definition at line 278 of file attachments.h.

virtual size_type tawara::Attachments::count ( ) const
inlinevirtual

Get the number of attachments.

Definition at line 273 of file attachments.h.

virtual bool tawara::Attachments::empty ( ) const
inlinevirtual

Check if there are no attachments.

An empty Attachments element may not occur in a Tawara file. If this returns true, an error will occur when write() is called.

Definition at line 271 of file attachments.h.

virtual iterator tawara::Attachments::end ( )
inlinevirtual

Get an iterator to the position past the last attachment.

Definition at line 249 of file attachments.h.

virtual const_iterator tawara::Attachments::end ( ) const
inlinevirtual

Get an iterator to the position past the last attachment.

Definition at line 251 of file attachments.h.

virtual void tawara::Attachments::erase ( iterator  position)
inlinevirtual

Erase the attachment at the specified iterator.

Parameters
[in]positionThe position to erase at.

Definition at line 284 of file attachments.h.

virtual void tawara::Attachments::erase ( iterator  first,
iterator  last 
)
inlinevirtual

Erase a range of attachments.

Parameters
[in]firstThe start of the range.
[in]lastThe end of the range.

Definition at line 290 of file attachments.h.

virtual size_type tawara::Attachments::max_count ( ) const
inlinevirtual

Get the maximum number of attachments.

Definition at line 275 of file attachments.h.

virtual value_type& tawara::Attachments::operator[] ( size_type  pos)
inlinevirtual

Get a reference to an attachment.

No bounds checking is performed.

Returns
A reference to the binary data of a attachment stored in this block.

Definition at line 233 of file attachments.h.

virtual value_type const& tawara::Attachments::operator[] ( size_type  pos) const
inlinevirtual

Get a reference to an attachment.

No bounds checking is performed.

Returns
A reference to the binary data of a attachment stored in this block.

Definition at line 241 of file attachments.h.

virtual void tawara::Attachments::push_back ( value_type const &  value)
inlinevirtual

Add an attachment.

Definition at line 294 of file attachments.h.

virtual reverse_iterator tawara::Attachments::rbegin ( )
inlinevirtual

Get a reverse iterator to the last attachment.

Definition at line 253 of file attachments.h.

virtual const_reverse_iterator tawara::Attachments::rbegin ( ) const
inlinevirtual

Get a reverse iterator to the last attachment.

Definition at line 255 of file attachments.h.

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

Element body loading.

Implements tawara::Element.

virtual reverse_iterator tawara::Attachments::rend ( )
inlinevirtual

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

Definition at line 260 of file attachments.h.

virtual const_reverse_iterator tawara::Attachments::rend ( ) const
inlinevirtual

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

Definition at line 264 of file attachments.h.

virtual void tawara::Attachments::resize ( size_type  count)
inlinevirtual

Resizes the attachments storage.

Definition at line 298 of file attachments.h.

virtual void tawara::Attachments::swap ( Attachments other)
inlinevirtual

Swaps the contents of this Attachments element with another.

Parameters
[in]otherThe other Attachments element

Definition at line 305 of file attachments.h.

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

Element body writing.

Implements tawara::Element.

Friends And Related Function Documentation

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

Equality operator.

Member Data Documentation

std::vector<AttachedFile> tawara::Attachments::files_
protected

Definition at line 312 of file attachments.h.


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