eRPC Generator (erpcgen)  Rev. 1.12.0
NXP Semiconductors
erpcgen::SymbolScope Class Reference

A scoped namespace containing symbols. More...

#include <SymbolScope.hpp>

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...
 
SymbolgetSymbol (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 (const Symbol *sym)
 This function will return symbol position. More...
 
bool hasParent () const
 Return boolean representation about existence of parent. More...
 
SymbolScopegetParent ()
 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
 
SymbolScopem_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.

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]symSymbol pointer, which is added to symbol scope vector.
[in]posPosition 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 ( )
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]nameName, which is used to find symbol.
[in]recursiveIf 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 ( const 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]symPointer 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]predicateTypeSymbol 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
trueWhen parent is set.
falseWhen 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]nameName, which is used to find symbol.
[in]recursiveIf 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]oldSymSymbol pointer, which will be replaced.
[in]newSymSymbol 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]parentPointer 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: