C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
exprtk::details::vec_data_store< T >::control_block Struct Reference

Public Member Functions

 control_block ()
 
 control_block (const std::size_t &dsize)
 
 control_block (const std::size_t &dsize, data_t dptr, bool dstrct=false)
 
 ~control_block ()
 

Static Public Member Functions

static control_blockcreate (const std::size_t &dsize, data_t data_ptr=data_t(0), bool dstrct=false)
 
static void destroy (control_block *&cntrl_blck)
 

Public Attributes

std::size_t ref_count
 
std::size_t size
 
data_t data
 
bool destruct
 

Private Member Functions

 control_block (const control_block &)
 
control_blockoperator= (const control_block &)
 
void create_data ()
 

Detailed Description

template<typename T>
struct exprtk::details::vec_data_store< T >::control_block

Definition at line 5307 of file exprtk.hpp.

Constructor & Destructor Documentation

◆ control_block() [1/4]

template<typename T >
exprtk::details::vec_data_store< T >::control_block::control_block ( )
inline

Definition at line 5309 of file exprtk.hpp.

Referenced by exprtk::details::vec_data_store< T >::control_block::create().

Here is the caller graph for this function:

◆ control_block() [2/4]

template<typename T >
exprtk::details::vec_data_store< T >::control_block::control_block ( const std::size_t &  dsize)
inlineexplicit

Definition at line 5316 of file exprtk.hpp.

5317 : ref_count(1 )
5318 , size (dsize)
5319 , data (0 )
5320 , destruct (true )
5321 { create_data(); }
bool match_impl(const Iterator pattern_begin, const Iterator pattern_end, const Iterator data_begin, const Iterator data_end, const typename std::iterator_traits< Iterator >::value_type &zero_or_more, const typename std::iterator_traits< Iterator >::value_type &exactly_one)
Definition exprtk.hpp:605

References exprtk::details::vec_data_store< T >::control_block::create_data().

Here is the call graph for this function:

◆ control_block() [3/4]

template<typename T >
exprtk::details::vec_data_store< T >::control_block::control_block ( const std::size_t &  dsize,
data_t  dptr,
bool  dstrct = false 
)
inline

Definition at line 5323 of file exprtk.hpp.

5324 : ref_count(1 )
5325 , size (dsize )
5326 , data (dptr )
5327 , destruct (dstrct)
5328 {}

◆ ~control_block()

template<typename T >
exprtk::details::vec_data_store< T >::control_block::~control_block ( )
inline

Definition at line 5330 of file exprtk.hpp.

5331 {
5332 if (data && destruct && (0 == ref_count))
5333 {
5334 dump_ptr("~vec_data_store::control_block() data",data);
5335 delete[] data;
5336 data = reinterpret_cast<data_t>(0);
5337 }
5338 }
void dump_ptr(const std::string &, const void *)
Definition exprtk.hpp:5291

References exprtk::details::vec_data_store< T >::control_block::data, exprtk::details::vec_data_store< T >::control_block::destruct, exprtk::details::dump_ptr(), and exprtk::details::vec_data_store< T >::control_block::ref_count.

Here is the call graph for this function:

◆ control_block() [4/4]

template<typename T >
exprtk::details::vec_data_store< T >::control_block::control_block ( const control_block )
private

Member Function Documentation

◆ create()

template<typename T >
static control_block * exprtk::details::vec_data_store< T >::control_block::create ( const std::size_t &  dsize,
data_t  data_ptr = data_t(0),
bool  dstrct = false 
)
inlinestatic

Definition at line 5340 of file exprtk.hpp.

5341 {
5342 if (dsize)
5343 {
5344 if (0 == data_ptr)
5345 return (new control_block(dsize));
5346 else
5347 return (new control_block(dsize, data_ptr, dstrct));
5348 }
5349 else
5350 return (new control_block);
5351 }

References exprtk::details::vec_data_store< T >::control_block::control_block(), and exprtk::details::match_impl().

Here is the call graph for this function:

◆ create_data()

template<typename T >
void exprtk::details::vec_data_store< T >::control_block::create_data ( )
inlineprivate

Definition at line 5379 of file exprtk.hpp.

5380 {
5381 destruct = true;
5382 data = new T[size];
5383 std::fill_n(data, size, T(0));
5384 dump_ptr("control_block::create_data() - data", data, size);
5385 }

References exprtk::details::vec_data_store< T >::control_block::data, exprtk::details::vec_data_store< T >::control_block::destruct, exprtk::details::dump_ptr(), exprtk::details::match_impl(), and exprtk::details::vec_data_store< T >::control_block::size.

Referenced by exprtk::details::vec_data_store< T >::control_block::control_block().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy()

template<typename T >
static void exprtk::details::vec_data_store< T >::control_block::destroy ( control_block *&  cntrl_blck)
inlinestatic

Definition at line 5353 of file exprtk.hpp.

5354 {
5355 if (cntrl_blck)
5356 {
5357 if (
5358 (0 != cntrl_blck->ref_count) &&
5359 (0 == --cntrl_blck->ref_count)
5360 )
5361 {
5362 delete cntrl_blck;
5363 }
5364
5365 cntrl_blck = 0;
5366 }
5367 }

References exprtk::details::match_impl().

Referenced by exprtk::details::vec_data_store< T >::operator=(), and exprtk::details::vec_data_store< T >::~vec_data_store().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

template<typename T >
control_block & exprtk::details::vec_data_store< T >::control_block::operator= ( const control_block )
private

Member Data Documentation

◆ data

template<typename T >
data_t exprtk::details::vec_data_store< T >::control_block::data

◆ destruct

template<typename T >
bool exprtk::details::vec_data_store< T >::control_block::destruct

◆ ref_count

template<typename T >
std::size_t exprtk::details::vec_data_store< T >::control_block::ref_count

◆ size

template<typename T >
std::size_t exprtk::details::vec_data_store< T >::control_block::size

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