Go to the documentation of this file.
27 #ifndef FCML_SYMBOLS_HPP_
28 #define FCML_SYMBOLS_HPP_
60 _name(name), _value(value) {
67 operator fcml_uint64_t()
const {
75 operator fcml_int64_t()
const {
76 return static_cast<fcml_int64_t>(_value);
134 fcml_uint64_t _value;
157 "Symbol table can not be initialized correctly."));
197 throw std::bad_alloc();
208 const fcml_string key = symbolName.c_str();
236 symbol.
setName(found_symbol->symbol);
237 symbol.
setValue(found_symbol->value);
std::basic_string< fcml_char > fcml_cstring
By using this type definition here, it will be definitely much easier to support UNICODE in future re...
Definition: fcml_common.hpp:53
const fcml_cstring & getName() const
Gets the symbol name.
Definition: fcml_symbols.hpp:95
fcml_ptr fcml_st_symbol_table
Type for symbol tables.
Definition: fcml_symbols.h:35
There is not enough memory to complete operation.
Definition: fcml_errors.h:44
Represents one named symbol with associated value.
Definition: fcml_symbols.hpp:41
Represents one named symbol with associated value.
Definition: fcml_symbols.h:41
bool contains(const fcml_cstring &symbolName) const
Gets true if there is a symbol for the given name in the table.
Definition: fcml_symbols.hpp:219
virtual ~SymbolTable()
Destructor.
Definition: fcml_symbols.hpp:165
Component can not be initialized correctly.
Definition: fcml_common.hpp:231
Derive from this class if you really need access to the native symbol table.
Definition: fcml_symbols.hpp:251
void setValue(fcml_uint64_t value)
Sets a new symbol value.
Definition: fcml_symbols.hpp:125
LIB_EXPORT void LIB_CALL fcml_fn_symbol_table_free(fcml_st_symbol_table symbol_table)
Frees a symbol table.
Symbol get(const fcml_cstring &symbolName) const
Gets the symbol of the given name.
Definition: fcml_symbols.hpp:231
void setName(const fcml_cstring &name)
Sets a new symbol name.
Definition: fcml_symbols.hpp:115
void remove(const fcml_cstring &symbolName)
Removes symbol from the table.
Definition: fcml_symbols.hpp:207
LIB_EXPORT fcml_st_symbol *LIB_CALL fcml_fn_symbol_get(fcml_st_symbol_table symbol_table, const fcml_string symbol)
Gets the symbol with the given name from the symbol table.
void add(const fcml_cstring &symbolName, fcml_int64_t value)
Adds a new symbol to the table.
Definition: fcml_symbols.hpp:194
LIB_EXPORT void LIB_CALL fcml_fn_symbol_remove(fcml_st_symbol_table symbol_table, const fcml_string symbol)
Removes the symbol from the symbol table.
Symbol()
Creates an empty symbol.
Definition: fcml_symbols.hpp:48
LIB_EXPORT fcml_st_symbol_table LIB_CALL fcml_fn_symbol_table_alloc()
Allocates new symbol table.
Object which shouldn't be copied can inherit from this class.
Definition: fcml_common.hpp:288
fcml_st_symbol_table & getSymbolTable()
Gets native FCML symbol table.
Definition: fcml_symbols.hpp:181
fcml_st_symbol_table & extractSymbolTable(SymbolTable &symbolTable)
Extracts the native symbol table for the given symbol table wrapper.
Definition: fcml_symbols.hpp:259
Definition: fcml_symbols.hpp:143
#define FCML_TEXT(x)
Used to code literal strings.
Definition: fcml_types.h:61
fcml_uint64_t getValue() const
Gets the symbol value.
Definition: fcml_symbols.hpp:105
Symbol(const fcml_cstring &name, fcml_int64_t value)
Creates a symbol instance for the given name and value.
Definition: fcml_symbols.hpp:59
LIB_EXPORT fcml_ceh_error LIB_CALL fcml_fn_symbol_add_raw(fcml_st_symbol_table symbol_table, const fcml_string symbol, fcml_int64_t value)
Adds new symbol to the symbol table.
bool isEmpty() const
Gets true if symbol is empty.
Definition: fcml_symbols.hpp:85
SymbolTable()
Creates an empty symbol table.
Definition: fcml_symbols.hpp:151