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

◆ ff00_functor

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

Definition at line 20020 of file exprtk.hpp.

◆ ff01_functor

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

Definition at line 20021 of file exprtk.hpp.

◆ ff02_functor

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

Definition at line 20022 of file exprtk.hpp.

◆ ff03_functor

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

Definition at line 20023 of file exprtk.hpp.

◆ ff04_functor

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

Definition at line 20024 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 20025 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 20026 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 20027 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 20028 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 20029 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 20030 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 20031 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 20032 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 20033 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 20034 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 20035 of file exprtk.hpp.

◆ function_ptr

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

Definition at line 20609 of file exprtk.hpp.

◆ function_t

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

Definition at line 20606 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 20611 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 20608 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 21730 of file exprtk.hpp.

◆ stringvar_ptr

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

Definition at line 20604 of file exprtk.hpp.

◆ stringvar_t

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

Definition at line 20603 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 20610 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 20607 of file exprtk.hpp.

◆ variable_ptr

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

Definition at line 20601 of file exprtk.hpp.

◆ variable_t

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

Definition at line 20599 of file exprtk.hpp.

◆ vector_holder_ptr

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

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

Member Enumeration Documentation

◆ symtab_mutability_type

Enumerator
e_unknown 
e_mutable 
e_immutable 

Definition at line 20013 of file exprtk.hpp.

20014 {
20015 e_unknown = 0,
20016 e_mutable = 1,
20017 e_immutable = 2
20018 };

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

20733 {
20735 clear();
20736 }
symtab_mutability_type mutability() const
Definition exprtk.hpp:20768
control_block * control_block_
Definition exprtk.hpp:21742
static control_block * create()
Definition exprtk.hpp:20694
void set_mutability(const symtab_mutability_type mutability)
Definition exprtk.hpp:20719

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

20739 {
20740 exprtk::details::dump_ptr("~symbol_table", this);
20742 }
void dump_ptr(const std::string &, const void *)
Definition exprtk.hpp:5291
static void destroy(control_block *&cntrl_blck, SymTab *sym_tab)
Definition exprtk.hpp:20700

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

20745 {
20746 control_block_ = st.control_block_;
20748 }

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

21048 {
21049 if (!valid())
21050 return false;
21051 else if (!valid_symbol(constant_name))
21052 return false;
21053 else if (symbol_exists(constant_name))
21054 return false;
21055
21056 local_data().local_symbol_list_.push_back(value);
21057 T& t = local_data().local_symbol_list_.back();
21058
21059 return add_variable(constant_name, t, true);
21060 }
bool valid_symbol(const std::string &symbol, const bool check_reserved_symb=true) const
Definition exprtk.hpp:21678
local_data_t & local_data()
Definition exprtk.hpp:21732
bool add_variable(const std::string &variable_name, T &t, const bool is_constant=false)
Definition exprtk.hpp:21035
bool valid() const
Definition exprtk.hpp:21560
bool symbol_exists(const std::string &symbol_name, const bool check_reserved_symb=true) const
Definition exprtk.hpp:21456

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(), black_scholes_merton_model(), 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 21336 of file exprtk.hpp.

21337 {
21338 return add_pi () &&
21339 add_epsilon () &&
21340 add_infinity() ;
21341 }

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

21351 {
21352 static const T local_epsilon = details::numeric::details::epsilon_type<T>::value();
21353 return add_constant("epsilon",local_epsilon);
21354 }
bool add_constant(const std::string &constant_name, const T &value)
Definition exprtk.hpp:21047

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 21146 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 21146 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 21147 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 21147 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 21148 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 21148 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 21149 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 21149 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 21150 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 21150 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 21151 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 21151 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 21152 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 21152 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 21153 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 21153 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 21076 of file exprtk.hpp.

21077 {
21078 if (!valid())
21079 return false;
21080 else if (!valid_symbol(function_name))
21081 return false;
21082 else if (symbol_exists(function_name))
21083 return false;
21084 else
21085 return local_data().function_store.add(function_name,function);
21086 }
type_store< function_t, function_t > function_store
Definition exprtk.hpp:20621

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 black_scholes_merton_model(), 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 21100 of file exprtk.hpp.

21101 {
21102 if (!valid())
21103 return false;
21104 else if (!valid_symbol(function_name))
21105 return false;
21106 else if (symbol_exists(function_name))
21107 return false;
21108 else
21109 {
21110 switch (function.rtrn_type)
21111 {
21113 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|")) ?
21114 local_data().generic_function_store.add(function_name,function) : false;
21115
21117 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|")) ?
21118 local_data().string_function_store.add(function_name,function) : false;
21119
21121 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|:")) ?
21122 local_data().overload_function_store.add(function_name,function) : false;
21123 }
21124 }
21125
21126 return false;
21127 }
type_store< generic_function_t, generic_function_t > string_function_store
Definition exprtk.hpp:20624
type_store< generic_function_t, generic_function_t > overload_function_store
Definition exprtk.hpp:20625
type_store< generic_function_t, generic_function_t > generic_function_store
Definition exprtk.hpp:20623

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

21089 {
21090 if (!valid())
21091 return false;
21092 else if (!valid_symbol(vararg_function_name))
21093 return false;
21094 else if (symbol_exists(vararg_function_name))
21095 return false;
21096 else
21097 return local_data().vararg_function_store.add(vararg_function_name,vararg_function);
21098 }
type_store< vararg_function_t, vararg_function_t > vararg_function_store
Definition exprtk.hpp:20622

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

21357 {
21358 static const T local_infinity = std::numeric_limits<T>::infinity();
21359 return add_constant("inf",local_infinity);
21360 }

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

21364 {
21365 return package.register_package(*this);
21366 }

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

21344 {
21346 static const T local_pi = details::numeric::details::const_pi_impl<T>(num_type);
21347 return add_constant("pi",local_pi);
21348 }

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 21227 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 21227 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 21228 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 21228 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 21229 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 21229 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 21230 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 21230 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 21231 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 21231 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 21232 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 21232 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 21233 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 21233 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 21234 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 21234 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 21157 of file exprtk.hpp.

21158 {
21159 if (!valid())
21160 return false;
21161 else if (!valid_symbol(function_name,false))
21162 return false;
21163 else if (symbol_exists(function_name,false))
21164 return false;
21165 else
21166 return local_data().function_store.add(function_name,function);
21167 }

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

21182 {
21183 if (!valid())
21184 return false;
21185 else if (!valid_symbol(function_name,false))
21186 return false;
21187 else if (symbol_exists(function_name,false))
21188 return false;
21189 else
21190 {
21191 switch (function.rtrn_type)
21192 {
21194 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|")) ?
21195 local_data().generic_function_store.add(function_name,function) : false;
21196
21198 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|")) ?
21199 local_data().string_function_store.add(function_name,function) : false;
21200
21202 return (std::string::npos == function.parameter_sequence.find_first_not_of("STVZ*?|:")) ?
21203 local_data().overload_function_store.add(function_name,function) : false;
21204 }
21205 }
21206
21207 return false;
21208 }

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

21170 {
21171 if (!valid())
21172 return false;
21173 else if (!valid_symbol(vararg_function_name,false))
21174 return false;
21175 else if (symbol_exists(vararg_function_name,false))
21176 return false;
21177 else
21178 return local_data().vararg_function_store.add(vararg_function_name,vararg_function);
21179 }

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

21064 {
21065 if (!valid())
21066 return false;
21067 else if (!valid_symbol(stringvar_name))
21068 return false;
21069 else if (symbol_exists(stringvar_name))
21070 return false;
21071 else
21072 return local_data().stringvar_store.add(stringvar_name, s, is_constant);
21073 }
type_store< stringvar_t, std::string > stringvar_store
Definition exprtk.hpp:20628

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 black_scholes_merton_model(), 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 21035 of file exprtk.hpp.

21036 {
21037 if (!valid())
21038 return false;
21039 else if (!valid_symbol(variable_name))
21040 return false;
21041 else if (symbol_exists(variable_name))
21042 return false;
21043 else
21044 return local_data().variable_store.add(variable_name, t, is_constant);
21045 }
type_store< variable_t, T > variable_store
Definition exprtk.hpp:20620

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(), black_scholes_merton_model(), 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 21280 of file exprtk.hpp.

21281 {
21282 if (!valid())
21283 return false;
21284 else if (!valid_symbol(vector_name))
21285 return false;
21286 else if (symbol_exists(vector_name))
21287 return false;
21288 else if (0 == v.size())
21289 return false;
21290 else
21291 return local_data().vector_store.add(vector_name,v);
21292 }
std::size_t size() const
Definition exprtk.hpp:4673
type_store< vector_holder_t, vector_holder_t > vector_store
Definition exprtk.hpp:20626

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

21267 {
21268 if (!valid())
21269 return false;
21270 else if (!valid_symbol(vector_name))
21271 return false;
21272 else if (symbol_exists(vector_name))
21273 return false;
21274 else if (0 == v.size())
21275 return false;
21276 else
21277 return local_data().vector_store.add(vector_name,v);
21278 }

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

21252 {
21253 if (!valid())
21254 return false;
21255 else if (!valid_symbol(vector_name))
21256 return false;
21257 else if (symbol_exists(vector_name))
21258 return false;
21259 else if (0 == v_size)
21260 return false;
21261 else
21262 return local_data().vector_store.add(vector_name, v, v_size);
21263 }

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

21240 {
21241 if (!valid())
21242 return false;
21243 else if (!valid_symbol(vector_name))
21244 return false;
21245 else if (symbol_exists(vector_name))
21246 return false;
21247 else
21248 return local_data().vector_store.add(vector_name,v);
21249 }

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

20801 {
20802 if (!valid()) return;
20803 clear_variables ();
20804 clear_functions ();
20805 clear_strings ();
20806 clear_vectors ();
20808 }
void clear_variables(const bool delete_node=true)
Definition exprtk.hpp:20773

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

20779 {
20780 local_data().function_store.clear();
20781 }

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

20796 {
20798 }

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

20784 {
20785 #ifndef exprtk_disable_string_capabilities
20786 local_data().stringvar_store.clear();
20787 #endif
20788 }

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

20774 {
20775 local_data().variable_store.clear(delete_node);
20776 }

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

20791 {
20792 local_data().vector_store.clear();
20793 }

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

21020 {
21021 if (!valid())
21022 return false;
21023 else if (!valid_symbol(stringvar_name))
21024 return false;
21025 else if (symbol_exists(stringvar_name))
21026 return false;
21027
21028 local_data().local_stringvar_list_.push_back(value);
21029 std::string& s = local_data().local_stringvar_list_.back();
21030
21031 return add_stringvar(stringvar_name,s);
21032 }
bool add_stringvar(const std::string &stringvar_name, std::string &s, const bool is_constant=false)
Definition exprtk.hpp:21063
std::list< std::string > local_stringvar_list_
Definition exprtk.hpp:20669

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

21004 {
21005 if (!valid())
21006 return false;
21007 else if (!valid_symbol(variable_name))
21008 return false;
21009 else if (symbol_exists(variable_name))
21010 return false;
21011
21012 local_data().local_symbol_list_.push_back(value);
21013 T& t = local_data().local_symbol_list_.back();
21014
21015 return add_variable(variable_name,t);
21016 }

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

20829 {
20830 if (valid())
20831 return local_data().function_store.size;
20832 else
20833 return 0;
20834 }

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

21555 {
21556 return local_data().stringvar_store.entity_name(ptr);
21557 }

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

20894 {
20895 if (!valid())
20896 return reinterpret_cast<function_ptr>(0);
20897 else if (!valid_symbol(function_name))
20898 return reinterpret_cast<function_ptr>(0);
20899 else
20900 return local_data().function_store.get(function_name);
20901 }
function_t * function_ptr
Definition exprtk.hpp:20609

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

21450 {
21451 std::vector<std::string> result;
21452 get_function_list(result);
21453 return result;
21454 }
std::vector< std::string > get_function_list() const
Definition exprtk.hpp:21449

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

21423 {
21424 if (!valid())
21425 return 0;
21426
21427 std::vector<std::string> function_names;
21428 std::size_t count = 0;
21429
21430 count += local_data().function_store .get_list(function_names);
21431 count += local_data().vararg_function_store .get_list(function_names);
21432 count += local_data().generic_function_store .get_list(function_names);
21433 count += local_data().string_function_store .get_list(function_names);
21434 count += local_data().overload_function_store.get_list(function_names);
21435
21436 std::set<std::string> function_set;
21437
21438 for (std::size_t i = 0; i < function_names.size(); ++i)
21439 {
21440 function_set.insert(function_names[i]);
21441 }
21442
21443 std::copy(function_set.begin(), function_set.end(),
21444 std::back_inserter(function_list));
21445
21446 return count;
21447 }

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

20914 {
20915 if (!valid())
20916 return reinterpret_cast<generic_function_ptr>(0);
20917 else if (!valid_symbol(function_name))
20918 return reinterpret_cast<generic_function_ptr>(0);
20919 else
20920 return local_data().generic_function_store.get(function_name);
20921 }
generic_function_t * generic_function_ptr
Definition exprtk.hpp:20611

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

20934 {
20935 if (!valid())
20936 return reinterpret_cast<generic_function_ptr>(0);
20937 else if (!valid_symbol(function_name))
20938 return reinterpret_cast<generic_function_ptr>(0);
20939 else
20940 return local_data().overload_function_store.get(function_name);
20941 }

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

20924 {
20925 if (!valid())
20926 return reinterpret_cast<generic_function_ptr>(0);
20927 else if (!valid_symbol(function_name))
20928 return reinterpret_cast<generic_function_ptr>(0);
20929 else
20930 return local_data().string_function_store.get(function_name);
20931 }

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

20865 {
20866 if (!valid())
20867 return reinterpret_cast<stringvar_ptr>(0);
20868 else if (!valid_symbol(string_name))
20869 return reinterpret_cast<stringvar_ptr>(0);
20870 else
20871 return local_data().stringvar_store.get(string_name);
20872 }
stringvar_t * stringvar_ptr
Definition exprtk.hpp:20604

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

20875 {
20876 static stringvar_base<T> null_stringvar_base("",reinterpret_cast<stringvar_ptr>(0));
20877 if (!valid())
20878 return null_stringvar_base;
20879 else if (!valid_symbol(string_name))
20880 return null_stringvar_base;
20881
20882 stringvar_ptr stringvar = local_data().stringvar_store.get(string_name);
20883
20884 if (0 == stringvar)
20885 {
20886 return null_stringvar_base;
20887 }
20888
20889 return stringvar_base<T>(string_name,stringvar);
20890 }

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

21392 {
21393 if (!valid())
21394 return 0;
21395 else
21396 return local_data().stringvar_store.get_list(svlist);
21397 }

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

21402 {
21403 if (!valid())
21404 return 0;
21405 else
21406 return local_data().stringvar_store.get_list(svlist);
21407 }

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

21550 {
21551 return local_data().stringvar_store.entity_name(ptr);
21552 }

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

20904 {
20905 if (!valid())
20906 return reinterpret_cast<vararg_function_ptr>(0);
20907 else if (!valid_symbol(vararg_function_name))
20908 return reinterpret_cast<vararg_function_ptr>(0);
20909 else
20910 return local_data().vararg_function_store.get(vararg_function_name);
20911 }
vararg_function_t * vararg_function_ptr
Definition exprtk.hpp:20610

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

20845 {
20846 if (!valid())
20847 return reinterpret_cast<variable_ptr>(0);
20848 else if (!valid_symbol(variable_name))
20849 return reinterpret_cast<variable_ptr>(0);
20850 else
20851 return local_data().variable_store.get(variable_name);
20852 }
variable_t * variable_ptr
Definition exprtk.hpp:20601

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

20855 {
20856 if (!valid())
20857 return reinterpret_cast<variable_ptr>(0);
20858 else
20859 return local_data().variable_store.get_from_varptr(
20860 reinterpret_cast<const void*>(&var_ref));
20861 }

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

21371 {
21372 if (!valid())
21373 return 0;
21374 else
21375 return local_data().variable_store.get_list(vlist);
21376 }

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

21381 {
21382 if (!valid())
21383 return 0;
21384 else
21385 return local_data().variable_store.get_list(vlist);
21386 }

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

21539 {
21540 return local_data().variable_store.entity_name(ptr);
21541 }

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

20946 {
20947 if (!valid())
20948 return reinterpret_cast<vector_holder_ptr>(0);
20949 else if (!valid_symbol(vector_name))
20950 return reinterpret_cast<vector_holder_ptr>(0);
20951 else
20952 return local_data().vector_store.get(vector_name);
20953 }
vector_holder_t * vector_holder_ptr
Definition exprtk.hpp:20943

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

21413 {
21414 if (!valid())
21415 return 0;
21416 else
21417 return local_data().vector_store.get_list(vec_list);
21418 }

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

21544 {
21545 return local_data().vector_store.entity_name(ptr);
21546 }

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

20980 {
20981 if (!valid())
20982 return false;
20983 else if (!valid_symbol(symbol_name))
20984 return false;
20985 else
20986 return local_data().variable_store.is_constant(symbol_name);
20987 }

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

20991 {
20992 if (!valid())
20993 return false;
20994 else if (!valid_symbol(symbol_name))
20995 return false;
20996 else if (!local_data().stringvar_store.symbol_exists(symbol_name))
20997 return false;
20998 else
20999 return local_data().stringvar_store.is_constant(symbol_name);
21000 }

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

21499 {
21500 if (!valid())
21501 return false;
21502 else if (!valid_symbol(symbol_name))
21503 return false;
21504 else if (!local_data().stringvar_store.symbol_exists(symbol_name))
21505 return false;
21506
21507 return (
21508 local_data().stringvar_store.symbol_exists(symbol_name) ||
21509 local_data().stringvar_store.is_constant (symbol_name)
21510 );
21511 }

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

21515 {
21516 if (!valid())
21517 return false;
21518 else
21519 return local_data().function_store.symbol_exists(function_name);
21520 }

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

21491 {
21492 if (!valid())
21493 return false;
21494 else
21495 return local_data().stringvar_store.symbol_exists(stringvar_name);
21496 }

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

21523 {
21524 if (!valid())
21525 return false;
21526 else
21527 return local_data().vararg_function_store.symbol_exists(vararg_function_name);
21528 }

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

21482 {
21483 if (!valid())
21484 return false;
21485 else
21486 return local_data().variable_store.symbol_exists(variable_name);
21487 }

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

21531 {
21532 if (!valid())
21533 return false;
21534 else
21535 return local_data().vector_store.symbol_exists(vector_name);
21536 }

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

21567 {
21568 {
21569 std::vector<std::string> name_list;
21570
21571 st.local_data().function_store.get_list(name_list);
21572
21573 if (!name_list.empty())
21574 {
21575 for (std::size_t i = 0; i < name_list.size(); ++i)
21576 {
21577 exprtk::ifunction<T>& ifunc = *st.get_function(name_list[i]);
21578 add_function(name_list[i],ifunc);
21579 }
21580 }
21581 }
21582
21583 {
21584 std::vector<std::string> name_list;
21585
21586 st.local_data().vararg_function_store.get_list(name_list);
21587
21588 if (!name_list.empty())
21589 {
21590 for (std::size_t i = 0; i < name_list.size(); ++i)
21591 {
21592 exprtk::ivararg_function<T>& ivafunc = *st.get_vararg_function(name_list[i]);
21593 add_function(name_list[i],ivafunc);
21594 }
21595 }
21596 }
21597
21598 {
21599 std::vector<std::string> name_list;
21600
21601 st.local_data().generic_function_store.get_list(name_list);
21602
21603 if (!name_list.empty())
21604 {
21605 for (std::size_t i = 0; i < name_list.size(); ++i)
21606 {
21607 exprtk::igeneric_function<T>& ifunc = *st.get_generic_function(name_list[i]);
21608 add_function(name_list[i],ifunc);
21609 }
21610 }
21611 }
21612
21613 {
21614 std::vector<std::string> name_list;
21615
21616 st.local_data().string_function_store.get_list(name_list);
21617
21618 if (!name_list.empty())
21619 {
21620 for (std::size_t i = 0; i < name_list.size(); ++i)
21621 {
21622 exprtk::igeneric_function<T>& ifunc = *st.get_string_function(name_list[i]);
21623 add_function(name_list[i],ifunc);
21624 }
21625 }
21626 }
21627
21628 {
21629 std::vector<std::string> name_list;
21630
21631 st.local_data().overload_function_store.get_list(name_list);
21632
21633 if (!name_list.empty())
21634 {
21635 for (std::size_t i = 0; i < name_list.size(); ++i)
21636 {
21637 exprtk::igeneric_function<T>& ifunc = *st.get_overload_function(name_list[i]);
21638 add_function(name_list[i],ifunc);
21639 }
21640 }
21641 }
21642 }
bool add_function(const std::string &function_name, function_t &function)
Definition exprtk.hpp:21076

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

21645 {
21646 std::vector<std::string> name_list;
21647
21648 st.local_data().variable_store.get_list(name_list);
21649
21650 if (!name_list.empty())
21651 {
21652 for (std::size_t i = 0; i < name_list.size(); ++i)
21653 {
21654 T& variable = st.get_variable(name_list[i])->ref();
21655 add_variable(name_list[i], variable);
21656 }
21657 }
21658 }

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

21661 {
21662 std::vector<std::string> name_list;
21663
21664 st.local_data().vector_store.get_list(name_list);
21665
21666 if (!name_list.empty())
21667 {
21668 for (std::size_t i = 0; i < name_list.size(); ++i)
21669 {
21670 vector_holder_t& vecholder = *st.get_vector(name_list[i]);
21671 add_vector(name_list[i], vecholder.data(), vecholder.size());
21672 }
21673 }
21674 }
details::vector_holder< T > vector_holder_t
Definition exprtk.hpp:20600
bool add_vector(const std::string &vector_name, T(&v)[N])
Definition exprtk.hpp:21239

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

21733 {
21734 return *(control_block_->data_);
21735 }

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

21738 {
21739 return *(control_block_->data_);
21740 }

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

20769 {
20771 }
symtab_mutability_type mutability_
Definition exprtk.hpp:20726

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

20751 {
20752 if (this != &st)
20753 {
20754 control_block::destroy(control_block_,reinterpret_cast<symbol_table<T>*>(0));
20755
20756 control_block_ = st.control_block_;
20758 }
20759
20760 return (*this);
20761 }

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

20764 {
20765 return (this == &st) || (control_block_ == st.control_block_);
20766 }

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

21313 {
21314 if (!valid())
21315 return false;
21316 else
21317 return local_data().function_store.remove(function_name);
21318 }

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

21304 {
21305 if (!valid())
21306 return false;
21307 else
21308 return local_data().stringvar_store.remove(string_name);
21309 }

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

21321 {
21322 if (!valid())
21323 return false;
21324 else
21325 return local_data().vararg_function_store.remove(vararg_function_name);
21326 }

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

21295 {
21296 if (!valid())
21297 return false;
21298 else
21299 return local_data().variable_store.remove(variable_name, delete_node);
21300 }

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

21329 {
21330 if (!valid())
21331 return false;
21332 else
21333 return local_data().vector_store.remove(vector_name);
21334 }

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

20820 {
20821 if (valid())
20822 return local_data().stringvar_store.size;
20823 else
20824 return 0;
20825 }

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

20968 {
20969 static std::string null_stringvar;
20970 if (!valid())
20971 return null_stringvar;
20972 else if (!valid_symbol(symbol_name))
20973 return null_stringvar;
20974 else
20975 return local_data().stringvar_store.type_ref(symbol_name);
20976 }

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

21457 {
21458 /*
21459 Function will return true if symbol_name exists as either a
21460 reserved symbol, variable, stringvar, vector or function name
21461 in any of the type stores.
21462 */
21463 if (!valid())
21464 return false;
21465 else if (local_data().variable_store.symbol_exists(symbol_name))
21466 return true;
21467 #ifndef exprtk_disable_string_capabilities
21468 else if (local_data().stringvar_store.symbol_exists(symbol_name))
21469 return true;
21470 #endif
21471 else if (local_data().vector_store.symbol_exists(symbol_name))
21472 return true;
21473 else if (local_data().function_store.symbol_exists(symbol_name))
21474 return true;
21475 else if (check_reserved_symb && local_data().is_reserved_symbol(symbol_name))
21476 return true;
21477 else
21478 return false;
21479 }
bool is_reserved_symbol(const std::string &symbol)
Definition exprtk.hpp:536

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

21561 {
21562 // Symbol table sanity check.
21564 }

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

21705 {
21706 if (symbol.empty())
21707 return false;
21708 else if (!details::is_letter(symbol[0]))
21709 return false;
21710 else if (symbol.size() > 1)
21711 {
21712 for (std::size_t i = 1; i < symbol.size(); ++i)
21713 {
21714 if (
21715 !details::is_letter_or_digit(symbol[i]) &&
21716 ('_' != symbol[i])
21717 )
21718 {
21719 if ((i < (symbol.size() - 1)) && ('.' == symbol[i]))
21720 continue;
21721 else
21722 return false;
21723 }
21724 }
21725 }
21726
21727 return true;
21728 }
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 21678 of file exprtk.hpp.

21679 {
21680 if (symbol.empty())
21681 return false;
21682 else if (!details::is_letter(symbol[0]))
21683 return false;
21684 else if (symbol.size() > 1)
21685 {
21686 for (std::size_t i = 1; i < symbol.size(); ++i)
21687 {
21688 if (
21689 !details::is_letter_or_digit(symbol[i]) &&
21690 ('_' != symbol[i])
21691 )
21692 {
21693 if ((i < (symbol.size() - 1)) && ('.' == symbol[i]))
21694 continue;
21695 else
21696 return false;
21697 }
21698 }
21699 }
21700
21701 return (check_reserved_symb) ? (!local_data().is_reserved_symbol(symbol)) : true;
21702 }
bool is_reserved_symbol(const std::string &symbol) const
Definition exprtk.hpp:20652

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

20811 {
20812 if (valid())
20813 return local_data().variable_store.size;
20814 else
20815 return 0;
20816 }

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

20956 {
20957 static T null_var = T(0);
20958 if (!valid())
20959 return null_var;
20960 else if (!valid_symbol(symbol_name))
20961 return null_var;
20962 else
20963 return local_data().variable_store.type_ref(symbol_name);
20964 }

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

20837 {
20838 if (valid())
20839 return local_data().vector_store.size;
20840 else
20841 return 0;
20842 }

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


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