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

Discriminated union case type. More...

#include <UnionCase.hpp>

Inheritance diagram for erpcgen::UnionCase:
erpcgen::Symbol

Public Member Functions

 UnionCase (const std::string &caseName, int32_t caseValue)
 Constructor. More...
 
 UnionCase (int32_t caseValue)
 Constructor. More...
 
 UnionCase (const std::string &caseName)
 Constructor. More...
 
void setUnionReferencePointer (UnionType *unionType)
 This function set reference to union type. More...
 
int32_t getCaseValue () const
 This function returns union case value. More...
 
std::string getCaseName ()
 This function returns union case name. More...
 
std::vector< std::string > getMemberDeclarationNames () const
 This function returns vector of member declarations. More...
 
void addCaseMemberName (const std::string &name)
 This function adds case member name. More...
 
void printUnionMembers ()
 This function prints debug information about union case members.
 
bool caseMemberIsVoid () const
 This function returns information if case is void type. More...
 
virtual std::string getDescription () const override
 This function returns description about case members. More...
 
StructMembergetUnionMemberDeclaration (const std::string &name)
 This function returns union member declaration. More...
 
- Public Member Functions inherited from erpcgen::Symbol
 Symbol (symbol_type_t symType)
 Constructor. More...
 
 Symbol (symbol_type_t symType, const std::string &name)
 Constructor. More...
 
 Symbol (symbol_type_t symType, const Token &tok)
 Constructor. More...
 
virtual ~Symbol ()
 Destructor.
 
symbol_type_t getSymbolType () const
 This function returns symbol type. More...
 
const std::string & getName () const
 This function returns symbol name. More...
 
void setName (const std::string &newName)
 This function set symbol name. More...
 
bool isConstSymbol () const
 This function is testing symbol type. More...
 
bool isEnumMemberSymbol () const
 This function is testing symbol type. More...
 
bool isFunctionSymbol () const
 This function is testing symbol type. More...
 
bool isInterfaceSymbol () const
 This function is testing symbol type. More...
 
bool isProgramSymbol () const
 This function is testing symbol type. More...
 
bool isStructMemberSymbol () const
 This function is testing symbol type. More...
 
bool isDatatypeSymbol () const
 This function is testing symbol type. More...
 
bool isUnionCaseSymbol () const
 This function is testing symbol type. More...
 
token_loc_tgetLocation ()
 This function returns location for symbol. More...
 
void setLocation (const token_loc_t &loc)
 This function set location for symbol. More...
 
int getFirstLine () const
 This function return first line from location of symbol. More...
 
int getLastLine () const
 This function return last line from location of symbol. More...
 
void addAnnotation (const Annotation &a)
 This function add annotation to vector of symbol annotations. More...
 
std::string printAnnotations ()
 This function returns description about annotation. More...
 
AnnotationfindAnnotation (const std::string &name, Annotation::program_lang_t lang)
 Find annotation in the annotation list. More...
 
std::vector< Annotation * > getAnnotations (const std::string &name, Annotation::program_lang_t lang)
 Find annotations matching name in the annotation list. More...
 
const std::vector< Annotation > & getAnnotations () const
 Return all Symbol annotations. More...
 
ValuegetAnnValue (const std::string &annName, Annotation::program_lang_t lang)
 This function search and returns Value object for given annotation name. More...
 
std::string getAnnStringValue (const std::string &annName, Annotation::program_lang_t lang)
 This function search and returns string for given annotation name. More...
 
std::string getMlComment ()
 This function returns multiline comment for this symbol declared in IDL file. More...
 
void setMlComment (const std::string &comment)
 This function set multiline comment for this symbol declared in IDL file. More...
 
std::string getIlComment ()
 This function returns inline comment for this symbol declared in IDL file. More...
 
void setIlComment (const std::string &comment)
 This function set inline comment for this symbol declared in IDL file. More...
 

Additional Inherited Members

- Public Types inherited from erpcgen::Symbol
enum  symbol_type_t {
  kConstSymbol,
  kEnumMemberSymbol,
  kFunctionSymbol,
  kInterfaceSymbol,
  kProgramSymbol,
  kStructMemberSymbol,
  kTypenameSymbol,
  kUnionCaseMemberSymbol
}
 Supported symbol types.
 
- Protected Attributes inherited from erpcgen::Symbol
symbol_type_t m_symbolType
 
std::string m_name
 
token_loc_t m_location
 
std::vector< Annotationm_annotations
 
std::string m_mlComment
 
std::string m_ilComment
 

Detailed Description

Discriminated union case type.

Constructor & Destructor Documentation

erpcgen::UnionCase::UnionCase ( const std::string &  caseName,
int32_t  caseValue 
)
inline

Constructor.

This function set symbol to union case and name to given name. It will also set case value.

Parameters
[in]caseNameGiven case name.
[in]caseValueGiven case value.
erpcgen::UnionCase::UnionCase ( int32_t  caseValue)
inlineexplicit

Constructor.

This function set symbol to union case. It will also set case value.

Parameters
[in]caseValueGiven case value.
erpcgen::UnionCase::UnionCase ( const std::string &  caseName)
inlineexplicit

Constructor.

This function set symbol to union case and name to given name. It will also set case value to -1 (unset).

Parameters
[in]caseNameGiven case name.

Member Function Documentation

void erpcgen::UnionCase::addCaseMemberName ( const std::string &  name)
inline

This function adds case member name.

Parameters
[in]nameCase member name.
bool UnionCase::caseMemberIsVoid ( ) const

This function returns information if case is void type.

Return values
trueWhen case is void type.
falseWhen case contains not void type.
std::string erpcgen::UnionCase::getCaseName ( )
inline

This function returns union case name.

Returns
Union case name.
int32_t erpcgen::UnionCase::getCaseValue ( ) const
inline

This function returns union case value.

Returns
Union case value.
string UnionCase::getDescription ( ) const
overridevirtual

This function returns description about case members.

Returns
Case description.

Reimplemented from erpcgen::Symbol.

std::vector<std::string> erpcgen::UnionCase::getMemberDeclarationNames ( ) const
inline

This function returns vector of member declarations.

Returns
Vector of member declarations.
StructMember * UnionCase::getUnionMemberDeclaration ( const std::string &  name)

This function returns union member declaration.

Parameters
[in]nameUnion member name.
Returns
Union member.
void erpcgen::UnionCase::setUnionReferencePointer ( UnionType unionType)
inline

This function set reference to union type.

Parameters
[in]unionTypePointer to union type.

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