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