C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Types | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
exprtk::symbol_table< T > Class Template Reference

#include <exprtk.hpp>

Collaboration diagram for exprtk::symbol_table< T >:
[legend]

Classes

struct  control_block
 
struct  freefunc00
 
struct  freefunc01
 
struct  freefunc02
 
struct  freefunc03
 
struct  freefunc04
 
struct  freefunc05
 
struct  freefunc06
 
struct  freefunc07
 
struct  freefunc08
 
struct  freefunc09
 
struct  freefunc10
 
struct  freefunc11
 
struct  freefunc12
 
struct  freefunc13
 
struct  freefunc14
 
struct  freefunc15
 
struct  type_store
 

Public Types

enum  symtab_mutability_type { e_unknown = 0 , e_mutable = 1 , e_immutable = 2 }
 
typedef T(* ff00_functor) ()
 
typedef T(* ff01_functor) (T)
 
typedef T(* ff02_functor) (T, T)
 
typedef T(* ff03_functor) (T, T, T)
 
typedef T(* ff04_functor) (T, T, T, T)
 
typedef T(* ff05_functor) (T, T, T, T, T)
 
typedef T(* ff06_functor) (T, T, T, T, T, T)
 
typedef T(* ff07_functor) (T, T, T, T, T, T, T)
 
typedef T(* ff08_functor) (T, T, T, T, T, T, T, T)
 
typedef T(* ff09_functor) (T, T, T, T, T, T, T, T, T)
 
typedef T(* ff10_functor) (T, T, T, T, T, T, T, T, T, T)
 
typedef T(* ff11_functor) (T, T, T, T, T, T, T, T, T, T, T)
 
typedef T(* ff12_functor) (T, T, T, T, T, T, T, T, T, T, T, T)
 
typedef T(* ff13_functor) (T, T, T, T, T, T, T, T, T, T, T, T, T)
 
typedef T(* ff14_functor) (T, T, T, T, T, T, T, T, T, T, T, T, T, T)
 
typedef T(* ff15_functor) (T, T, T, T, T, T, T, T, T, T, T, T, T, T, T)
 
typedef vector_holder_tvector_holder_ptr
 

Public Member Functions

 symbol_table (const symtab_mutability_type mutability=e_mutable)
 
 ~symbol_table ()
 
 symbol_table (const symbol_table< T > &st)
 
symbol_table< T > & operator= (const symbol_table< T > &st)
 
bool operator== (const symbol_table< T > &st) const
 
symtab_mutability_type mutability () const
 
void clear_variables (const bool delete_node=true)
 
void clear_functions ()
 
void clear_strings ()
 
void clear_vectors ()
 
void clear_local_constants ()
 
void clear ()
 
std::size_t variable_count () const
 
std::size_t stringvar_count () const
 
std::size_t function_count () const
 
std::size_t vector_count () const
 
variable_ptr get_variable (const std::string &variable_name) const
 
variable_ptr get_variable (const T &var_ref) const
 
stringvar_ptr get_stringvar (const std::string &string_name) const
 
stringvar_base< T > get_stringvar_base (const std::string &string_name) const
 
function_ptr get_function (const std::string &function_name) const
 
vararg_function_ptr get_vararg_function (const std::string &vararg_function_name) const
 
generic_function_ptr get_generic_function (const std::string &function_name) const
 
generic_function_ptr get_string_function (const std::string &function_name) const
 
generic_function_ptr get_overload_function (const std::string &function_name) const
 
vector_holder_ptr get_vector (const std::string &vector_name) const
 
T & variable_ref (const std::string &symbol_name)
 
std::string & stringvar_ref (const std::string &symbol_name)
 
bool is_constant_node (const std::string &symbol_name) const
 
bool is_constant_string (const std::string &symbol_name) const
 
bool create_variable (const std::string &variable_name, const T &value=T(0))
 
bool create_stringvar (const std::string &stringvar_name, const std::string &value=std::string(""))
 
bool add_variable (const std::string &variable_name, T &t, const bool is_constant=false)
 
bool add_constant (const std::string &constant_name, const T &value)
 
bool add_stringvar (const std::string &stringvar_name, std::string &s, const bool is_constant=false)
 
bool add_function (const std::string &function_name, function_t &function)
 
bool add_function (const std::string &vararg_function_name, vararg_function_t &vararg_function)
 
bool add_function (const std::string &function_name, generic_function_t &function)
 
bool add_function (const std::string &function_name, ff00_functor function)
 
bool add_function (const std::string &function_name, ff01_functor function)
 
bool add_function (const std::string &function_name, ff02_functor function)
 
bool add_function (const std::string &function_name, ff03_functor function)
 
bool add_function (const std::string &function_name, ff04_functor function)
 
bool add_function (const std::string &function_name, ff05_functor function)
 
bool add_function (const std::string &function_name, ff06_functor function)
 
bool add_function (const std::string &function_name, ff07_functor function)
 
bool add_function (const std::string &function_name, ff08_functor function)
 
bool add_function (const std::string &function_name, ff09_functor function)
 
bool add_function (const std::string &function_name, ff10_functor function)
 
bool add_function (const std::string &function_name, ff11_functor function)
 
bool add_function (const std::string &function_name, ff12_functor function)
 
bool add_function (const std::string &function_name, ff13_functor function)
 
bool add_function (const std::string &function_name, ff14_functor function)
 
bool add_function (const std::string &function_name, ff15_functor function)
 
bool add_reserved_function (const std::string &function_name, function_t &function)
 
bool add_reserved_function (const std::string &vararg_function_name, vararg_function_t &vararg_function)
 
bool add_reserved_function (const std::string &function_name, generic_function_t &function)
 
bool add_reserved_function (const std::string &function_name, ff00_functor function)
 
bool add_reserved_function (const std::string &function_name, ff01_functor function)
 
bool add_reserved_function (const std::string &function_name, ff02_functor function)
 
bool add_reserved_function (const std::string &function_name, ff03_functor function)
 
bool add_reserved_function (const std::string &function_name, ff04_functor function)
 
bool add_reserved_function (const std::string &function_name, ff05_functor function)
 
bool add_reserved_function (const std::string &function_name, ff06_functor function)
 
bool add_reserved_function (const std::string &function_name, ff07_functor function)
 
bool add_reserved_function (const std::string &function_name, ff08_functor function)
 
bool add_reserved_function (const std::string &function_name, ff09_functor function)
 
bool add_reserved_function (const std::string &function_name, ff10_functor function)
 
bool add_reserved_function (const std::string &function_name, ff11_functor function)
 
bool add_reserved_function (const std::string &function_name, ff12_functor function)
 
bool add_reserved_function (const std::string &function_name, ff13_functor function)
 
bool add_reserved_function (const std::string &function_name, ff14_functor function)
 
bool add_reserved_function (const std::string &function_name, ff15_functor function)
 
template<std::size_t N>
bool add_vector (const std::string &vector_name, T(&v)[N])
 
bool add_vector (const std::string &vector_name, T *v, const std::size_t &v_size)
 
template<typename Allocator >
bool add_vector (const std::string &vector_name, std::vector< T, Allocator > &v)
 
bool add_vector (const std::string &vector_name, exprtk::vector_view< T > &v)
 
bool remove_variable (const std::string &variable_name, const bool delete_node=true)
 
bool remove_stringvar (const std::string &string_name)
 
bool remove_function (const std::string &function_name)
 
bool remove_vararg_function (const std::string &vararg_function_name)
 
bool remove_vector (const std::string &vector_name)
 
bool add_constants ()
 
bool add_pi ()
 
bool add_epsilon ()
 
bool add_infinity ()
 
template<typename Package >
bool add_package (Package &package)
 
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t get_variable_list (Sequence< std::pair< std::string, T >, Allocator > &vlist) const
 
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t get_variable_list (Sequence< std::string, Allocator > &vlist) const
 
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t get_stringvar_list (Sequence< std::pair< std::string, std::string >, Allocator > &svlist) const
 
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t get_stringvar_list (Sequence< std::string, Allocator > &svlist) const
 
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t get_vector_list (Sequence< std::string, Allocator > &vec_list) const
 
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t get_function_list (Sequence< std::string, Allocator > &function_list) const
 
std::vector< std::string > get_function_list () const
 
bool symbol_exists (const std::string &symbol_name, const bool check_reserved_symb=true) const
 
bool is_variable (const std::string &variable_name) const
 
bool is_stringvar (const std::string &stringvar_name) const
 
bool is_conststr_stringvar (const std::string &symbol_name) const
 
bool is_function (const std::string &function_name) const
 
bool is_vararg_function (const std::string &vararg_function_name) const
 
bool is_vector (const std::string &vector_name) const
 
std::string get_variable_name (const expression_ptr &ptr) const
 
std::string get_vector_name (const vector_holder_ptr &ptr) const
 
std::string get_stringvar_name (const expression_ptr &ptr) const
 
std::string get_conststr_stringvar_name (const expression_ptr &ptr) const
 
bool valid () const
 
void load_from (const symbol_table< T > &st)
 
void load_variables_from (const symbol_table< T > &st)
 
void load_vectors_from (const symbol_table< T > &st)
 

Protected Types

typedef details::expression_node< T > * expression_ptr
 
typedef details::variable_node< T > variable_t
 
typedef details::vector_holder< T > vector_holder_t
 
typedef variable_tvariable_ptr
 
typedef details::stringvar_node< T > stringvar_t
 
typedef stringvar_tstringvar_ptr
 
typedef ifunction< T > function_t
 
typedef ivararg_function< T > vararg_function_t
 
typedef igeneric_function< T > generic_function_t
 
typedef function_tfunction_ptr
 
typedef vararg_function_tvararg_function_ptr
 
typedef generic_function_tgeneric_function_ptr
 

Static Protected Attributes

static const std::size_t lut_size = 256
 

Private Types

typedef control_block::st_data local_data_t
 

Private Member Functions

bool valid_symbol (const std::string &symbol, const bool check_reserved_symb=true) const
 
bool valid_function (const std::string &symbol) const
 
local_data_tlocal_data ()
 
const local_data_tlocal_data () const
 

Private Attributes

control_blockcontrol_block_
 

Friends

class parser< T >
 

Detailed Description

template<typename T>
class exprtk::symbol_table< T >

Definition at line 19744 of file exprtk.hpp.

Member Typedef Documentation

◆ expression_ptr

template<typename T >
typedef details::expression_node<T>* exprtk::symbol_table< T >::expression_ptr
protected

Definition at line 20333 of file exprtk.hpp.

◆ ff00_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff00_functor) ()

Definition at line 19755 of file exprtk.hpp.

◆ ff01_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff01_functor) (T)

Definition at line 19756 of file exprtk.hpp.

◆ ff02_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff02_functor) (T, T)

Definition at line 19757 of file exprtk.hpp.

◆ ff03_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff03_functor) (T, T, T)

Definition at line 19758 of file exprtk.hpp.

◆ ff04_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff04_functor) (T, T, T, T)

Definition at line 19759 of file exprtk.hpp.

◆ ff05_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff05_functor) (T, T, T, T, T)

Definition at line 19760 of file exprtk.hpp.

◆ ff06_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff06_functor) (T, T, T, T, T, T)

Definition at line 19761 of file exprtk.hpp.

◆ ff07_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff07_functor) (T, T, T, T, T, T, T)

Definition at line 19762 of file exprtk.hpp.

◆ ff08_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff08_functor) (T, T, T, T, T, T, T, T)

Definition at line 19763 of file exprtk.hpp.

◆ ff09_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff09_functor) (T, T, T, T, T, T, T, T, T)

Definition at line 19764 of file exprtk.hpp.

◆ ff10_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff10_functor) (T, T, T, T, T, T, T, T, T, T)

Definition at line 19765 of file exprtk.hpp.

◆ ff11_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff11_functor) (T, T, T, T, T, T, T, T, T, T, T)

Definition at line 19766 of file exprtk.hpp.

◆ ff12_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff12_functor) (T, T, T, T, T, T, T, T, T, T, T, T)

Definition at line 19767 of file exprtk.hpp.

◆ ff13_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff13_functor) (T, T, T, T, T, T, T, T, T, T, T, T, T)

Definition at line 19768 of file exprtk.hpp.

◆ ff14_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff14_functor) (T, T, T, T, T, T, T, T, T, T, T, T, T, T)

Definition at line 19769 of file exprtk.hpp.

◆ ff15_functor

template<typename T >
typedef T(* exprtk::symbol_table< T >::ff15_functor) (T, T, T, T, T, T, T, T, T, T, T, T, T, T, T)

Definition at line 19770 of file exprtk.hpp.

◆ function_ptr

template<typename T >
typedef function_t* exprtk::symbol_table< T >::function_ptr
protected

Definition at line 20344 of file exprtk.hpp.

◆ function_t

template<typename T >
typedef ifunction<T> exprtk::symbol_table< T >::function_t
protected

Definition at line 20341 of file exprtk.hpp.

◆ generic_function_ptr

template<typename T >
typedef generic_function_t* exprtk::symbol_table< T >::generic_function_ptr
protected

Definition at line 20346 of file exprtk.hpp.

◆ generic_function_t

template<typename T >
typedef igeneric_function<T> exprtk::symbol_table< T >::generic_function_t
protected

Definition at line 20343 of file exprtk.hpp.

◆ local_data_t

template<typename T >
typedef control_block::st_data exprtk::symbol_table< T >::local_data_t
private

Definition at line 21465 of file exprtk.hpp.

◆ stringvar_ptr

template<typename T >
typedef stringvar_t* exprtk::symbol_table< T >::stringvar_ptr
protected

Definition at line 20339 of file exprtk.hpp.

◆ stringvar_t

template<typename T >
typedef details::stringvar_node<T> exprtk::symbol_table< T >::stringvar_t
protected

Definition at line 20338 of file exprtk.hpp.

◆ vararg_function_ptr

template<typename T >
typedef vararg_function_t* exprtk::symbol_table< T >::vararg_function_ptr
protected

Definition at line 20345 of file exprtk.hpp.

◆ vararg_function_t

template<typename T >
typedef ivararg_function<T> exprtk::symbol_table< T >::vararg_function_t
protected

Definition at line 20342 of file exprtk.hpp.

◆ variable_ptr

template<typename T >
typedef variable_t* exprtk::symbol_table< T >::variable_ptr
protected

Definition at line 20336 of file exprtk.hpp.

◆ variable_t

template<typename T >
typedef details::variable_node<T> exprtk::symbol_table< T >::variable_t
protected

Definition at line 20334 of file exprtk.hpp.

◆ vector_holder_ptr

template<typename T >
typedef vector_holder_t* exprtk::symbol_table< T >::vector_holder_ptr

Definition at line 20678 of file exprtk.hpp.

◆ vector_holder_t

template<typename T >
typedef details::vector_holder<T> exprtk::symbol_table< T >::vector_holder_t
protected

Definition at line 20335 of file exprtk.hpp.

Member Enumeration Documentation

◆ symtab_mutability_type

Enumerator
e_unknown 
e_mutable 
e_immutable 

Definition at line 19748 of file exprtk.hpp.

19749 {
19750 e_unknown = 0,
19751 e_mutable = 1,
19752 e_immutable = 2
19753 };

Constructor & Destructor Documentation

◆ symbol_table() [1/2]

template<typename T >
exprtk::symbol_table< T >::symbol_table ( const symtab_mutability_type  mutability = e_mutable)
inlineexplicit

Definition at line 20466 of file exprtk.hpp.

20468 {
20470 clear();
20471 }
symtab_mutability_type mutability() const
Definition exprtk.hpp:20503
control_block * control_block_
Definition exprtk.hpp:21477
static control_block * create()
Definition exprtk.hpp:20429
void set_mutability(const symtab_mutability_type mutability)
Definition exprtk.hpp:20454

References exprtk::symbol_table< T >::clear(), exprtk::symbol_table< T >::control_block_, exprtk::symbol_table< T >::mutability(), and exprtk::symbol_table< T >::control_block::set_mutability().

Here is the call graph for this function:

◆ ~symbol_table()

template<typename T >
exprtk::symbol_table< T >::~symbol_table ( )
inline

Definition at line 20473 of file exprtk.hpp.

20474 {
20475 exprtk::details::dump_ptr("~symbol_table", this);
20477 }
void dump_ptr(const std::string &, const void *)
Definition exprtk.hpp:5164
static void destroy(control_block *&cntrl_blck, SymTab *sym_tab)
Definition exprtk.hpp:20435

References exprtk::symbol_table< T >::control_block_, exprtk::symbol_table< T >::control_block::destroy(), and exprtk::details::dump_ptr().

Here is the call graph for this function:

◆ symbol_table() [2/2]

template<typename T >
exprtk::symbol_table< T >::symbol_table ( const symbol_table< T > &  st)
inline

Definition at line 20479 of file exprtk.hpp.

20480 {
20481 control_block_ = st.control_block_;
20483 }

References exprtk::symbol_table< T >::control_block_, and exprtk::symbol_table< T >::control_block::ref_count.

Member Function Documentation

◆ add_constant()

template<typename T >
bool exprtk::symbol_table< T >::add_constant ( const std::string &  constant_name,
const T &  value 
)
inline

Definition at line 20782 of file exprtk.hpp.

20783 {
20784 if (!valid())
20785 return false;
20786 else if (!valid_symbol(constant_name))
20787 return false;
20788 else if (symbol_exists(constant_name))
20789 return false;
20790
20791 local_data().local_symbol_list_.push_back(value);
20792 T& t = local_data().local_symbol_list_.back();
20793
20794 return add_variable(constant_name, t, true);
20795 }
bool valid_symbol(const std::string &symbol, const bool check_reserved_symb=true) const
Definition exprtk.hpp:21413
local_data_t & local_data()
Definition exprtk.hpp:21467
bool add_variable(const std::string &variable_name, T &t, const bool is_constant=false)
Definition exprtk.hpp:20770
bool valid() const
Definition exprtk.hpp:21295
bool symbol_exists(const std::string &symbol_name, const bool check_reserved_symb=true) const
Definition exprtk.hpp:21191

References exprtk::symbol_table< T >::add_variable(), exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::local_symbol_list_, exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Referenced by exprtk::symbol_table< T >::add_epsilon(), exprtk::symbol_table< T >::add_infinity(), exprtk::symbol_table< T >::add_pi(), exprtk::compute(), exprtk::compute(), exprtk::compute(), exprtk::parser< T >::parse_symtab_symbol(), and expression_processor< T >::setup_symbol_table().

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

◆ add_constants()

template<typename T >
bool exprtk::symbol_table< T >::add_constants ( )
inline

Definition at line 21071 of file exprtk.hpp.

21072 {
21073 return add_pi () &&
21074 add_epsilon () &&
21075 add_infinity() ;
21076 }

References exprtk::symbol_table< T >::add_epsilon(), exprtk::symbol_table< T >::add_infinity(), and exprtk::symbol_table< T >::add_pi().

Referenced by exprtk::function_compositor< T >::compile_expression(), exprtk::compute(), exprtk::compute(), exprtk::compute(), exprtk::compute(), main(), main(), run_test04(), run_test05(), run_test09(), run_test10(), run_test14(), run_test15(), run_test16(), run_test17(), run_test18(), run_test20(), expression_processor< T >::setup_symbol_table(), test_expression(), and test_gen().

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

◆ add_epsilon()

template<typename T >
bool exprtk::symbol_table< T >::add_epsilon ( )
inline

Definition at line 21085 of file exprtk.hpp.

21086 {
21087 static const T local_epsilon = details::numeric::details::epsilon_type<T>::value();
21088 return add_constant("epsilon",local_epsilon);
21089 }
bool add_constant(const std::string &constant_name, const T &value)
Definition exprtk.hpp:20782

References exprtk::symbol_table< T >::add_constant().

Referenced by exprtk::symbol_table< T >::add_constants().

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

◆ add_function() [1/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff00_functor  function 
)
inline

Definition at line 20881 of file exprtk.hpp.

◆ add_function() [2/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff01_functor  function 
)
inline

Definition at line 20881 of file exprtk.hpp.

◆ add_function() [3/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff02_functor  function 
)
inline

Definition at line 20882 of file exprtk.hpp.

◆ add_function() [4/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff03_functor  function 
)
inline

Definition at line 20882 of file exprtk.hpp.

◆ add_function() [5/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff04_functor  function 
)
inline

Definition at line 20883 of file exprtk.hpp.

◆ add_function() [6/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff05_functor  function 
)
inline

Definition at line 20883 of file exprtk.hpp.

◆ add_function() [7/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff06_functor  function 
)
inline

Definition at line 20884 of file exprtk.hpp.

◆ add_function() [8/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff07_functor  function 
)
inline

Definition at line 20884 of file exprtk.hpp.

◆ add_function() [9/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff08_functor  function 
)
inline

Definition at line 20885 of file exprtk.hpp.

◆ add_function() [10/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff09_functor  function 
)
inline

Definition at line 20885 of file exprtk.hpp.

◆ add_function() [11/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff10_functor  function 
)
inline

Definition at line 20886 of file exprtk.hpp.

◆ add_function() [12/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff11_functor  function 
)
inline

Definition at line 20886 of file exprtk.hpp.

◆ add_function() [13/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff12_functor  function 
)
inline

Definition at line 20887 of file exprtk.hpp.

◆ add_function() [14/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff13_functor  function 
)
inline

Definition at line 20887 of file exprtk.hpp.

◆ add_function() [15/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff14_functor  function 
)
inline

Definition at line 20888 of file exprtk.hpp.

◆ add_function() [16/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
ff15_functor  function 
)
inline

Definition at line 20888 of file exprtk.hpp.

◆ add_function() [17/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
function_t function 
)
inline

Definition at line 20811 of file exprtk.hpp.

20812 {
20813 if (!valid())
20814 return false;
20815 else if (!valid_symbol(function_name))
20816 return false;
20817 else if (symbol_exists(function_name))
20818 return false;
20819 else
20820 return local_data().function_store.add(function_name,function);
20821 }
type_store< function_t, function_t > function_store
Definition exprtk.hpp:20356

References exprtk::symbol_table< T >::control_block::st_data::function_store, exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Referenced by exprtk::function_compositor< T >::compile_expression(), extract_expression_dependents(), exprtk::function_compositor< T >::forward(), exprtk::symbol_table< T >::load_from(), run_test09(), run_test10(), run_test12(), run_test14(), run_test16(), run_test18(), test_expression(), test_gen(), and vector_randu().

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

◆ add_function() [18/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  function_name,
generic_function_t function 
)
inline

Definition at line 20835 of file exprtk.hpp.

20836 {
20837 if (!valid())
20838 return false;
20839 else if (!valid_symbol(function_name))
20840 return false;
20841 else if (symbol_exists(function_name))
20842 return false;
20843 else
20844 {
20845 switch (function.rtrn_type)
20846 {
20848 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|")) ?
20849 local_data().generic_function_store.add(function_name,function) : false;
20850
20852 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|")) ?
20853 local_data().string_function_store.add(function_name,function) : false;
20854
20856 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|:")) ?
20857 local_data().overload_function_store.add(function_name,function) : false;
20858 }
20859 }
20860
20861 return false;
20862 }
type_store< generic_function_t, generic_function_t > string_function_store
Definition exprtk.hpp:20359
type_store< generic_function_t, generic_function_t > overload_function_store
Definition exprtk.hpp:20360
type_store< generic_function_t, generic_function_t > generic_function_store
Definition exprtk.hpp:20358

References exprtk::igeneric_function< T >::e_rtrn_overload, exprtk::igeneric_function< T >::e_rtrn_scalar, exprtk::igeneric_function< T >::e_rtrn_string, exprtk::symbol_table< T >::control_block::st_data::generic_function_store, exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::overload_function_store, exprtk::igeneric_function< T >::parameter_sequence, exprtk::igeneric_function< T >::rtrn_type, exprtk::symbol_table< T >::control_block::st_data::string_function_store, exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Here is the call graph for this function:

◆ add_function() [19/19]

template<typename T >
bool exprtk::symbol_table< T >::add_function ( const std::string &  vararg_function_name,
vararg_function_t vararg_function 
)
inline

Definition at line 20823 of file exprtk.hpp.

20824 {
20825 if (!valid())
20826 return false;
20827 else if (!valid_symbol(vararg_function_name))
20828 return false;
20829 else if (symbol_exists(vararg_function_name))
20830 return false;
20831 else
20832 return local_data().vararg_function_store.add(vararg_function_name,vararg_function);
20833 }
type_store< vararg_function_t, vararg_function_t > vararg_function_store
Definition exprtk.hpp:20357

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::vararg_function_store.

Here is the call graph for this function:

◆ add_infinity()

template<typename T >
bool exprtk::symbol_table< T >::add_infinity ( )
inline

Definition at line 21091 of file exprtk.hpp.

21092 {
21093 static const T local_infinity = std::numeric_limits<T>::infinity();
21094 return add_constant("inf",local_infinity);
21095 }

References exprtk::symbol_table< T >::add_constant().

Referenced by exprtk::symbol_table< T >::add_constants().

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

◆ add_package()

template<typename T >
template<typename Package >
bool exprtk::symbol_table< T >::add_package ( Package &  package)
inline

Definition at line 21098 of file exprtk.hpp.

21099 {
21100 return package.register_package(*this);
21101 }

Referenced by import_packages< T >::import_packages(), and run_test14().

Here is the caller graph for this function:

◆ add_pi()

template<typename T >
bool exprtk::symbol_table< T >::add_pi ( )
inline

Definition at line 21078 of file exprtk.hpp.

21079 {
21081 static const T local_pi = details::numeric::details::const_pi_impl<T>(num_type);
21082 return add_constant("pi",local_pi);
21083 }

References exprtk::symbol_table< T >::add_constant().

Referenced by exprtk::symbol_table< T >::add_constants(), and run_test10().

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

◆ add_reserved_function() [1/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff00_functor  function 
)
inline

Definition at line 20962 of file exprtk.hpp.

◆ add_reserved_function() [2/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff01_functor  function 
)
inline

Definition at line 20962 of file exprtk.hpp.

◆ add_reserved_function() [3/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff02_functor  function 
)
inline

Definition at line 20963 of file exprtk.hpp.

◆ add_reserved_function() [4/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff03_functor  function 
)
inline

Definition at line 20963 of file exprtk.hpp.

◆ add_reserved_function() [5/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff04_functor  function 
)
inline

Definition at line 20964 of file exprtk.hpp.

◆ add_reserved_function() [6/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff05_functor  function 
)
inline

Definition at line 20964 of file exprtk.hpp.

◆ add_reserved_function() [7/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff06_functor  function 
)
inline

Definition at line 20965 of file exprtk.hpp.

◆ add_reserved_function() [8/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff07_functor  function 
)
inline

Definition at line 20965 of file exprtk.hpp.

◆ add_reserved_function() [9/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff08_functor  function 
)
inline

Definition at line 20966 of file exprtk.hpp.

◆ add_reserved_function() [10/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff09_functor  function 
)
inline

Definition at line 20966 of file exprtk.hpp.

◆ add_reserved_function() [11/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff10_functor  function 
)
inline

Definition at line 20967 of file exprtk.hpp.

◆ add_reserved_function() [12/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff11_functor  function 
)
inline

Definition at line 20967 of file exprtk.hpp.

◆ add_reserved_function() [13/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff12_functor  function 
)
inline

Definition at line 20968 of file exprtk.hpp.

◆ add_reserved_function() [14/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff13_functor  function 
)
inline

Definition at line 20968 of file exprtk.hpp.

◆ add_reserved_function() [15/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff14_functor  function 
)
inline

Definition at line 20969 of file exprtk.hpp.

◆ add_reserved_function() [16/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
ff15_functor  function 
)
inline

Definition at line 20969 of file exprtk.hpp.

◆ add_reserved_function() [17/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
function_t function 
)
inline

Definition at line 20892 of file exprtk.hpp.

20893 {
20894 if (!valid())
20895 return false;
20896 else if (!valid_symbol(function_name,false))
20897 return false;
20898 else if (symbol_exists(function_name,false))
20899 return false;
20900 else
20901 return local_data().function_store.add(function_name,function);
20902 }

References exprtk::symbol_table< T >::control_block::st_data::function_store, exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Here is the call graph for this function:

◆ add_reserved_function() [18/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  function_name,
generic_function_t function 
)
inline

Definition at line 20916 of file exprtk.hpp.

20917 {
20918 if (!valid())
20919 return false;
20920 else if (!valid_symbol(function_name,false))
20921 return false;
20922 else if (symbol_exists(function_name,false))
20923 return false;
20924 else
20925 {
20926 switch (function.rtrn_type)
20927 {
20929 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|")) ?
20930 local_data().generic_function_store.add(function_name,function) : false;
20931
20933 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|")) ?
20934 local_data().string_function_store.add(function_name,function) : false;
20935
20937 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|:")) ?
20938 local_data().overload_function_store.add(function_name,function) : false;
20939 }
20940 }
20941
20942 return false;
20943 }

References exprtk::igeneric_function< T >::e_rtrn_overload, exprtk::igeneric_function< T >::e_rtrn_scalar, exprtk::igeneric_function< T >::e_rtrn_string, exprtk::symbol_table< T >::control_block::st_data::generic_function_store, exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::overload_function_store, exprtk::igeneric_function< T >::parameter_sequence, exprtk::igeneric_function< T >::rtrn_type, exprtk::symbol_table< T >::control_block::st_data::string_function_store, exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Here is the call graph for this function:

◆ add_reserved_function() [19/19]

template<typename T >
bool exprtk::symbol_table< T >::add_reserved_function ( const std::string &  vararg_function_name,
vararg_function_t vararg_function 
)
inline

Definition at line 20904 of file exprtk.hpp.

20905 {
20906 if (!valid())
20907 return false;
20908 else if (!valid_symbol(vararg_function_name,false))
20909 return false;
20910 else if (symbol_exists(vararg_function_name,false))
20911 return false;
20912 else
20913 return local_data().vararg_function_store.add(vararg_function_name,vararg_function);
20914 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::vararg_function_store.

Here is the call graph for this function:

◆ add_stringvar()

template<typename T >
bool exprtk::symbol_table< T >::add_stringvar ( const std::string &  stringvar_name,
std::string &  s,
const bool  is_constant = false 
)
inline

Definition at line 20798 of file exprtk.hpp.

20799 {
20800 if (!valid())
20801 return false;
20802 else if (!valid_symbol(stringvar_name))
20803 return false;
20804 else if (symbol_exists(stringvar_name))
20805 return false;
20806 else
20807 return local_data().stringvar_store.add(stringvar_name, s, is_constant);
20808 }
type_store< stringvar_t, std::string > stringvar_store
Definition exprtk.hpp:20363

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::stringvar_store, exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Referenced by exprtk::symbol_table< T >::create_stringvar(), run_test02(), run_test10(), and run_test18().

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

◆ add_variable()

template<typename T >
bool exprtk::symbol_table< T >::add_variable ( const std::string &  variable_name,
T &  t,
const bool  is_constant = false 
)
inline

Definition at line 20770 of file exprtk.hpp.

20771 {
20772 if (!valid())
20773 return false;
20774 else if (!valid_symbol(variable_name))
20775 return false;
20776 else if (symbol_exists(variable_name))
20777 return false;
20778 else
20779 return local_data().variable_store.add(variable_name, t, is_constant);
20780 }
type_store< variable_t, T > variable_store
Definition exprtk.hpp:20355

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Referenced by exprtk::symbol_table< T >::add_constant(), exprtk::symbol_table< T >::create_variable(), exprtk::symbol_table< T >::load_variables_from(), main(), main(), run_test01(), run_test02(), run_test04(), run_test05(), run_test06(), run_test07(), run_test08(), run_test09(), run_test10(), run_test11(), run_test12(), run_test14(), run_test15(), run_test16(), run_test17(), run_test18(), and test_gen().

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

◆ add_vector() [1/4]

template<typename T >
bool exprtk::symbol_table< T >::add_vector ( const std::string &  vector_name,
exprtk::vector_view< T > &  v 
)
inline

Definition at line 21015 of file exprtk.hpp.

21016 {
21017 if (!valid())
21018 return false;
21019 else if (!valid_symbol(vector_name))
21020 return false;
21021 else if (symbol_exists(vector_name))
21022 return false;
21023 else if (0 == v.size())
21024 return false;
21025 else
21026 return local_data().vector_store.add(vector_name,v);
21027 }
std::size_t size() const
Definition exprtk.hpp:4599
type_store< vector_holder_t, vector_holder_t > vector_store
Definition exprtk.hpp:20361

References exprtk::symbol_table< T >::local_data(), exprtk::vector_view< T >::size(), exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Here is the call graph for this function:

◆ add_vector() [2/4]

template<typename T >
template<typename Allocator >
bool exprtk::symbol_table< T >::add_vector ( const std::string &  vector_name,
std::vector< T, Allocator > &  v 
)
inline

Definition at line 21001 of file exprtk.hpp.

21002 {
21003 if (!valid())
21004 return false;
21005 else if (!valid_symbol(vector_name))
21006 return false;
21007 else if (symbol_exists(vector_name))
21008 return false;
21009 else if (0 == v.size())
21010 return false;
21011 else
21012 return local_data().vector_store.add(vector_name,v);
21013 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Here is the call graph for this function:

◆ add_vector() [3/4]

template<typename T >
bool exprtk::symbol_table< T >::add_vector ( const std::string &  vector_name,
T *  v,
const std::size_t &  v_size 
)
inline

Definition at line 20986 of file exprtk.hpp.

20987 {
20988 if (!valid())
20989 return false;
20990 else if (!valid_symbol(vector_name))
20991 return false;
20992 else if (symbol_exists(vector_name))
20993 return false;
20994 else if (0 == v_size)
20995 return false;
20996 else
20997 return local_data().vector_store.add(vector_name, v, v_size);
20998 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Here is the call graph for this function:

◆ add_vector() [4/4]

template<typename T >
template<std::size_t N>
bool exprtk::symbol_table< T >::add_vector ( const std::string &  vector_name,
T(&)  v[N] 
)
inline

Definition at line 20974 of file exprtk.hpp.

20975 {
20976 if (!valid())
20977 return false;
20978 else if (!valid_symbol(vector_name))
20979 return false;
20980 else if (symbol_exists(vector_name))
20981 return false;
20982 else
20983 return local_data().vector_store.add(vector_name,v);
20984 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Referenced by exprtk::symbol_table< T >::load_vectors_from(), exprtk::details::collector_helper< T >::resolve_as_vector::process(), run_test01(), run_test18(), and vector_randu().

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

◆ clear()

template<typename T >
void exprtk::symbol_table< T >::clear ( )
inline

Definition at line 20535 of file exprtk.hpp.

20536 {
20537 if (!valid()) return;
20538 clear_variables ();
20539 clear_functions ();
20540 clear_strings ();
20541 clear_vectors ();
20543 }
void clear_variables(const bool delete_node=true)
Definition exprtk.hpp:20508

References exprtk::symbol_table< T >::clear_functions(), exprtk::symbol_table< T >::clear_local_constants(), exprtk::symbol_table< T >::clear_strings(), exprtk::symbol_table< T >::clear_variables(), exprtk::symbol_table< T >::clear_vectors(), and exprtk::symbol_table< T >::valid().

Referenced by exprtk::function_compositor< T >::clear(), expression_processor< T >::clear_functions(), run_test10(), and exprtk::symbol_table< T >::symbol_table().

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

◆ clear_functions()

template<typename T >
void exprtk::symbol_table< T >::clear_functions ( )
inline

Definition at line 20513 of file exprtk.hpp.

20514 {
20515 local_data().function_store.clear();
20516 }

References exprtk::symbol_table< T >::control_block::st_data::function_store, and exprtk::symbol_table< T >::local_data().

Referenced by exprtk::symbol_table< T >::clear().

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

◆ clear_local_constants()

template<typename T >
void exprtk::symbol_table< T >::clear_local_constants ( )
inline

Definition at line 20530 of file exprtk.hpp.

20531 {
20533 }

References exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::control_block::st_data::local_symbol_list_.

Referenced by exprtk::symbol_table< T >::clear().

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

◆ clear_strings()

template<typename T >
void exprtk::symbol_table< T >::clear_strings ( )
inline

Definition at line 20518 of file exprtk.hpp.

20519 {
20520 #ifndef exprtk_disable_string_capabilities
20521 local_data().stringvar_store.clear();
20522 #endif
20523 }

References exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::control_block::st_data::stringvar_store.

Referenced by exprtk::symbol_table< T >::clear().

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

◆ clear_variables()

template<typename T >
void exprtk::symbol_table< T >::clear_variables ( const bool  delete_node = true)
inline

Definition at line 20508 of file exprtk.hpp.

20509 {
20510 local_data().variable_store.clear(delete_node);
20511 }

References exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Referenced by exprtk::symbol_table< T >::clear(), and expression_processor< T >::setup_symbol_table().

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

◆ clear_vectors()

template<typename T >
void exprtk::symbol_table< T >::clear_vectors ( )
inline

Definition at line 20525 of file exprtk.hpp.

20526 {
20527 local_data().vector_store.clear();
20528 }

References exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Referenced by exprtk::symbol_table< T >::clear().

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

◆ create_stringvar()

template<typename T >
bool exprtk::symbol_table< T >::create_stringvar ( const std::string &  stringvar_name,
const std::string &  value = std::string("") 
)
inline

Definition at line 20754 of file exprtk.hpp.

20755 {
20756 if (!valid())
20757 return false;
20758 else if (!valid_symbol(stringvar_name))
20759 return false;
20760 else if (symbol_exists(stringvar_name))
20761 return false;
20762
20763 local_data().local_stringvar_list_.push_back(value);
20764 std::string& s = local_data().local_stringvar_list_.back();
20765
20766 return add_stringvar(stringvar_name,s);
20767 }
bool add_stringvar(const std::string &stringvar_name, std::string &s, const bool is_constant=false)
Definition exprtk.hpp:20798
std::list< std::string > local_stringvar_list_
Definition exprtk.hpp:20404

References exprtk::symbol_table< T >::add_stringvar(), exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::local_stringvar_list_, exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Here is the call graph for this function:

◆ create_variable()

template<typename T >
bool exprtk::symbol_table< T >::create_variable ( const std::string &  variable_name,
const T &  value = T(0) 
)
inline

Definition at line 20738 of file exprtk.hpp.

20739 {
20740 if (!valid())
20741 return false;
20742 else if (!valid_symbol(variable_name))
20743 return false;
20744 else if (symbol_exists(variable_name))
20745 return false;
20746
20747 local_data().local_symbol_list_.push_back(value);
20748 T& t = local_data().local_symbol_list_.back();
20749
20750 return add_variable(variable_name,t);
20751 }

References exprtk::symbol_table< T >::add_variable(), exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::local_symbol_list_, exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Referenced by main(), and exprtk::parser< T >::parse_symtab_symbol().

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

◆ function_count()

template<typename T >
std::size_t exprtk::symbol_table< T >::function_count ( ) const
inline

Definition at line 20563 of file exprtk.hpp.

20564 {
20565 if (valid())
20566 return local_data().function_store.size;
20567 else
20568 return 0;
20569 }

References exprtk::symbol_table< T >::control_block::st_data::function_store, exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::valid().

Here is the call graph for this function:

◆ get_conststr_stringvar_name()

template<typename T >
std::string exprtk::symbol_table< T >::get_conststr_stringvar_name ( const expression_ptr ptr) const
inline

Definition at line 21289 of file exprtk.hpp.

21290 {
21291 return local_data().stringvar_store.entity_name(ptr);
21292 }

References exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::control_block::st_data::stringvar_store.

Here is the call graph for this function:

◆ get_function()

template<typename T >
function_ptr exprtk::symbol_table< T >::get_function ( const std::string &  function_name) const
inline

Definition at line 20628 of file exprtk.hpp.

20629 {
20630 if (!valid())
20631 return reinterpret_cast<function_ptr>(0);
20632 else if (!valid_symbol(function_name))
20633 return reinterpret_cast<function_ptr>(0);
20634 else
20635 return local_data().function_store.get(function_name);
20636 }
function_t * function_ptr
Definition exprtk.hpp:20344

References exprtk::symbol_table< T >::control_block::st_data::function_store, exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Referenced by exprtk::symbol_table< T >::load_from(), and expression_processor< T >::process_function_definition().

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

◆ get_function_list() [1/2]

template<typename T >
std::vector< std::string > exprtk::symbol_table< T >::get_function_list ( ) const
inline

Definition at line 21184 of file exprtk.hpp.

21185 {
21186 std::vector<std::string> result;
21187 get_function_list(result);
21188 return result;
21189 }
std::vector< std::string > get_function_list() const
Definition exprtk.hpp:21184

References exprtk::symbol_table< T >::get_function_list().

Referenced by exprtk::symbol_table< T >::get_function_list().

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

◆ get_function_list() [2/2]

template<typename T >
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t exprtk::symbol_table< T >::get_function_list ( Sequence< std::string, Allocator > &  function_list) const
inline

Definition at line 21157 of file exprtk.hpp.

21158 {
21159 if (!valid())
21160 return 0;
21161
21162 std::vector<std::string> function_names;
21163 std::size_t count = 0;
21164
21165 count += local_data().function_store .get_list(function_names);
21166 count += local_data().vararg_function_store .get_list(function_names);
21167 count += local_data().generic_function_store .get_list(function_names);
21168 count += local_data().string_function_store .get_list(function_names);
21169 count += local_data().overload_function_store.get_list(function_names);
21170
21171 std::set<std::string> function_set;
21172
21173 for (std::size_t i = 0; i < function_names.size(); ++i)
21174 {
21175 function_set.insert(function_names[i]);
21176 }
21177
21178 std::copy(function_set.begin(), function_set.end(),
21179 std::back_inserter(function_list));
21180
21181 return count;
21182 }

References exprtk::symbol_table< T >::control_block::st_data::function_store, exprtk::symbol_table< T >::control_block::st_data::generic_function_store, exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::overload_function_store, exprtk::symbol_table< T >::control_block::st_data::string_function_store, exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::vararg_function_store.

Here is the call graph for this function:

◆ get_generic_function()

template<typename T >
generic_function_ptr exprtk::symbol_table< T >::get_generic_function ( const std::string &  function_name) const
inline

Definition at line 20648 of file exprtk.hpp.

20649 {
20650 if (!valid())
20651 return reinterpret_cast<generic_function_ptr>(0);
20652 else if (!valid_symbol(function_name))
20653 return reinterpret_cast<generic_function_ptr>(0);
20654 else
20655 return local_data().generic_function_store.get(function_name);
20656 }
generic_function_t * generic_function_ptr
Definition exprtk.hpp:20346

References exprtk::symbol_table< T >::control_block::st_data::generic_function_store, exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Referenced by exprtk::symbol_table< T >::load_from().

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

◆ get_overload_function()

template<typename T >
generic_function_ptr exprtk::symbol_table< T >::get_overload_function ( const std::string &  function_name) const
inline

Definition at line 20668 of file exprtk.hpp.

20669 {
20670 if (!valid())
20671 return reinterpret_cast<generic_function_ptr>(0);
20672 else if (!valid_symbol(function_name))
20673 return reinterpret_cast<generic_function_ptr>(0);
20674 else
20675 return local_data().overload_function_store.get(function_name);
20676 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::overload_function_store, exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Referenced by exprtk::symbol_table< T >::load_from().

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

◆ get_string_function()

template<typename T >
generic_function_ptr exprtk::symbol_table< T >::get_string_function ( const std::string &  function_name) const
inline

Definition at line 20658 of file exprtk.hpp.

20659 {
20660 if (!valid())
20661 return reinterpret_cast<generic_function_ptr>(0);
20662 else if (!valid_symbol(function_name))
20663 return reinterpret_cast<generic_function_ptr>(0);
20664 else
20665 return local_data().string_function_store.get(function_name);
20666 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::string_function_store, exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Referenced by exprtk::symbol_table< T >::load_from().

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

◆ get_stringvar()

template<typename T >
stringvar_ptr exprtk::symbol_table< T >::get_stringvar ( const std::string &  string_name) const
inline

Definition at line 20599 of file exprtk.hpp.

20600 {
20601 if (!valid())
20602 return reinterpret_cast<stringvar_ptr>(0);
20603 else if (!valid_symbol(string_name))
20604 return reinterpret_cast<stringvar_ptr>(0);
20605 else
20606 return local_data().stringvar_store.get(string_name);
20607 }
stringvar_t * stringvar_ptr
Definition exprtk.hpp:20339

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::stringvar_store, exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Referenced by run_test10().

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

◆ get_stringvar_base()

template<typename T >
stringvar_base< T > exprtk::symbol_table< T >::get_stringvar_base ( const std::string &  string_name) const
inline

Definition at line 20609 of file exprtk.hpp.

20610 {
20611 static stringvar_base<T> null_stringvar_base("",reinterpret_cast<stringvar_ptr>(0));
20612 if (!valid())
20613 return null_stringvar_base;
20614 else if (!valid_symbol(string_name))
20615 return null_stringvar_base;
20616
20617 stringvar_ptr stringvar = local_data().stringvar_store.get(string_name);
20618
20619 if (0 == stringvar)
20620 {
20621 return null_stringvar_base;
20622 }
20623
20624 return stringvar_base<T>(string_name,stringvar);
20625 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::stringvar_store, exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Here is the call graph for this function:

◆ get_stringvar_list() [1/2]

template<typename T >
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t exprtk::symbol_table< T >::get_stringvar_list ( Sequence< std::pair< std::string, std::string >, Allocator > &  svlist) const
inline

Definition at line 21126 of file exprtk.hpp.

21127 {
21128 if (!valid())
21129 return 0;
21130 else
21131 return local_data().stringvar_store.get_list(svlist);
21132 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::stringvar_store, and exprtk::symbol_table< T >::valid().

Referenced by run_test10().

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

◆ get_stringvar_list() [2/2]

template<typename T >
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t exprtk::symbol_table< T >::get_stringvar_list ( Sequence< std::string, Allocator > &  svlist) const
inline

Definition at line 21136 of file exprtk.hpp.

21137 {
21138 if (!valid())
21139 return 0;
21140 else
21141 return local_data().stringvar_store.get_list(svlist);
21142 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::stringvar_store, and exprtk::symbol_table< T >::valid().

Here is the call graph for this function:

◆ get_stringvar_name()

template<typename T >
std::string exprtk::symbol_table< T >::get_stringvar_name ( const expression_ptr ptr) const
inline

Definition at line 21284 of file exprtk.hpp.

21285 {
21286 return local_data().stringvar_store.entity_name(ptr);
21287 }

References exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::control_block::st_data::stringvar_store.

Here is the call graph for this function:

◆ get_vararg_function()

template<typename T >
vararg_function_ptr exprtk::symbol_table< T >::get_vararg_function ( const std::string &  vararg_function_name) const
inline

Definition at line 20638 of file exprtk.hpp.

20639 {
20640 if (!valid())
20641 return reinterpret_cast<vararg_function_ptr>(0);
20642 else if (!valid_symbol(vararg_function_name))
20643 return reinterpret_cast<vararg_function_ptr>(0);
20644 else
20645 return local_data().vararg_function_store.get(vararg_function_name);
20646 }
vararg_function_t * vararg_function_ptr
Definition exprtk.hpp:20345

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::vararg_function_store.

Referenced by exprtk::symbol_table< T >::load_from().

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

◆ get_variable() [1/2]

template<typename T >
variable_ptr exprtk::symbol_table< T >::get_variable ( const std::string &  variable_name) const
inline

Definition at line 20579 of file exprtk.hpp.

20580 {
20581 if (!valid())
20582 return reinterpret_cast<variable_ptr>(0);
20583 else if (!valid_symbol(variable_name))
20584 return reinterpret_cast<variable_ptr>(0);
20585 else
20586 return local_data().variable_store.get(variable_name);
20587 }
variable_t * variable_ptr
Definition exprtk.hpp:20336

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Referenced by exprtk::derivative(), exprtk::integrate(), exprtk::symbol_table< T >::load_variables_from(), run_test10(), exprtk::second_derivative(), and exprtk::third_derivative().

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

◆ get_variable() [2/2]

template<typename T >
variable_ptr exprtk::symbol_table< T >::get_variable ( const T &  var_ref) const
inline

Definition at line 20589 of file exprtk.hpp.

20590 {
20591 if (!valid())
20592 return reinterpret_cast<variable_ptr>(0);
20593 else
20594 return local_data().variable_store.get_from_varptr(
20595 reinterpret_cast<const void*>(&var_ref));
20596 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Here is the call graph for this function:

◆ get_variable_list() [1/2]

template<typename T >
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t exprtk::symbol_table< T >::get_variable_list ( Sequence< std::pair< std::string, T >, Allocator > &  vlist) const
inline

Definition at line 21105 of file exprtk.hpp.

21106 {
21107 if (!valid())
21108 return 0;
21109 else
21110 return local_data().variable_store.get_list(vlist);
21111 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Referenced by expression_processor< T >::list_symbols(), and run_test10().

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

◆ get_variable_list() [2/2]

template<typename T >
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t exprtk::symbol_table< T >::get_variable_list ( Sequence< std::string, Allocator > &  vlist) const
inline

Definition at line 21115 of file exprtk.hpp.

21116 {
21117 if (!valid())
21118 return 0;
21119 else
21120 return local_data().variable_store.get_list(vlist);
21121 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Here is the call graph for this function:

◆ get_variable_name()

template<typename T >
std::string exprtk::symbol_table< T >::get_variable_name ( const expression_ptr ptr) const
inline

Definition at line 21273 of file exprtk.hpp.

21274 {
21275 return local_data().variable_store.entity_name(ptr);
21276 }

References exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Here is the call graph for this function:

◆ get_vector()

template<typename T >
vector_holder_ptr exprtk::symbol_table< T >::get_vector ( const std::string &  vector_name) const
inline

Definition at line 20680 of file exprtk.hpp.

20681 {
20682 if (!valid())
20683 return reinterpret_cast<vector_holder_ptr>(0);
20684 else if (!valid_symbol(vector_name))
20685 return reinterpret_cast<vector_holder_ptr>(0);
20686 else
20687 return local_data().vector_store.get(vector_name);
20688 }
vector_holder_t * vector_holder_ptr
Definition exprtk.hpp:20678

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Referenced by exprtk::symbol_table< T >::load_vectors_from().

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

◆ get_vector_list()

template<typename T >
template<typename Allocator , template< typename, typename > class Sequence>
std::size_t exprtk::symbol_table< T >::get_vector_list ( Sequence< std::string, Allocator > &  vec_list) const
inline

Definition at line 21147 of file exprtk.hpp.

21148 {
21149 if (!valid())
21150 return 0;
21151 else
21152 return local_data().vector_store.get_list(vec_list);
21153 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Here is the call graph for this function:

◆ get_vector_name()

template<typename T >
std::string exprtk::symbol_table< T >::get_vector_name ( const vector_holder_ptr ptr) const
inline

Definition at line 21278 of file exprtk.hpp.

21279 {
21280 return local_data().vector_store.entity_name(ptr);
21281 }

References exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Here is the call graph for this function:

◆ is_constant_node()

template<typename T >
bool exprtk::symbol_table< T >::is_constant_node ( const std::string &  symbol_name) const
inline

Definition at line 20714 of file exprtk.hpp.

20715 {
20716 if (!valid())
20717 return false;
20718 else if (!valid_symbol(symbol_name))
20719 return false;
20720 else
20721 return local_data().variable_store.is_constant(symbol_name);
20722 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Here is the call graph for this function:

◆ is_constant_string()

template<typename T >
bool exprtk::symbol_table< T >::is_constant_string ( const std::string &  symbol_name) const
inline

Definition at line 20725 of file exprtk.hpp.

20726 {
20727 if (!valid())
20728 return false;
20729 else if (!valid_symbol(symbol_name))
20730 return false;
20731 else if (!local_data().stringvar_store.symbol_exists(symbol_name))
20732 return false;
20733 else
20734 return local_data().stringvar_store.is_constant(symbol_name);
20735 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::stringvar_store, exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Here is the call graph for this function:

◆ is_conststr_stringvar()

template<typename T >
bool exprtk::symbol_table< T >::is_conststr_stringvar ( const std::string &  symbol_name) const
inline

Definition at line 21233 of file exprtk.hpp.

21234 {
21235 if (!valid())
21236 return false;
21237 else if (!valid_symbol(symbol_name))
21238 return false;
21239 else if (!local_data().stringvar_store.symbol_exists(symbol_name))
21240 return false;
21241
21242 return (
21243 local_data().stringvar_store.symbol_exists(symbol_name) ||
21244 local_data().stringvar_store.is_constant (symbol_name)
21245 );
21246 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Here is the call graph for this function:

◆ is_function()

template<typename T >
bool exprtk::symbol_table< T >::is_function ( const std::string &  function_name) const
inline

Definition at line 21249 of file exprtk.hpp.

21250 {
21251 if (!valid())
21252 return false;
21253 else
21254 return local_data().function_store.symbol_exists(function_name);
21255 }

References exprtk::symbol_table< T >::control_block::st_data::function_store, exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::valid().

Referenced by exprtk::function_compositor< T >::symbol_used().

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

◆ is_stringvar()

template<typename T >
bool exprtk::symbol_table< T >::is_stringvar ( const std::string &  stringvar_name) const
inline

Definition at line 21225 of file exprtk.hpp.

21226 {
21227 if (!valid())
21228 return false;
21229 else
21230 return local_data().stringvar_store.symbol_exists(stringvar_name);
21231 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::stringvar_store, and exprtk::symbol_table< T >::valid().

Referenced by exprtk::function_compositor< T >::symbol_used().

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

◆ is_vararg_function()

template<typename T >
bool exprtk::symbol_table< T >::is_vararg_function ( const std::string &  vararg_function_name) const
inline

Definition at line 21257 of file exprtk.hpp.

21258 {
21259 if (!valid())
21260 return false;
21261 else
21262 return local_data().vararg_function_store.symbol_exists(vararg_function_name);
21263 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::vararg_function_store.

Referenced by exprtk::function_compositor< T >::symbol_used().

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

◆ is_variable()

template<typename T >
bool exprtk::symbol_table< T >::is_variable ( const std::string &  variable_name) const
inline

Definition at line 21216 of file exprtk.hpp.

21217 {
21218 if (!valid())
21219 return false;
21220 else
21221 return local_data().variable_store.symbol_exists(variable_name);
21222 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Referenced by exprtk::function_compositor< T >::symbol_used().

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

◆ is_vector()

template<typename T >
bool exprtk::symbol_table< T >::is_vector ( const std::string &  vector_name) const
inline

Definition at line 21265 of file exprtk.hpp.

21266 {
21267 if (!valid())
21268 return false;
21269 else
21270 return local_data().vector_store.symbol_exists(vector_name);
21271 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Referenced by exprtk::function_compositor< T >::symbol_used().

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

◆ load_from()

template<typename T >
void exprtk::symbol_table< T >::load_from ( const symbol_table< T > &  st)
inline

Definition at line 21301 of file exprtk.hpp.

21302 {
21303 {
21304 std::vector<std::string> name_list;
21305
21306 st.local_data().function_store.get_list(name_list);
21307
21308 if (!name_list.empty())
21309 {
21310 for (std::size_t i = 0; i < name_list.size(); ++i)
21311 {
21312 exprtk::ifunction<T>& ifunc = *st.get_function(name_list[i]);
21313 add_function(name_list[i],ifunc);
21314 }
21315 }
21316 }
21317
21318 {
21319 std::vector<std::string> name_list;
21320
21321 st.local_data().vararg_function_store.get_list(name_list);
21322
21323 if (!name_list.empty())
21324 {
21325 for (std::size_t i = 0; i < name_list.size(); ++i)
21326 {
21327 exprtk::ivararg_function<T>& ivafunc = *st.get_vararg_function(name_list[i]);
21328 add_function(name_list[i],ivafunc);
21329 }
21330 }
21331 }
21332
21333 {
21334 std::vector<std::string> name_list;
21335
21336 st.local_data().generic_function_store.get_list(name_list);
21337
21338 if (!name_list.empty())
21339 {
21340 for (std::size_t i = 0; i < name_list.size(); ++i)
21341 {
21342 exprtk::igeneric_function<T>& ifunc = *st.get_generic_function(name_list[i]);
21343 add_function(name_list[i],ifunc);
21344 }
21345 }
21346 }
21347
21348 {
21349 std::vector<std::string> name_list;
21350
21351 st.local_data().string_function_store.get_list(name_list);
21352
21353 if (!name_list.empty())
21354 {
21355 for (std::size_t i = 0; i < name_list.size(); ++i)
21356 {
21357 exprtk::igeneric_function<T>& ifunc = *st.get_string_function(name_list[i]);
21358 add_function(name_list[i],ifunc);
21359 }
21360 }
21361 }
21362
21363 {
21364 std::vector<std::string> name_list;
21365
21366 st.local_data().overload_function_store.get_list(name_list);
21367
21368 if (!name_list.empty())
21369 {
21370 for (std::size_t i = 0; i < name_list.size(); ++i)
21371 {
21372 exprtk::igeneric_function<T>& ifunc = *st.get_overload_function(name_list[i]);
21373 add_function(name_list[i],ifunc);
21374 }
21375 }
21376 }
21377 }
bool add_function(const std::string &function_name, function_t &function)
Definition exprtk.hpp:20811

References exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::control_block::st_data::function_store, exprtk::symbol_table< T >::control_block::st_data::generic_function_store, exprtk::symbol_table< T >::get_function(), exprtk::symbol_table< T >::get_generic_function(), exprtk::symbol_table< T >::get_overload_function(), exprtk::symbol_table< T >::get_string_function(), exprtk::symbol_table< T >::get_vararg_function(), exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::overload_function_store, exprtk::symbol_table< T >::control_block::st_data::string_function_store, and exprtk::symbol_table< T >::control_block::st_data::vararg_function_store.

Referenced by exprtk::function_compositor< T >::compile_expression().

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

◆ load_variables_from()

template<typename T >
void exprtk::symbol_table< T >::load_variables_from ( const symbol_table< T > &  st)
inline

Definition at line 21379 of file exprtk.hpp.

21380 {
21381 std::vector<std::string> name_list;
21382
21383 st.local_data().variable_store.get_list(name_list);
21384
21385 if (!name_list.empty())
21386 {
21387 for (std::size_t i = 0; i < name_list.size(); ++i)
21388 {
21389 T& variable = st.get_variable(name_list[i])->ref();
21390 add_variable(name_list[i], variable);
21391 }
21392 }
21393 }

References exprtk::symbol_table< T >::add_variable(), exprtk::symbol_table< T >::get_variable(), exprtk::symbol_table< T >::local_data(), exprtk::details::variable_node< T >::ref(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Referenced by exprtk::function_compositor< T >::compile_expression().

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

◆ load_vectors_from()

template<typename T >
void exprtk::symbol_table< T >::load_vectors_from ( const symbol_table< T > &  st)
inline

Definition at line 21395 of file exprtk.hpp.

21396 {
21397 std::vector<std::string> name_list;
21398
21399 st.local_data().vector_store.get_list(name_list);
21400
21401 if (!name_list.empty())
21402 {
21403 for (std::size_t i = 0; i < name_list.size(); ++i)
21404 {
21405 vector_holder_t& vecholder = *st.get_vector(name_list[i]);
21406 add_vector(name_list[i], vecholder.data(), vecholder.size());
21407 }
21408 }
21409 }
details::vector_holder< T > vector_holder_t
Definition exprtk.hpp:20335
bool add_vector(const std::string &vector_name, T(&v)[N])
Definition exprtk.hpp:20974

References exprtk::symbol_table< T >::add_vector(), exprtk::details::vector_holder< Type >::data(), exprtk::symbol_table< T >::get_vector(), exprtk::symbol_table< T >::local_data(), exprtk::details::vector_holder< Type >::size(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Referenced by exprtk::function_compositor< T >::compile_expression().

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

◆ local_data() [1/2]

template<typename T >
local_data_t & exprtk::symbol_table< T >::local_data ( )
inlineprivate

Definition at line 21467 of file exprtk.hpp.

21468 {
21469 return *(control_block_->data_);
21470 }

References exprtk::symbol_table< T >::control_block_, and exprtk::symbol_table< T >::control_block::data_.

Referenced by exprtk::symbol_table< T >::add_constant(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_stringvar(), exprtk::symbol_table< T >::add_variable(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::clear_functions(), exprtk::symbol_table< T >::clear_local_constants(), exprtk::symbol_table< T >::clear_strings(), exprtk::symbol_table< T >::clear_variables(), exprtk::symbol_table< T >::clear_vectors(), exprtk::symbol_table< T >::create_stringvar(), exprtk::symbol_table< T >::create_variable(), exprtk::symbol_table< T >::function_count(), exprtk::symbol_table< T >::get_conststr_stringvar_name(), exprtk::symbol_table< T >::get_function(), exprtk::symbol_table< T >::get_function_list(), exprtk::symbol_table< T >::get_generic_function(), exprtk::symbol_table< T >::get_overload_function(), exprtk::symbol_table< T >::get_string_function(), exprtk::symbol_table< T >::get_stringvar(), exprtk::symbol_table< T >::get_stringvar_base(), exprtk::symbol_table< T >::get_stringvar_list(), exprtk::symbol_table< T >::get_stringvar_list(), exprtk::symbol_table< T >::get_stringvar_name(), exprtk::symbol_table< T >::get_vararg_function(), exprtk::symbol_table< T >::get_variable(), exprtk::symbol_table< T >::get_variable(), exprtk::symbol_table< T >::get_variable_list(), exprtk::symbol_table< T >::get_variable_list(), exprtk::symbol_table< T >::get_variable_name(), exprtk::symbol_table< T >::get_vector(), exprtk::symbol_table< T >::get_vector_list(), exprtk::symbol_table< T >::get_vector_name(), exprtk::symbol_table< T >::is_constant_node(), exprtk::symbol_table< T >::is_constant_string(), exprtk::symbol_table< T >::is_conststr_stringvar(), exprtk::symbol_table< T >::is_function(), exprtk::symbol_table< T >::is_stringvar(), exprtk::symbol_table< T >::is_vararg_function(), exprtk::symbol_table< T >::is_variable(), exprtk::symbol_table< T >::is_vector(), exprtk::symbol_table< T >::load_from(), exprtk::symbol_table< T >::load_variables_from(), exprtk::symbol_table< T >::load_vectors_from(), exprtk::symbol_table< T >::remove_function(), exprtk::symbol_table< T >::remove_stringvar(), exprtk::symbol_table< T >::remove_vararg_function(), exprtk::symbol_table< T >::remove_variable(), exprtk::symbol_table< T >::remove_vector(), exprtk::symbol_table< T >::stringvar_count(), exprtk::symbol_table< T >::stringvar_ref(), exprtk::symbol_table< T >::symbol_exists(), exprtk::symbol_table< T >::valid_symbol(), exprtk::symbol_table< T >::variable_count(), exprtk::symbol_table< T >::variable_ref(), and exprtk::symbol_table< T >::vector_count().

Here is the caller graph for this function:

◆ local_data() [2/2]

template<typename T >
const local_data_t & exprtk::symbol_table< T >::local_data ( ) const
inlineprivate

Definition at line 21472 of file exprtk.hpp.

21473 {
21474 return *(control_block_->data_);
21475 }

References exprtk::symbol_table< T >::control_block_, and exprtk::symbol_table< T >::control_block::data_.

◆ mutability()

template<typename T >
symtab_mutability_type exprtk::symbol_table< T >::mutability ( ) const
inline

Definition at line 20503 of file exprtk.hpp.

20504 {
20506 }
symtab_mutability_type mutability_
Definition exprtk.hpp:20461

References exprtk::symbol_table< T >::control_block_, exprtk::symbol_table< T >::e_unknown, exprtk::symbol_table< T >::control_block::mutability_, and exprtk::symbol_table< T >::valid().

Referenced by exprtk::symbol_table< T >::control_block::set_mutability(), and exprtk::symbol_table< T >::symbol_table().

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

◆ operator=()

template<typename T >
symbol_table< T > & exprtk::symbol_table< T >::operator= ( const symbol_table< T > &  st)
inline

Definition at line 20485 of file exprtk.hpp.

20486 {
20487 if (this != &st)
20488 {
20489 control_block::destroy(control_block_,reinterpret_cast<symbol_table<T>*>(0));
20490
20491 control_block_ = st.control_block_;
20493 }
20494
20495 return (*this);
20496 }

References exprtk::symbol_table< T >::control_block_, exprtk::symbol_table< T >::control_block::destroy(), and exprtk::symbol_table< T >::control_block::ref_count.

Here is the call graph for this function:

◆ operator==()

template<typename T >
bool exprtk::symbol_table< T >::operator== ( const symbol_table< T > &  st) const
inline

Definition at line 20498 of file exprtk.hpp.

20499 {
20500 return (this == &st) || (control_block_ == st.control_block_);
20501 }

References exprtk::symbol_table< T >::control_block_.

◆ remove_function()

template<typename T >
bool exprtk::symbol_table< T >::remove_function ( const std::string &  function_name)
inline

Definition at line 21047 of file exprtk.hpp.

21048 {
21049 if (!valid())
21050 return false;
21051 else
21052 return local_data().function_store.remove(function_name);
21053 }

References exprtk::symbol_table< T >::control_block::st_data::function_store, exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::valid().

Referenced by expression_processor< T >::process_function_definition(), exprtk::function_compositor< T >::remove(), run_test10(), and run_test18().

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

◆ remove_stringvar()

template<typename T >
bool exprtk::symbol_table< T >::remove_stringvar ( const std::string &  string_name)
inline

Definition at line 21038 of file exprtk.hpp.

21039 {
21040 if (!valid())
21041 return false;
21042 else
21043 return local_data().stringvar_store.remove(string_name);
21044 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::stringvar_store, and exprtk::symbol_table< T >::valid().

Referenced by run_test10(), and run_test18().

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

◆ remove_vararg_function()

template<typename T >
bool exprtk::symbol_table< T >::remove_vararg_function ( const std::string &  vararg_function_name)
inline

Definition at line 21055 of file exprtk.hpp.

21056 {
21057 if (!valid())
21058 return false;
21059 else
21060 return local_data().vararg_function_store.remove(vararg_function_name);
21061 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::vararg_function_store.

Referenced by run_test18().

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

◆ remove_variable()

template<typename T >
bool exprtk::symbol_table< T >::remove_variable ( const std::string &  variable_name,
const bool  delete_node = true 
)
inline

Definition at line 21029 of file exprtk.hpp.

21030 {
21031 if (!valid())
21032 return false;
21033 else
21034 return local_data().variable_store.remove(variable_name, delete_node);
21035 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Referenced by run_test10(), and run_test18().

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

◆ remove_vector()

template<typename T >
bool exprtk::symbol_table< T >::remove_vector ( const std::string &  vector_name)
inline

Definition at line 21063 of file exprtk.hpp.

21064 {
21065 if (!valid())
21066 return false;
21067 else
21068 return local_data().vector_store.remove(vector_name);
21069 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Referenced by run_test18().

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

◆ stringvar_count()

template<typename T >
std::size_t exprtk::symbol_table< T >::stringvar_count ( ) const
inline

Definition at line 20554 of file exprtk.hpp.

20555 {
20556 if (valid())
20557 return local_data().stringvar_store.size;
20558 else
20559 return 0;
20560 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::stringvar_store, and exprtk::symbol_table< T >::valid().

Referenced by run_test10().

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

◆ stringvar_ref()

template<typename T >
std::string & exprtk::symbol_table< T >::stringvar_ref ( const std::string &  symbol_name)
inline

Definition at line 20702 of file exprtk.hpp.

20703 {
20704 static std::string null_stringvar;
20705 if (!valid())
20706 return null_stringvar;
20707 else if (!valid_symbol(symbol_name))
20708 return null_stringvar;
20709 else
20710 return local_data().stringvar_store.type_ref(symbol_name);
20711 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::control_block::st_data::stringvar_store, exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::valid_symbol().

Here is the call graph for this function:

◆ symbol_exists()

template<typename T >
bool exprtk::symbol_table< T >::symbol_exists ( const std::string &  symbol_name,
const bool  check_reserved_symb = true 
) const
inline

Definition at line 21191 of file exprtk.hpp.

21192 {
21193 /*
21194 Function will return true if symbol_name exists as either a
21195 reserved symbol, variable, stringvar, vector or function name
21196 in any of the type stores.
21197 */
21198 if (!valid())
21199 return false;
21200 else if (local_data().variable_store.symbol_exists(symbol_name))
21201 return true;
21202 #ifndef exprtk_disable_string_capabilities
21203 else if (local_data().stringvar_store.symbol_exists(symbol_name))
21204 return true;
21205 #endif
21206 else if (local_data().vector_store.symbol_exists(symbol_name))
21207 return true;
21208 else if (local_data().function_store.symbol_exists(symbol_name))
21209 return true;
21210 else if (check_reserved_symb && local_data().is_reserved_symbol(symbol_name))
21211 return true;
21212 else
21213 return false;
21214 }
bool is_reserved_symbol(const std::string &symbol)
Definition exprtk.hpp:529

References exprtk::symbol_table< T >::local_data(), and exprtk::symbol_table< T >::valid().

Referenced by exprtk::symbol_table< T >::add_constant(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_stringvar(), exprtk::symbol_table< T >::add_variable(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::create_stringvar(), exprtk::symbol_table< T >::create_variable(), and run_test10().

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

◆ valid()

template<typename T >
bool exprtk::symbol_table< T >::valid ( ) const
inline

Definition at line 21295 of file exprtk.hpp.

21296 {
21297 // Symbol table sanity check.
21299 }

References exprtk::symbol_table< T >::control_block_, and exprtk::symbol_table< T >::control_block::data_.

Referenced by exprtk::symbol_table< T >::add_constant(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_stringvar(), exprtk::symbol_table< T >::add_variable(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::clear(), exprtk::symbol_table< T >::create_stringvar(), exprtk::symbol_table< T >::create_variable(), exprtk::derivative(), exprtk::symbol_table< T >::function_count(), exprtk::symbol_table< T >::get_function(), exprtk::symbol_table< T >::get_function_list(), exprtk::symbol_table< T >::get_generic_function(), exprtk::symbol_table< T >::get_overload_function(), exprtk::symbol_table< T >::get_string_function(), exprtk::symbol_table< T >::get_stringvar(), exprtk::symbol_table< T >::get_stringvar_base(), exprtk::symbol_table< T >::get_stringvar_list(), exprtk::symbol_table< T >::get_stringvar_list(), exprtk::symbol_table< T >::get_vararg_function(), exprtk::symbol_table< T >::get_variable(), exprtk::symbol_table< T >::get_variable(), exprtk::symbol_table< T >::get_variable_list(), exprtk::symbol_table< T >::get_variable_list(), exprtk::symbol_table< T >::get_vector(), exprtk::symbol_table< T >::get_vector_list(), exprtk::integrate(), exprtk::symbol_table< T >::is_constant_node(), exprtk::symbol_table< T >::is_constant_string(), exprtk::symbol_table< T >::is_conststr_stringvar(), exprtk::symbol_table< T >::is_function(), exprtk::symbol_table< T >::is_stringvar(), exprtk::symbol_table< T >::is_vararg_function(), exprtk::symbol_table< T >::is_variable(), exprtk::symbol_table< T >::is_vector(), exprtk::symbol_table< T >::mutability(), exprtk::symbol_table< T >::remove_function(), exprtk::symbol_table< T >::remove_stringvar(), exprtk::symbol_table< T >::remove_vararg_function(), exprtk::symbol_table< T >::remove_variable(), exprtk::symbol_table< T >::remove_vector(), exprtk::second_derivative(), exprtk::symbol_table< T >::stringvar_count(), exprtk::symbol_table< T >::stringvar_ref(), exprtk::symbol_table< T >::symbol_exists(), exprtk::third_derivative(), exprtk::symbol_table< T >::variable_count(), exprtk::symbol_table< T >::variable_ref(), and exprtk::symbol_table< T >::vector_count().

Here is the caller graph for this function:

◆ valid_function()

template<typename T >
bool exprtk::symbol_table< T >::valid_function ( const std::string &  symbol) const
inlineprivate

Definition at line 21439 of file exprtk.hpp.

21440 {
21441 if (symbol.empty())
21442 return false;
21443 else if (!details::is_letter(symbol[0]))
21444 return false;
21445 else if (symbol.size() > 1)
21446 {
21447 for (std::size_t i = 1; i < symbol.size(); ++i)
21448 {
21449 if (
21450 !details::is_letter_or_digit(symbol[i]) &&
21451 ('_' != symbol[i])
21452 )
21453 {
21454 if ((i < (symbol.size() - 1)) && ('.' == symbol[i]))
21455 continue;
21456 else
21457 return false;
21458 }
21459 }
21460 }
21461
21462 return true;
21463 }
bool is_letter_or_digit(const char_t c)
Definition exprtk.hpp:137
bool is_letter(const char_t c)
Definition exprtk.hpp:126

References exprtk::details::is_letter(), and exprtk::details::is_letter_or_digit().

Here is the call graph for this function:

◆ valid_symbol()

template<typename T >
bool exprtk::symbol_table< T >::valid_symbol ( const std::string &  symbol,
const bool  check_reserved_symb = true 
) const
inlineprivate

Definition at line 21413 of file exprtk.hpp.

21414 {
21415 if (symbol.empty())
21416 return false;
21417 else if (!details::is_letter(symbol[0]))
21418 return false;
21419 else if (symbol.size() > 1)
21420 {
21421 for (std::size_t i = 1; i < symbol.size(); ++i)
21422 {
21423 if (
21424 !details::is_letter_or_digit(symbol[i]) &&
21425 ('_' != symbol[i])
21426 )
21427 {
21428 if ((i < (symbol.size() - 1)) && ('.' == symbol[i]))
21429 continue;
21430 else
21431 return false;
21432 }
21433 }
21434 }
21435
21436 return (check_reserved_symb) ? (!local_data().is_reserved_symbol(symbol)) : true;
21437 }
bool is_reserved_symbol(const std::string &symbol) const
Definition exprtk.hpp:20387

References exprtk::details::is_letter(), exprtk::details::is_letter_or_digit(), exprtk::symbol_table< T >::control_block::st_data::is_reserved_symbol(), and exprtk::symbol_table< T >::local_data().

Referenced by exprtk::symbol_table< T >::add_constant(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_reserved_function(), exprtk::symbol_table< T >::add_stringvar(), exprtk::symbol_table< T >::add_variable(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::add_vector(), exprtk::symbol_table< T >::create_stringvar(), exprtk::symbol_table< T >::create_variable(), exprtk::symbol_table< T >::get_function(), exprtk::symbol_table< T >::get_generic_function(), exprtk::symbol_table< T >::get_overload_function(), exprtk::symbol_table< T >::get_string_function(), exprtk::symbol_table< T >::get_stringvar(), exprtk::symbol_table< T >::get_stringvar_base(), exprtk::symbol_table< T >::get_vararg_function(), exprtk::symbol_table< T >::get_variable(), exprtk::symbol_table< T >::get_vector(), exprtk::symbol_table< T >::is_constant_node(), exprtk::symbol_table< T >::is_constant_string(), exprtk::symbol_table< T >::is_conststr_stringvar(), exprtk::symbol_table< T >::stringvar_ref(), and exprtk::symbol_table< T >::variable_ref().

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

◆ variable_count()

template<typename T >
std::size_t exprtk::symbol_table< T >::variable_count ( ) const
inline

Definition at line 20545 of file exprtk.hpp.

20546 {
20547 if (valid())
20548 return local_data().variable_store.size;
20549 else
20550 return 0;
20551 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Here is the call graph for this function:

◆ variable_ref()

template<typename T >
T & exprtk::symbol_table< T >::variable_ref ( const std::string &  symbol_name)
inline

Definition at line 20690 of file exprtk.hpp.

20691 {
20692 static T null_var = T(0);
20693 if (!valid())
20694 return null_var;
20695 else if (!valid_symbol(symbol_name))
20696 return null_var;
20697 else
20698 return local_data().variable_store.type_ref(symbol_name);
20699 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), exprtk::symbol_table< T >::valid_symbol(), and exprtk::symbol_table< T >::control_block::st_data::variable_store.

Here is the call graph for this function:

◆ vector_count()

template<typename T >
std::size_t exprtk::symbol_table< T >::vector_count ( ) const
inline

Definition at line 20571 of file exprtk.hpp.

20572 {
20573 if (valid())
20574 return local_data().vector_store.size;
20575 else
20576 return 0;
20577 }

References exprtk::symbol_table< T >::local_data(), exprtk::symbol_table< T >::valid(), and exprtk::symbol_table< T >::control_block::st_data::vector_store.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ parser< T >

template<typename T >
friend class parser< T >
friend

Definition at line 21477 of file exprtk.hpp.

Member Data Documentation

◆ control_block_

template<typename T >
control_block* exprtk::symbol_table< T >::control_block_
private

◆ lut_size

template<typename T >
const std::size_t exprtk::symbol_table< T >::lut_size = 256
staticprotected

Definition at line 20348 of file exprtk.hpp.


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