'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class template buffer_vla

odtone::buffer_vla

Synopsis

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

template<typename T> 
class buffer_vla : private odtone::buffer< uint8 > {
public:
  // construct/copy/destruct
  buffer_vla(const buffer_vla &);
  buffer_vla();
  buffer_vla(buffer_vla &&);
  buffer_vla(size_t);
  buffer_vla& operator=(const buffer_vla &);
  buffer_vla& operator=(buffer_vla &&);

  // private member functions
   ODTONE_STATIC_ASSERT(!boost::is_enum< T >::value &&boost::is_pod< T >::value &&boost::is_class< T >::value, 
                        "T must be a class/struct POD type");

  // public member functions
  void size(size_t);
  T & operator*();
  T * operator->();
  T * get();
  const T & operator*() const;
  const T * operator->() const;
  const T * get() const;
};

Description

A container (buffer) for 8-bit unsigned int data type with linear and finite sequence of elements.

buffer_vla public construct/copy/destruct

  1. buffer_vla(const buffer_vla &);
  2. buffer_vla();

    Construct an empty buffer. The created buffer will be empty and with zero length.

  3. buffer_vla(buffer_vla && buff);

    Construct a buffer. The new created buffer will be a copy of another buffer.

    Parameters:

    buff

    Buffer to copy.

  4. buffer_vla(size_t len);

    Construct an empty buffer. Although the created buffer is empty, it has the length defined at its creation.

    Parameters:

    len

    Number of elements the buffer can store.

  5. buffer_vla& operator=(const buffer_vla &);
  6. buffer_vla& operator=(buffer_vla && buff);

    Copy the elements from another buffer. The elements contained in the buffer will be overwrited.

    Parameters:

    buff

    The buffer from which to copy the elements.

    Returns:

    The reference to the buffer.

buffer_vla private member functions

  1.  ODTONE_STATIC_ASSERT(!boost::is_enum< T >::value &&boost::is_pod< T >::value &&boost::is_class< T >::value, 
                          "T must be a class/struct POD type");

buffer_vla public member functions

  1. void size(size_t len);

    Set the number of elements the buffer can store.

    Parameters:

    len

    The number of elements the buffer can store.

  2. T & operator*();

    Get the reference to the first element of the buffer.

    Returns:

    The reference to the first element of the buffer.

  3. T * operator->();

    Get the pointer to the first element of the buffer.

    Returns:

    The pointer to the first element of the buffer.

  4. T * get();

    Get the pointer to the first element of the buffer.

    Returns:

    The pointer to the first element of the buffer.

  5. const T & operator*() const;

    Get the reference to the first element of the buffer.

    Returns:

    The reference to the first element of the buffer.

  6. const T * operator->() const;

    Get the pointer to the first element of the buffer.

    Returns:

    The pointer to the first element of the buffer.

  7. const T * get() const;

    Get the pointer to the first element of the buffer.

    Returns:

    The pointer to the first element of the buffer.


PrevUpHomeNext