| eRPC Generator (erpcgen) Rev. 1.8.1 NXP Semiconductors

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
erpcgen::SymbolScope Class Reference

A scoped namespace containing symbols. More...

`#include <SymbolScope.h>`

## Classes
class | typed_iterator

## Public Types
typedef std::map< std::string, Symbol * > | symbol_map_t
typedef std::vector< Symbol * > | symbol_vector_t

## Public Member Functions
| SymbolScope ()
| Constructor.
virtual | ~SymbolScope ()
| Destructor.
bool | hasSymbol (const std::string &name, bool recursive=true)
| This function returns true when name is found in symbol map. More...
Symbol * | getSymbol (const std::string &name, bool recursive=true)
| This function will return symbol. More...
void | addSymbol (Symbol *sym, int32_t pos=-1)
| This function will add symbol to the symbol scope. More...
void | replaceSymbol (Symbol *oldSym, Symbol *newSym)
| This function will replace old symbol with new symbol in the symbol scope. More...
int32_t | getSymbolPos (Symbol *sym)
| This function will return symbol position. More...
bool | hasParent () const
| Return boolean representation about existence of parent. More...
SymbolScope * | getParent ()
| Return pointer to parent. More...
void | setParent (SymbolScope *parent)
| This function set parent for this object. More...
symbol_vector_t::iterator | begin ()
| Return begin of symbol vector. More...
symbol_vector_t::iterator | end ()
| Return end of symbol vector. More...
typed_iterator | tbegin (Symbol::symbol_type_t predicateType)
typed_iterator | tend (Symbol::symbol_type_t predicateType)
symbol_vector_t | getSymbolsOfType (Symbol::symbol_type_t predicateType)
| This function returns symbol vector with symbols. More...
symbol_vector_t | getSymbolVector ()
| This function returns symbol vector. More...
void | dump ()
| This function show debug description about the all symbols. More...
void | clear ()
| Erase data from m_symbolMap and m_symbolVector.

## Protected Attributes
symbol_map_t | m_symbolMap
symbol_vector_t | m_symbolVector
SymbolScope * | m_parent

## Detailed Description

A scoped namespace containing symbols.

## Member Typedef Documentation

typedef std::map<std::string, Symbol *> erpcgen::SymbolScope::symbol_map_t

Map symbol name to symbol type.

typedef std::vector<Symbol *> erpcgen::SymbolScope::symbol_vector_t

Vector of symbol types.

## Member Function Documentation

void SymbolScope::addSymbol | ( | Symbol * | sym,
|  | int32_t | pos = `-1`
| ) |  |

This function will add symbol to the symbol scope.

The function will add symbol given by pointer sym to the symbol scope vector m_symbolVector. If symbol with same name is already added, will be throw semantic error.

Parameters

  [in] | sym | Symbol pointer, which is added to symbol scope vector.
  [in] | pos | Position where symbol should be added. Default -1 mean at the end of vector.

See also
  Symbol * SymbolScope::getSymbol()
  bool SymbolScope::hasSymbol()
  void SymbolScope::replaceSymbol()

symbol_vector_t::iterator erpcgen::SymbolScope::begin | ( |  | ) |
| inline

Return begin of symbol vector.

Returns
  Return begin of symbol vector.

void SymbolScope::dump | ( |  | ) |

This function show debug description about the all symbols.

See also
  std::string Interface::getDescription() const
  std::string Function::getDescription() const
  std::string AliasType::getDescription() const
  std::string EnumMember::getDescription() const
  std::string EnumType::getDescription() const
  std::string StructMember::getDescription() const
  std::string StructType::getDescription() const
  std::string VoidType::getDescription() const
  std::string ArrayType::getDescription() const
  std::string ListType::getDescription() const

symbol_vector_t::iterator erpcgen::SymbolScope::end | ( |  | ) |
| inline

Return end of symbol vector.

Returns
  Return end of symbol vector.

SymbolScope* erpcgen::SymbolScope::getParent | ( |  | ) |
| inline

Return pointer to parent.

Returns
  Pointer to parent.

Symbol * SymbolScope::getSymbol | ( | const std::string & | name,
|  | bool | recursive = `true`
| ) |  |

This function will return symbol.

This function returns symbol found in symbol scope map m_symbolMap. Symbol is found using given name.

Parameters

  [in] | name | Name, which is used to find symbol.
  [in] | recursive | If true, then recursive finding is allowed.

Returns
  Requested symbol from symbol vector.

Return values

  nullptr | (when symbol wasn't found)

See also
  void SymbolScope::addSymbol()
  bool SymbolScope::hasSymbol()
  void SymbolScope::replaceSymbol()

int32_t SymbolScope::getSymbolPos | ( | Symbol * | sym | ) |

This function will return symbol position.

The function will return symbol position of given symbol by pointer sym from the symbol scope vector m_symbolVector.

Parameters

  [in] | sym | Pointer of symbol, which position is searched.

Returns
  -1 if position is not found, else position number.

See also
  Symbol * SymbolScope::addSymbol()

SymbolScope::symbol_vector_t SymbolScope::getSymbolsOfType | ( | Symbol::symbol_type_t | predicateType | ) |

This function returns symbol vector with symbols.

This function returns symbol vector with symbols, which are requested. Symbols are found using given symbol_type_t.

Parameters

  [in] | predicateType | Symbol type, which is requested.

Returns
  Symbol vector with requested symbols.

symbol_vector_t erpcgen::SymbolScope::getSymbolVector | ( |  | ) |
| inline

This function returns symbol vector.

Returns
  Symbol vector with all symbols.

bool erpcgen::SymbolScope::hasParent | ( |  | ) | const
| inline

Return boolean representation about existence of parent.

Return values

  true | When parent is set.
  false | When parent isn't set.

bool SymbolScope::hasSymbol | ( | const std::string & | name,
|  | bool | recursive = `true`
| ) |  |

This function returns true when name is found in symbol map.

This function returns true when name is found in symbol map. Symbol is found using given name.

Parameters

  [in] | name | Name, which is used to find symbol.
  [in] | recursive | If true, then recursive finding is allowed.

Return values

  true | (symbol is found)
  false | (symbol isn't found)

See also
  void SymbolScope::addSymbol()
  Symbol * SymbolScope::getSymbol()
  void SymbolScope::replaceSymbol()

void SymbolScope::replaceSymbol | ( | Symbol * | oldSym,
|  | Symbol * | newSym
| ) |  |

This function will replace old symbol with new symbol in the symbol scope.

The function will remove old symbol and call addSymbol with new symbol.

Parameters

  [in] | oldSym | Symbol pointer, which will be replaced.
  [in] | newSym | Symbol pointer, which will be replacer.

See also
  Symbol * SymbolScope::addSymbol()
  Symbol * SymbolScope::getSymbol()
  bool SymbolScope::hasSymbol()

void erpcgen::SymbolScope::setParent | ( | SymbolScope * | parent | ) |
| inline

This function set parent for this object.

Parameters

  [in] | parent | Pointer to given parent.

SymbolScope::typed_iterator SymbolScope::tbegin | ( | Symbol::symbol_type_t | predicateType | ) |

Parameters

  [in] | predicateType |

SymbolScope::typed_iterator SymbolScope::tend | ( | Symbol::symbol_type_t | predicateType | ) |

Parameters

  [in] | predicateType |

## Member Data Documentation

SymbolScope* erpcgen::SymbolScope::m_parent
| protected

Scope of Symbol

symbol_map_t erpcgen::SymbolScope::m_symbolMap
| protected

Map Symbols to names.

symbol_vector_t erpcgen::SymbolScope::m_symbolVector
| protected

Vector of Symbols

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

- SymbolScope.h
- Type.cpp