'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class archive

odtone::mih::archive

Synopsis

// In header: </home/carlos/Projectos/odtone/inc/odtone/mih/archive.hpp>


class archive {
public:
  // types
  typedef std::vector< uint8 >::const_iterator const_iterator;

  // construct/copy/destruct
  archive();
  ~archive();

  // public member functions
  void clear();
  void swap(std::vector< uint8 > &);
  void buffer(const uint8 *, size_t);
  template<typename InputIteratorT> 
    void append(InputIteratorT, InputIteratorT);
  const_iterator begin() const;
  const_iterator end() const;
  std::vector< uint8 > & buffer();
  iarchive input();
  oarchive output();
  void position(uint);
  uint position() const;
};

Description

Provides serialization/deserialization for the message payload.

archive public construct/copy/destruct

  1. archive();

    Construct an archive.

  2. ~archive();

    Destruct an archive.

archive public member functions

  1. void clear();

    Clear the contents of the archive. Its size and actual position is set to 0 (zero).

  2. void swap(std::vector< uint8 > & buffer);

    Exchanges the content of the archive by the content of buffer, which can have different sizes. All iterators, references and pointers remain valid for the swapped vectors.

    Parameters:

    buffer

    A vector providing the elements to be swapped.

  3. void buffer(const uint8 * buf, size_t len);

    Fills archive's contents.

    Parameters:

    buf

    The elements to be copied to the archive.

    len

    The number of elements to be copied.

  4. template<typename InputIteratorT> 
      void append(InputIteratorT begin, InputIteratorT end);

    Inserts an element, a number of elements or a range of elements into the archive at a specified position.

    Parameters:

    begin

    The position of the first element to be copied.

    end

    The position of the last element to be copied.

  5. const_iterator begin() const;

    A random-access iterator addressing the first element in the archive or to the location succeeding an empty archive. The iterator should always be compared with vector::end to ensure it is valid.

    Returns:

    A random-access iterator to the first element in the container.

  6. const_iterator end() const;

    A random-access iterator to the end of the archive object. If the archive is empty, vector::end == vector::begin.

    Returns:

    A random-access iterator that points just beyond the end of the archive.

  7. std::vector< uint8 > & buffer();

    Get archive's contents.

    Returns:

    The archive's contents.

  8. iarchive input();

    Get the corresponding input archive.

    Returns:

    The input archive.

  9. oarchive output();

    Get the corresponding output archive.

    Returns:

    The output archive.

  10. void position(uint pos);

    Point to a new position in the archive.

    Parameters:

    pos

    The new position in the archive where to point.

  11. uint position() const;

    Get the current position in the archive.

    Returns:

    The current position in the archive.


PrevUpHomeNext