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 5180 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 5182 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 5189 of file exprtk.hpp.

5190 : ref_count(1 )
5191 , size (dsize)
5192 , data (0 )
5193 , destruct (true )
5194 { 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:598

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 5196 of file exprtk.hpp.

5197 : ref_count(1 )
5198 , size (dsize )
5199 , data (dptr )
5200 , destruct (dstrct)
5201 {}

◆ ~control_block()

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

Definition at line 5203 of file exprtk.hpp.

5204 {
5205 if (data && destruct && (0 == ref_count))
5206 {
5207 dump_ptr("~vec_data_store::control_block() data",data);
5208 delete[] data;
5209 data = reinterpret_cast<data_t>(0);
5210 }
5211 }
void dump_ptr(const std::string &, const void *)
Definition exprtk.hpp:5164

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 5213 of file exprtk.hpp.

5214 {
5215 if (dsize)
5216 {
5217 if (0 == data_ptr)
5218 return (new control_block(dsize));
5219 else
5220 return (new control_block(dsize, data_ptr, dstrct));
5221 }
5222 else
5223 return (new control_block);
5224 }

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 5252 of file exprtk.hpp.

5253 {
5254 destruct = true;
5255 data = new T[size];
5256 std::fill_n(data, size, T(0));
5257 dump_ptr("control_block::create_data() - data", data, size);
5258 }

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 5226 of file exprtk.hpp.

5227 {
5228 if (cntrl_blck)
5229 {
5230 if (
5231 (0 != cntrl_blck->ref_count) &&
5232 (0 == --cntrl_blck->ref_count)
5233 )
5234 {
5235 delete cntrl_blck;
5236 }
5237
5238 cntrl_blck = 0;
5239 }
5240 }

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: