#include <exprtk.hpp>
Classes | |
struct | st_holder |
struct | type_store |
Public Types | |
enum | func_type { e_ft_unknown = 0, e_ft_basicfunc = 1, e_ft_strfunc = 2 } |
typedef vector_holder_t * | vector_holder_ptr |
Public Member Functions | |
symbol_table () | |
~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) |
void | clear_variables (const bool delete_node=true) |
void | clear_functions () |
void | clear_strings () |
void | clear_vectors () |
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 |
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 |
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, const func_type ft=e_ft_basicfunc) |
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, const func_type ft=e_ft_basicfunc) |
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) |
template<typename Allocator > | |
bool | add_vector (const std::string &vector_name, std::deque< T, Allocator > &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 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 > &vlist) 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) |
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_t * | variable_ptr |
typedef details::stringvar_node< T > | stringvar_t |
typedef stringvar_t * | stringvar_ptr |
typedef ifunction< T > | function_t |
typedef ivararg_function< T > | vararg_function_t |
typedef igeneric_function< T > | generic_function_t |
typedef function_t * | function_ptr |
typedef vararg_function_t * | vararg_function_ptr |
typedef generic_function_t * | generic_function_ptr |
Static Protected Attributes | |
static const std::size_t | lut_size = 256 |
Friends | |
class | parser< T > |
typedef details::expression_node<T>* exprtk::symbol_table< T >::expression_ptr [protected] |
typedef function_t* exprtk::symbol_table< T >::function_ptr [protected] |
typedef ifunction<T> exprtk::symbol_table< T >::function_t [protected] |
typedef generic_function_t* exprtk::symbol_table< T >::generic_function_ptr [protected] |
typedef igeneric_function<T> exprtk::symbol_table< T >::generic_function_t [protected] |
typedef stringvar_t* exprtk::symbol_table< T >::stringvar_ptr [protected] |
typedef details::stringvar_node<T> exprtk::symbol_table< T >::stringvar_t [protected] |
typedef vararg_function_t* exprtk::symbol_table< T >::vararg_function_ptr [protected] |
typedef ivararg_function<T> exprtk::symbol_table< T >::vararg_function_t [protected] |
typedef variable_t* exprtk::symbol_table< T >::variable_ptr [protected] |
typedef details::variable_node<T> exprtk::symbol_table< T >::variable_t [protected] |
typedef vector_holder_t* exprtk::symbol_table< T >::vector_holder_ptr |
typedef details::vector_holder<T> exprtk::symbol_table< T >::vector_holder_t [protected] |
enum exprtk::symbol_table::func_type |
exprtk::symbol_table< T >::symbol_table | ( | ) | [inline] |
exprtk::symbol_table< T >::~symbol_table | ( | ) | [inline] |
exprtk::symbol_table< T >::symbol_table | ( | const symbol_table< T > & | st | ) | [inline] |
bool exprtk::symbol_table< T >::add_constant | ( | const std::string & | constant_name, | |
const T & | value | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_constants | ( | ) | [inline] |
bool exprtk::symbol_table< T >::add_epsilon | ( | ) | [inline] |
bool exprtk::symbol_table< T >::add_function | ( | const std::string & | function_name, | |
generic_function_t & | function, | |||
const func_type | ft = e_ft_basicfunc | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_function | ( | const std::string & | vararg_function_name, | |
vararg_function_t & | vararg_function | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_function | ( | const std::string & | function_name, | |
function_t & | function | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_infinity | ( | ) | [inline] |
bool exprtk::symbol_table< T >::add_pi | ( | ) | [inline] |
bool exprtk::symbol_table< T >::add_reserved_function | ( | const std::string & | function_name, | |
generic_function_t & | function, | |||
const func_type | ft = e_ft_basicfunc | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_reserved_function | ( | const std::string & | vararg_function_name, | |
vararg_function_t & | vararg_function | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_reserved_function | ( | const std::string & | function_name, | |
function_t & | function | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_stringvar | ( | const std::string & | stringvar_name, | |
std::string & | s, | |||
const bool | is_constant = false | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_variable | ( | const std::string & | variable_name, | |
T & | t, | |||
const bool | is_constant = false | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_vector | ( | const std::string & | vector_name, | |
std::deque< T, Allocator > & | v | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_vector | ( | const std::string & | vector_name, | |
std::vector< T, Allocator > & | v | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_vector | ( | const std::string & | vector_name, | |
T * | v, | |||
const std::size_t & | v_size | |||
) | [inline] |
bool exprtk::symbol_table< T >::add_vector | ( | const std::string & | vector_name, | |
T(&) | v[N] | |||
) | [inline] |
void exprtk::symbol_table< T >::clear | ( | void | ) | [inline] |
void exprtk::symbol_table< T >::clear_functions | ( | ) | [inline] |
void exprtk::symbol_table< T >::clear_strings | ( | ) | [inline] |
void exprtk::symbol_table< T >::clear_variables | ( | const bool | delete_node = true |
) | [inline] |
void exprtk::symbol_table< T >::clear_vectors | ( | ) | [inline] |
bool exprtk::symbol_table< T >::create_stringvar | ( | const std::string & | stringvar_name, | |
const std::string & | value = std::string("") | |||
) | [inline] |
bool exprtk::symbol_table< T >::create_variable | ( | const std::string & | variable_name, | |
const T & | value = T(0) | |||
) | [inline] |
std::size_t exprtk::symbol_table< T >::function_count | ( | ) | const [inline] |
std::string exprtk::symbol_table< T >::get_conststr_stringvar_name | ( | const expression_ptr & | ptr | ) | const [inline] |
function_ptr exprtk::symbol_table< T >::get_function | ( | const std::string & | function_name | ) | const [inline] |
generic_function_ptr exprtk::symbol_table< T >::get_generic_function | ( | const std::string & | function_name | ) | const [inline] |
generic_function_ptr exprtk::symbol_table< T >::get_string_function | ( | const std::string & | function_name | ) | const [inline] |
stringvar_ptr exprtk::symbol_table< T >::get_stringvar | ( | const std::string & | string_name | ) | const [inline] |
std::size_t exprtk::symbol_table< T >::get_stringvar_list | ( | Sequence< std::string, Allocator > & | svlist | ) | const [inline] |
std::size_t exprtk::symbol_table< T >::get_stringvar_list | ( | Sequence< std::pair< std::string, std::string >, Allocator > & | svlist | ) | const [inline] |
std::string exprtk::symbol_table< T >::get_stringvar_name | ( | const expression_ptr & | ptr | ) | const [inline] |
vararg_function_ptr exprtk::symbol_table< T >::get_vararg_function | ( | const std::string & | vararg_function_name | ) | const [inline] |
variable_ptr exprtk::symbol_table< T >::get_variable | ( | const T & | var_ref | ) | const [inline] |
variable_ptr exprtk::symbol_table< T >::get_variable | ( | const std::string & | variable_name | ) | const [inline] |
std::size_t exprtk::symbol_table< T >::get_variable_list | ( | Sequence< std::string, Allocator > & | vlist | ) | const [inline] |
std::size_t exprtk::symbol_table< T >::get_variable_list | ( | Sequence< std::pair< std::string, T >, Allocator > & | vlist | ) | const [inline] |
std::string exprtk::symbol_table< T >::get_variable_name | ( | const expression_ptr & | ptr | ) | const [inline] |
vector_holder_ptr exprtk::symbol_table< T >::get_vector | ( | const std::string & | vector_name | ) | const [inline] |
std::size_t exprtk::symbol_table< T >::get_vector_list | ( | Sequence< std::string, Allocator > & | vlist | ) | const [inline] |
std::string exprtk::symbol_table< T >::get_vector_name | ( | const vector_holder_ptr & | ptr | ) | const [inline] |
bool exprtk::symbol_table< T >::is_constant_node | ( | const std::string & | symbol_name | ) | const [inline] |
bool exprtk::symbol_table< T >::is_constant_string | ( | const std::string & | symbol_name | ) | const [inline] |
bool exprtk::symbol_table< T >::is_conststr_stringvar | ( | const std::string & | symbol_name | ) | const [inline] |
bool exprtk::symbol_table< T >::is_function | ( | const std::string & | function_name | ) | const [inline] |
bool exprtk::symbol_table< T >::is_stringvar | ( | const std::string & | stringvar_name | ) | const [inline] |
bool exprtk::symbol_table< T >::is_vararg_function | ( | const std::string & | vararg_function_name | ) | const [inline] |
bool exprtk::symbol_table< T >::is_variable | ( | const std::string & | variable_name | ) | const [inline] |
bool exprtk::symbol_table< T >::is_vector | ( | const std::string & | vector_name | ) | const [inline] |
void exprtk::symbol_table< T >::load_from | ( | const symbol_table< T > & | st | ) | [inline] |
symbol_table<T>& exprtk::symbol_table< T >::operator= | ( | const symbol_table< T > & | st | ) | [inline] |
bool exprtk::symbol_table< T >::operator== | ( | const symbol_table< T > & | st | ) | [inline] |
bool exprtk::symbol_table< T >::remove_function | ( | const std::string & | function_name | ) | [inline] |
bool exprtk::symbol_table< T >::remove_stringvar | ( | const std::string & | string_name | ) | [inline] |
bool exprtk::symbol_table< T >::remove_vararg_function | ( | const std::string & | vararg_function_name | ) | [inline] |
bool exprtk::symbol_table< T >::remove_variable | ( | const std::string & | variable_name, | |
const bool | delete_node = true | |||
) | [inline] |
bool exprtk::symbol_table< T >::remove_vector | ( | const std::string & | vector_name | ) | [inline] |
std::size_t exprtk::symbol_table< T >::stringvar_count | ( | ) | const [inline] |
std::string& exprtk::symbol_table< T >::stringvar_ref | ( | const std::string & | symbol_name | ) | [inline] |
bool exprtk::symbol_table< T >::symbol_exists | ( | const std::string & | symbol_name, | |
const bool | check_reserved_symb = true | |||
) | const [inline] |
bool exprtk::symbol_table< T >::valid | ( | ) | const [inline] |
std::size_t exprtk::symbol_table< T >::variable_count | ( | ) | const [inline] |
T& exprtk::symbol_table< T >::variable_ref | ( | const std::string & | symbol_name | ) | [inline] |
std::size_t exprtk::symbol_table< T >::vector_count | ( | ) | const [inline] |
const std::size_t exprtk::symbol_table< T >::lut_size = 256 [static, protected] |