FlowEngine 7.530
Photogrammetry Software Development Kit
Loading...
Searching...
No Matches
FlowEngine::ConstBuffer< T > Struct Template Reference

Holds a (non mutable) non_owning pointer and a count Used to marshal memory buffers as arguments in a safely manner. More...

#include <CommonDef.h>

Public Member Functions

 ConstBuffer ()=default
 Creates an empty buffer.
 
 ConstBuffer (const T *d, Size s)
 Creates a const buffer with a const pointer and a size.
 
template<std::size_t N>
 ConstBuffer (const T(&fixedSizeArray)[N])
 Implicit conversion from a fixed-size array.
 
 ConstBuffer (const std::vector< T > &v)
 Implicit conversion from a std::vector.
 
 ConstBuffer (std::vector< T > &&v)=delete
 Prohibits implicit conversion from a temporary std::vector.
 
 operator bool () const
 Evaluates to true if this buffer holds valid data, false otherwise.
 
const T * begin () const
 Iteration support.
 
const T * end () const
 Iteration support.
 
const T & operator[] (std::size_t index) const
 Indexed access.
 

Public Attributes

const T * data = nullptr
 Pointer to the (immutable) data.
 
Size count = 0
 Number of elements the pointer points to.
 

Detailed Description

template<typename T>
struct FlowEngine::ConstBuffer< T >

Holds a (non mutable) non_owning pointer and a count Used to marshal memory buffers as arguments in a safely manner.

Constructor & Destructor Documentation

◆ ConstBuffer() [1/5]

template<typename T >
FlowEngine::ConstBuffer< T >::ConstBuffer ( )
default

Creates an empty buffer.

◆ ConstBuffer() [2/5]

template<typename T >
FlowEngine::ConstBuffer< T >::ConstBuffer ( const T *  d,
Size  s 
)
inline

Creates a const buffer with a const pointer and a size.

◆ ConstBuffer() [3/5]

template<typename T >
template<std::size_t N>
FlowEngine::ConstBuffer< T >::ConstBuffer ( const T(&)  fixedSizeArray[N])
inline

Implicit conversion from a fixed-size array.

◆ ConstBuffer() [4/5]

template<typename T >
FlowEngine::ConstBuffer< T >::ConstBuffer ( const std::vector< T > &  v)
inline

Implicit conversion from a std::vector.

◆ ConstBuffer() [5/5]

template<typename T >
FlowEngine::ConstBuffer< T >::ConstBuffer ( std::vector< T > &&  v)
delete

Prohibits implicit conversion from a temporary std::vector.

Member Function Documentation

◆ begin()

template<typename T >
const T * FlowEngine::ConstBuffer< T >::begin ( ) const
inline

Iteration support.

◆ end()

template<typename T >
const T * FlowEngine::ConstBuffer< T >::end ( ) const
inline

Iteration support.

◆ operator bool()

template<typename T >
FlowEngine::ConstBuffer< T >::operator bool ( ) const
inlineexplicit

Evaluates to true if this buffer holds valid data, false otherwise.

◆ operator[]()

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

Indexed access.

Member Data Documentation

◆ count

template<typename T >
Size FlowEngine::ConstBuffer< T >::count = 0

Number of elements the pointer points to.

◆ data

template<typename T >
const T* FlowEngine::ConstBuffer< T >::data = nullptr

Pointer to the (immutable) data.