FlowEngine  4.301
Photogrammetry Software Development Kit
FlowEngine::Buffer< T > Struct Template Reference

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

#include <CommonDef.h>

Public Member Functions

 Buffer ()=default
 Represents an empty buffer. More...
 
 Buffer (T *d, Size s)
 Construct a buffer from a (mutable) pointer and a size. More...
 
template<std::size_t N>
 Buffer (T(&fixedSizeArray)[N])
 Implicit conversion from a fixed-size array. More...
 
 Buffer (std::vector< T > &v)
 Implicit conversion from a std::vector. More...
 
 Buffer (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

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

Detailed Description

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

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

Constructor & Destructor Documentation

◆ Buffer() [1/5]

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

Represents an empty buffer.

◆ Buffer() [2/5]

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

Construct a buffer from a (mutable) pointer and a size.

◆ Buffer() [3/5]

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

Implicit conversion from a fixed-size array.

◆ Buffer() [4/5]

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

Implicit conversion from a std::vector.

◆ Buffer() [5/5]

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

Prohibits implicit conversion from a temporary std::vector.

Member Function Documentation

◆ operator bool()

template<typename T>
FlowEngine::Buffer< 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::Buffer< T >::count = 0

Number of elements the pointer points to.

◆ data

template<typename T>
T* FlowEngine::Buffer< T >::data = nullptr

Pointer to the (mutable) data.