WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
internal::basic_buffer< T > Class Template Referenceabstract

#include <core.h>

Inheritance diagram for internal::basic_buffer< T >:

Public Types

typedef T value_type
 
typedef const T & const_reference
 

Public Member Functions

virtual ~basic_buffer ()
 
T * begin () FMT_NOEXCEPT
 
T * end () FMT_NOEXCEPT
 
std::size_t size () const FMT_NOEXCEPT
 
std::size_t capacity () const FMT_NOEXCEPT
 
T * data () FMT_NOEXCEPT
 
const T * data () const FMT_NOEXCEPT
 
void resize (std::size_t new_size)
 
void clear ()
 
void reserve (std::size_t new_capacity)
 
void push_back (const T &value)
 
template<typename U >
void append (const U *begin, const U *end)
 
T & operator[] (std::size_t index)
 
const T & operator[] (std::size_t index) const
 

Protected Member Functions

 basic_buffer (std::size_t sz) FMT_NOEXCEPT
 
 basic_buffer (T *p=FMT_NULL, std::size_t sz=0, std::size_t cap=0) FMT_NOEXCEPT
 
void set (T *buf_data, std::size_t buf_capacity) FMT_NOEXCEPT
 
virtual void grow (std::size_t capacity)=0
 

Detailed Description

template<typename T>
class internal::basic_buffer< T >

A contiguous memory buffer with an optional growing ability.

Definition at line 215 of file core.h.

Member Typedef Documentation

◆ const_reference

template<typename T>
typedef const T& internal::basic_buffer< T >::const_reference

Definition at line 242 of file core.h.

◆ value_type

template<typename T>
typedef T internal::basic_buffer< T >::value_type

Definition at line 241 of file core.h.

Constructor & Destructor Documentation

◆ basic_buffer() [1/2]

template<typename T>
internal::basic_buffer< T >::basic_buffer ( std::size_t  sz)
inlineprotected

Definition at line 226 of file core.h.

◆ basic_buffer() [2/2]

template<typename T>
internal::basic_buffer< T >::basic_buffer ( T *  p = FMT_NULL,
std::size_t  sz = 0,
std::size_t  cap = 0 
)
inlineprotected

Definition at line 228 of file core.h.

◆ ~basic_buffer()

template<typename T>
virtual internal::basic_buffer< T >::~basic_buffer ( )
inlinevirtual

Definition at line 244 of file core.h.

Member Function Documentation

◆ append()

template<typename T >
template<typename U >
void internal::basic_buffer< T >::append ( const U *  begin,
const U *  end 
)

Appends data to the end of the buffer.

Definition at line 394 of file format.h.

Here is the caller graph for this function:

◆ begin()

template<typename T>
T* internal::basic_buffer< T >::begin ( )
inline

Definition at line 246 of file core.h.

Here is the caller graph for this function:

◆ capacity()

template<typename T>
std::size_t internal::basic_buffer< T >::capacity ( ) const
inline

Returns the capacity of this buffer.

Definition at line 253 of file core.h.

Here is the caller graph for this function:

◆ clear()

template<typename T>
void internal::basic_buffer< T >::clear ( )
inline

Clears this buffer.

Definition at line 270 of file core.h.

Here is the caller graph for this function:

◆ data() [1/2]

template<typename T>
T* internal::basic_buffer< T >::data ( )
inline

Returns a pointer to the buffer data.

Definition at line 256 of file core.h.

Here is the caller graph for this function:

◆ data() [2/2]

template<typename T>
const T* internal::basic_buffer< T >::data ( ) const
inline

Returns a pointer to the buffer data.

Definition at line 259 of file core.h.

◆ end()

template<typename T>
T* internal::basic_buffer< T >::end ( )
inline

Definition at line 247 of file core.h.

Here is the caller graph for this function:

◆ grow()

template<typename T>
virtual void internal::basic_buffer< T >::grow ( std::size_t  capacity)
protectedpure virtual

Increases the buffer capacity to hold at least capacity elements.

Implemented in basic_memory_buffer< T, SIZE, Allocator >, basic_memory_buffer< Char >, and internal::container_buffer< Container >.

◆ operator[]() [1/2]

template<typename T>
T& internal::basic_buffer< T >::operator[] ( std::size_t  index)
inline

Definition at line 287 of file core.h.

◆ operator[]() [2/2]

template<typename T>
const T& internal::basic_buffer< T >::operator[] ( std::size_t  index) const
inline

Definition at line 288 of file core.h.

◆ push_back()

template<typename T>
void internal::basic_buffer< T >::push_back ( const T &  value)
inline

Definition at line 278 of file core.h.

Here is the caller graph for this function:

◆ reserve()

template<typename T>
void internal::basic_buffer< T >::reserve ( std::size_t  new_capacity)
inline

Reserves space to store at least capacity elements.

Definition at line 273 of file core.h.

Here is the caller graph for this function:

◆ resize()

template<typename T>
void internal::basic_buffer< T >::resize ( std::size_t  new_size)
inline

Resizes the buffer. If T is a POD type new elements may not be initialized.

Definition at line 264 of file core.h.

Here is the caller graph for this function:

◆ set()

template<typename T>
void internal::basic_buffer< T >::set ( T *  buf_data,
std::size_t  buf_capacity 
)
inlineprotected

Sets the buffer data and capacity.

Definition at line 232 of file core.h.

Here is the caller graph for this function:

◆ size()

template<typename T>
std::size_t internal::basic_buffer< T >::size ( ) const
inline

Returns the size of this buffer.

Definition at line 250 of file core.h.

Here is the caller graph for this function:

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