2.10.0
Freundlich's C++ toolkit
Classes | Public Types | Public Member Functions
fcppt::container::buffer::object< T, A > Class Template Reference

Detailed Description

template<typename T, typename A>
class fcppt::container::buffer::object< T, A >

A contiguous container for uninitialized data that contains a write and a read area.

Template Parameters
TMust be a POD type.
AThe allocator type.

See the module documentation for more information.

Public Types

typedef T value_type
 
typedef A allocator_type
 
typedef A::size_type size_type
 
typedef A::pointer pointer
 
typedef A::const_pointer const_pointer
 
typedef A::const_reference const_reference
 
typedef A::const_pointer const_iterator
 

Public Member Functions

 object (size_type write_sz, A a=A())
 Constructs an uninitialized buffer. More...
 
 object (object &&) noexcept
 
objectoperator= (object &&) noexcept
 
 ~object () noexcept
 
const_iterator begin () const noexcept
 The beginning of the read area. More...
 
const_iterator end () const noexcept
 The end of the read area. More...
 
const_reference operator[] (size_type) const noexcept
 The read area at a given position. More...
 
const_pointer read_data () const noexcept
 The beginning of the read area. More...
 
const_pointer read_data_end () const noexcept
 The end of the read area. More...
 
pointer write_data () noexcept
 The beginning of the write area. More...
 
pointer write_data_end () noexcept
 The end of the write area. More...
 
size_type read_size () const noexcept
 The size of the read area. More...
 
size_type write_size () const noexcept
 The size of the write area. More...
 
void written (size_type sz) noexcept
 Adds to the read area. More...
 
void resize_write_area (size_type sz)
 Resizes the write area. More...
 
allocator_type get_allocator () const
 
void swap (object &) noexcept
 
fcppt::container::raw_vector::rep< A > release () noexcept
 Releases the storage. More...
 

Member Typedef Documentation

◆ allocator_type

template<typename T , typename A >
typedef A fcppt::container::buffer::object< T, A >::allocator_type

◆ const_iterator

template<typename T , typename A >
typedef A::const_pointer fcppt::container::buffer::object< T, A >::const_iterator

◆ const_pointer

template<typename T , typename A >
typedef A::const_pointer fcppt::container::buffer::object< T, A >::const_pointer

◆ const_reference

template<typename T , typename A >
typedef A::const_reference fcppt::container::buffer::object< T, A >::const_reference

◆ pointer

template<typename T , typename A >
typedef A::pointer fcppt::container::buffer::object< T, A >::pointer

◆ size_type

template<typename T , typename A >
typedef A::size_type fcppt::container::buffer::object< T, A >::size_type

◆ value_type

template<typename T , typename A >
typedef T fcppt::container::buffer::object< T, A >::value_type

Constructor & Destructor Documentation

◆ object() [1/2]

template<typename T , typename A >
fcppt::container::buffer::object< T, A >::object ( size_type  write_sz,
a = A() 
)
explicit

Constructs an uninitialized buffer.

Constructs a buffer with a write area of size sz.

◆ object() [2/2]

template<typename T , typename A >
fcppt::container::buffer::object< T, A >::object ( object< T, A > &&  )
noexcept

◆ ~object()

template<typename T , typename A >
fcppt::container::buffer::object< T, A >::~object ( )
noexcept

Member Function Documentation

◆ begin()

template<typename T , typename A >
const_iterator fcppt::container::buffer::object< T, A >::begin ( ) const
noexcept

The beginning of the read area.

◆ end()

template<typename T , typename A >
const_iterator fcppt::container::buffer::object< T, A >::end ( ) const
noexcept

The end of the read area.

◆ get_allocator()

template<typename T , typename A >
allocator_type fcppt::container::buffer::object< T, A >::get_allocator ( ) const

◆ operator=()

template<typename T , typename A >
object& fcppt::container::buffer::object< T, A >::operator= ( object< T, A > &&  )
noexcept

◆ operator[]()

template<typename T , typename A >
const_reference fcppt::container::buffer::object< T, A >::operator[] ( size_type  ) const
noexcept

The read area at a given position.

◆ read_data()

template<typename T , typename A >
const_pointer fcppt::container::buffer::object< T, A >::read_data ( ) const
noexcept

The beginning of the read area.

◆ read_data_end()

template<typename T , typename A >
const_pointer fcppt::container::buffer::object< T, A >::read_data_end ( ) const
noexcept

The end of the read area.

◆ read_size()

template<typename T , typename A >
size_type fcppt::container::buffer::object< T, A >::read_size ( ) const
noexcept

The size of the read area.

◆ release()

template<typename T , typename A >
fcppt::container::raw_vector::rep< A > fcppt::container::buffer::object< T, A >::release ( )
noexcept

Releases the storage.

See also
fcppt::container::buffer::to_raw_vector

◆ resize_write_area()

template<typename T , typename A >
void fcppt::container::buffer::object< T, A >::resize_write_area ( size_type  sz)

Resizes the write area.

Sets the size of the write area to sz.

◆ swap()

template<typename T , typename A >
void fcppt::container::buffer::object< T, A >::swap ( object< T, A > &  )
noexcept

◆ write_data()

template<typename T , typename A >
pointer fcppt::container::buffer::object< T, A >::write_data ( )
noexcept

The beginning of the write area.

◆ write_data_end()

template<typename T , typename A >
pointer fcppt::container::buffer::object< T, A >::write_data_end ( )
noexcept

The end of the write area.

◆ write_size()

template<typename T , typename A >
size_type fcppt::container::buffer::object< T, A >::write_size ( ) const
noexcept

The size of the write area.

◆ written()

template<typename T , typename A >
void fcppt::container::buffer::object< T, A >::written ( size_type  sz)
noexcept

Adds to the read area.

Adds sz elements to the read area. This function should be called after data has been read into the write area.