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);
fcml_ptr fcml_st_symbol_table
Type for symbol tables.
Definition: fcml_symbols.h:35
C++ wrappers common classes.
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
void setName(const fcml_cstring &name)
Sets a new symbol name.
Definition: fcml_symbols.hpp:115
There is not enough memory to complete operation.
Definition: fcml_errors.h:44
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
LIB_EXPORT void LIB_CALL fcml_fn_symbol_table_free(fcml_st_symbol_table symbol_table)
Frees a symbol table.
fcml_st_symbol_table & extractSymbolTable(SymbolTable &symbolTable)
Extracts the native symbol table for the given symbol table wrapper.
Definition: fcml_symbols.hpp:259
#define FCML_TEXT(x)
Used to code literal strings.
Definition: fcml_types.h:61
Definition: fcml_assembler.hpp:39
const fcml_cstring & getName() const
Gets the symbol name.
Definition: fcml_symbols.hpp:95
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.
void setValue(fcml_uint64_t value)
Sets a new symbol value.
Definition: fcml_symbols.hpp:125
SymbolTable()
Creates an empty symbol table.
Definition: fcml_symbols.hpp:151
Derive from this class if you really need access to the native symbol table.
Definition: fcml_symbols.hpp:251
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.
Symbol()
Creates an empty symbol.
Definition: fcml_symbols.hpp:48
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_st_symbol_table LIB_CALL fcml_fn_symbol_table_alloc()
Allocates new symbol table.
fcml_st_symbol_table & getSymbolTable()
Gets native FCML symbol table.
Definition: fcml_symbols.hpp:181
virtual ~SymbolTable()
Destructor.
Definition: fcml_symbols.hpp:165
Represents one named symbol with associated value.
Definition: fcml_symbols.hpp:41
API for symbols handling.
Represents one named symbol with associated value.
Definition: fcml_symbols.h:42
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.
fcml_uint64_t getValue() const
Gets the symbol value.
Definition: fcml_symbols.hpp:105
Definition: fcml_symbols.hpp:143
void add(const fcml_cstring &symbolName, fcml_int64_t value)
Adds a new symbol to the table.
Definition: fcml_symbols.hpp:194
Component can not be initialized correctly.
Definition: fcml_common.hpp:231
bool isEmpty() const
Gets true if symbol is empty.
Definition: fcml_symbols.hpp:85
Object which shouldn't be copied can inherit from this class.
Definition: fcml_common.hpp:288