eRPC Generator (erpcgen)  Rev. 1.9.0
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 
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.h:65
Value * m_value
Definition: ConstType.h:76
ConstType(const Token &tok, DataType *dataType, Value *value)
Constructor.
Definition: ConstType.h:39
Const class.
Definition: ConstType.h:27
void setValue(Value *value)
This function sets constant value.
Definition: ConstType.h:72
Value * getValue()
This function returns value of constant data type.
Definition: ConstType.h:58
Base class for all named declarations in the IDL.
Definition: Symbol.h:28
DataType * m_dataType
Definition: ConstType.h:75
Abstract base class for values of arbitrary types.
Definition: Value.h:27
Base class for data types.
Definition: DataType.h:26
Encapsulates all information about a token.
Definition: Token.h:60
DataType * getDataType()
This function returns pointer to element data type.
Definition: ConstType.h:51
Definition: AstNode.h:26