C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
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_block * create (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_block & operator= (const control_block &)
void create_data ()

Detailed Description

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

Definition at line 5328 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 5330 of file exprtk.hpp.

References data, destruct, ref_count, and size.

Referenced by control_block(), create(), destroy(), and operator=().

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

5338 : ref_count(1 )
5339 , size (dsize)
5340 , data (0 )
5341 , destruct (true )
5342 { create_data(); }

References create_data(), data, destruct, ref_count, and size.

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

5345 : ref_count(1 )
5346 , size (dsize )
5347 , data (dptr )
5348 , destruct (dstrct)
5349 {}

References data, destruct, ref_count, and size.

◆ ~control_block()

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

Definition at line 5351 of file exprtk.hpp.

5352 {
5353 if (data && destruct && (0 == ref_count))
5354 {
5355 dump_ptr("~vec_data_store::control_block() data",data);
5356 delete[] data;
5357 data = reinterpret_cast<data_t>(0);
5358 }
5359 }
void dump_ptr(const std::string &, const void *)
Definition exprtk.hpp:5312

References data, destruct, exprtk::details::dump_ptr(), and 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

References control_block(), and exprtk_delete.

Here is the call graph for this function:

Member Function Documentation

◆ create()

template<typename T>
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 5361 of file exprtk.hpp.

5362 {
5363 if (dsize)
5364 {
5365 if (0 == data_ptr)
5366 return (new control_block(dsize));
5367 else
5368 return (new control_block(dsize, data_ptr, dstrct));
5369 }
5370 else
5371 return (new control_block);
5372 }

References control_block().

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

5401 {
5402 destruct = true;
5403 data = new T[size];
5404 std::fill_n(data, size, T(0));
5405 dump_ptr("control_block::create_data() - data", data, size);
5406 }

References data, destruct, exprtk::details::dump_ptr(), and size.

Referenced by control_block().

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

◆ destroy()

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

Definition at line 5374 of file exprtk.hpp.

5375 {
5376 if (cntrl_blck)
5377 {
5378 if (
5379 (0 != cntrl_blck->ref_count) &&
5380 (0 == --cntrl_blck->ref_count)
5381 )
5382 {
5383 delete cntrl_blck;
5384 }
5385
5386 cntrl_blck = 0;
5387 }
5388 }

References control_block(), and ref_count.

Referenced by exprtk::details::vec_data_store< Type >::operator=(), and exprtk::details::vec_data_store< Type >::~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

References control_block(), and exprtk_delete.

Here is the call graph for this function:

Member Data Documentation

◆ data

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

Definition at line 5392 of file exprtk.hpp.

Referenced by control_block(), control_block(), control_block(), create_data(), and ~control_block().

◆ destruct

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

Definition at line 5393 of file exprtk.hpp.

Referenced by control_block(), control_block(), control_block(), create_data(), and ~control_block().

◆ ref_count

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

Definition at line 5390 of file exprtk.hpp.

Referenced by control_block(), control_block(), control_block(), destroy(), and ~control_block().

◆ size


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