| eRPC Generator (erpcgen) Rev. 1.8.1 NXP Semiconductors

- Main Page
- Classes
- Files

- File List

EnumMember.h
1 /*
2 * Copyright (c) 2014, Freescale Semiconductor, Inc.
3 * Copyright 2016 NXP
4 * All rights reserved.
5 *
6 *
7 * SPDX-License-Identifier: BSD-3-Clause
8 */
9
10 #ifndef _EMBEDDED_RPC__ENUMMEBER_H_
11 #define _EMBEDDED_RPC__ENUMMEBER_H_
12
13 #include "Symbol.h"
14
15 #include <string>
16
18 // Classes
20
21 namespace erpcgen {
22
26 class EnumMember : public Symbol
27 {
28 public:
37 EnumMember(const Token &tok, uint32_t value)
38 : Symbol(kEnumMemberSymbol, tok)
39 , m_value(value)
40 , m_valueSet(true)
41 {
42 }
43
51 EnumMember(const Token &tok)
52 : Symbol(kEnumMemberSymbol, tok)
53 , m_value(-1)
54 , m_valueSet(false)
55 {
56 }
57
63 void setValue(IntegerValue value) {
64 m_value = value;
65 m_valueSet = true;
66 }
67
73 uint32_t getValue() const { return (uint32_t)m_value; }
74
81 bool hasValue() const { return m_valueSet; }
82
97 virtual std::string getDescription() const;
98
99 protected:
100 IntegerValue m_value;
101 bool m_valueSet;
102 };
103
104 } // namespace erpcgen
105
106 #endif // _EMBEDDED_RPC__ENUMMEBER_H_
erpcgen::EnumMember::getDescription
virtual std::string getDescription() const
This function returns description about the enum member.
Definition: Type.cpp:381
erpcgen::EnumMember::getValue
uint32_t getValue() const
This function returns enum member value.
Definition: EnumMember.h:73
erpcgen::EnumMember::EnumMember
EnumMember(const Token &tok)
Constructor.
Definition: EnumMember.h:51
IntegerValue
64-bit integer value.
Definition: Value.h:87
erpcgen::EnumMember::hasValue
bool hasValue() const
This function return true if enum member has set value.
Definition: EnumMember.h:81
erpcgen::Symbol
Base class for all named declarations in the IDL.
Definition: Symbol.h:28
erpcgen::EnumMember::EnumMember
EnumMember(const Token &tok, uint32_t value)
Constructor.
Definition: EnumMember.h:37
erpcgen::EnumMember
Member of a enum.
Definition: EnumMember.h:26
erpcgen::Token
Encapsulates all information about a token.
Definition: Token.h:60
erpcgen::EnumMember::setValue
void setValue(IntegerValue value)
This function set enum member value.
Definition: EnumMember.h:63
erpcgen
Definition: AstNode.h:26
erpcgen::EnumMember::m_value
IntegerValue m_value
Definition: EnumMember.h:100