Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::geodesic::OutputBuffer Class Reference
+ Collaboration diagram for igl::geodesic::OutputBuffer:

Public Member Functions

 OutputBuffer ()
 
void clear ()
 
template<class T >
T * allocate (unsigned n)
 
template<class T >
T * get ()
 
template<class T >
unsigned capacity ()
 

Private Attributes

std::shared_ptr< double > m_buffer
 
unsigned m_num_bytes
 

Detailed Description

Constructor & Destructor Documentation

◆ OutputBuffer()

igl::geodesic::OutputBuffer::OutputBuffer ( )
inline
229 :
230 m_num_bytes(0)
231 {}
unsigned m_num_bytes
Definition exact_geodesic.cpp:268

Member Function Documentation

◆ allocate()

template<class T >
T * igl::geodesic::OutputBuffer::allocate ( unsigned  n)
inline
241 {
242 double wanted = n*sizeof(T);
243 if(wanted > m_num_bytes)
244 {
245 unsigned new_size = (unsigned) ceil(wanted / (double)sizeof(double));
246 m_buffer = std::shared_ptr<double>(new double[new_size]);
247 m_num_bytes = new_size*sizeof(double);
248 }
249
250 return (T*)m_buffer.get();
251 }
EIGEN_DEVICE_FUNC const CeilReturnType ceil() const
Definition ArrayCwiseUnaryOps.h:402
std::shared_ptr< double > m_buffer
Definition exact_geodesic.cpp:267

References ceil(), m_buffer, and m_num_bytes.

+ Here is the call graph for this function:

◆ capacity()

template<class T >
unsigned igl::geodesic::OutputBuffer::capacity ( )
inline
261 {
262 return (unsigned)floor((double)m_num_bytes/(double)sizeof(T));
263 };
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
Definition ArrayCwiseUnaryOps.h:388

References floor(), and m_num_bytes.

+ Here is the call graph for this function:

◆ clear()

void igl::geodesic::OutputBuffer::clear ( )
inline
234 {
235 m_num_bytes = 0;
236 m_buffer = std::shared_ptr<double>();
237 }

References m_buffer, and m_num_bytes.

◆ get()

template<class T >
T * igl::geodesic::OutputBuffer::get ( )
inline
255 {
256 return (T*)m_buffer.get();
257 }

References m_buffer.

Member Data Documentation

◆ m_buffer

std::shared_ptr<double> igl::geodesic::OutputBuffer::m_buffer
private

Referenced by allocate(), clear(), and get().

◆ m_num_bytes

unsigned igl::geodesic::OutputBuffer::m_num_bytes
private

Referenced by allocate(), capacity(), and clear().


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