FlowEngine  4.301
Photogrammetry Software Development Kit
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. More...
 
 ConstBuffer (const T *d, Size s)
 Creates a const buffer with a const pointer and a size. More...
 
template<std::size_t N>
 ConstBuffer (const T(&fixedSizeArray)[N])
 Implicit conversion from a fixed-size array. More...
 
 ConstBuffer (const std::vector< T > &v)
 Implicit conversion from a std::vector. More...
 
 ConstBuffer (std::vector< T > &&v)=delete
 Prohibits implicit conversion from a temporary std::vector. More...
 
 operator bool () const
 Evaluates to true if this buffer holds valid data, false otherwise. More...
 

Public Attributes

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

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

◆ operator bool()

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

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

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.