eRPC Generator (erpcgen)  Rev. 1.11.0
NXP Semiconductors
ConstType.hpp
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__CONST_H_
11 #define _EMBEDDED_RPC__CONST_H_
12 
13 #include "DataType.hpp"
14 #include "Symbol.hpp"
15 
16 #include <string>
17 
19 // Classes
21 
22 namespace erpcgen {
23 
27 class ConstType : public Symbol
28 {
29 public:
39  ConstType(const Token &tok, DataType *dataType, Value *value)
40  : Symbol(kConstSymbol, tok)
41  , m_dataType(dataType)
42  , m_value(value)
43  {
44  }
45 
52 
58  Value *getValue() { return m_value; }
59 
65  void setDataType(DataType *dataType) { m_dataType = dataType; }
66 
72  void setValue(Value *value) { m_value = value; }
73 
74 protected:
77 };
78 
79 } // namespace erpcgen
80 
81 #endif // _EMBEDDED_RPC__CONST_H_
void setDataType(DataType *dataType)
This function sets constant data type.
Definition: ConstType.hpp:65
Value * m_value
Definition: ConstType.hpp:76
ConstType(const Token &tok, DataType *dataType, Value *value)
Constructor.
Definition: ConstType.hpp:39
Const class.
Definition: ConstType.hpp:27
void setValue(Value *value)
This function sets constant value.
Definition: ConstType.hpp:72
Value * getValue()
This function returns value of constant data type.
Definition: ConstType.hpp:58
Base class for all named declarations in the IDL.
Definition: Symbol.hpp:28
DataType * m_dataType
Definition: ConstType.hpp:75
Abstract base class for values of arbitrary types.
Definition: Value.hpp:27
Base class for data types.
Definition: DataType.hpp:26
Encapsulates all information about a token.
Definition: Token.hpp:60
DataType * getDataType()
This function returns pointer to element data type.
Definition: ConstType.hpp:51
Definition: AstNode.hpp:26