MacroManager Class Reference
Last update: 16.07.2025stores a set of macro definitions MacroManager is a common::Sender. Listeners can register themselves at Senders. MacroManager calls its senders when Macros are changed/added/removed. More...
Public Types | |
| typedef std::set< MacroFunction > | TMacroSet |
| a type for storing macros in a sorted set | |
Public Member Functions | |
| add (MacroFunction macro) | |
| adds a new function to the container More... | |
| add (MacroManager other, bool overwrite_existing) | |
| adds the contents of other to this object More... | |
| assign (MacroManager other) | |
| is the equivalent to the = operator, assigns the contents of other to this More... | |
| TMacroSet::const_iterator | begin () |
| clear () | |
| clears the data | |
| bool | empty () const |
| TMacroSet::const_iterator | end () |
| erase (string identifier) | |
| deletes the macro with given identifier More... | |
| bool | exists (string identifier) |
| MacroFunction | get (string identifier) |
| MacroManager () | |
| default constructor | |
| bool | operator== (MacroManager arg) |
| comparison operator More... | |
| string | scriptChangeToFunction (string var_manager_ident, string var_chunk_ident, string old_func_ident, MacroFunction other) |
| identifies a script code that changes a single function More... | |
| set (MacroFunction macro) | |
| replaces an existing function by the specified one More... | |
| size_t | size () const |
Detailed Description
stores a set of macro definitions MacroManager is a common::Sender. Listeners can register themselves at Senders. MacroManager calls its senders when Macros are changed/added/removed.
Member Function Documentation
◆ add() [1/2]
| add | ( | MacroFunction | macro | ) |
adds a new function to the container
- Parameters
-
macro macro to be added.
- Exceptions
-
if a function with the identical ident already exists
◆ add() [2/2]
| add | ( | MacroManager | other, |
| bool | overwrite_existing | ||
| ) |
adds the contents of other to this object
- Parameters
-
other the source to be copied to this overwrite_existing if true, then all objects are copied. If false, only those macro are copied for which no equally named macro exists.
◆ assign()
| assign | ( | MacroManager | other | ) |
is the equivalent to the = operator, assigns the contents of other to this
- Parameters
-
other the source to be copied to this
◆ begin()
| TMacroSet::const_iterator begin | ( | ) |
- Returns
- the begin iterator to the underlying data container
◆ empty()
| bool empty | ( | ) | const |
- Returns
- true if empty
◆ end()
| TMacroSet::const_iterator end | ( | ) |
- Returns
- the end iterator to the underlying data container
◆ erase()
| erase | ( | string | identifier | ) |
deletes the macro with given identifier
- Parameters
-
identifier the identifier of the macro to be erased
◆ exists()
| bool exists | ( | string | identifier | ) |
- Returns
- true if the given macro identifier exists
- Parameters
-
identifier the identifier of the macro to be tested
◆ get()
| MacroFunction get | ( | string | identifier | ) |
- Returns
- a reference to the macro with specified identifier
- Parameters
-
identifier the script ident of the function
◆ operator==()
| bool operator== | ( | MacroManager | arg | ) |
comparison operator
- Parameters
-
arg the variable to be tested
- Returns
- true if both are equal
◆ scriptChangeToFunction()
| string scriptChangeToFunction | ( | string | var_manager_ident, |
| string | var_chunk_ident, | ||
| string | old_func_ident, | ||
| MacroFunction | other | ||
| ) |
identifies a script code that changes a single function
- Parameters
-
other the other function which is be added or changed var_manager_ident the variable identifier of this macro manager in script var_chunk_ident the variable ident of a temporary macro object old_func_ident The old function ident to be changed. Empty if a new function is created.
- Returns
- the script code to change this function to match the other on
◆ set()
| set | ( | MacroFunction | macro | ) |
replaces an existing function by the specified one
- Parameters
-
macro the macro to replace the existing one with.
◆ size()
| size_t size | ( | ) | const |
- Returns
- the number of defined macros