| eRPC Generator (erpcgen) Rev. 1.8.1 NXP Semiconductors

- Main Page
- Classes
- Files

- File List

DataType.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__DATATYPE_H_
11 #define _EMBEDDED_RPC__DATATYPE_H_
12
13 #include "Symbol.h"
14
15 #include <string>
16
18 // Classes
20
21 namespace erpcgen {
22
26 class DataType : public Symbol
27 {
28 public:
32 enum _data_type
33 {
34 kAliasType,
35 kArrayType,
36 kBuiltinType,
37 kEnumType,
38 kFunctionType,
39 kListType,
40 kStructType,
41 kUnionType,
42 kVoidType
43 };
44
52 DataType(_data_type dataType)
53 : Symbol(kTypenameSymbol)
54 , m_dataType(dataType)
55 {
56 }
57
66 DataType(const std::string &name, _data_type dataType)
67 : Symbol(kTypenameSymbol, name)
68 , m_dataType(dataType)
69 {
70 }
71
81 DataType(const std::string &name, _data_type dataType, symbol_type_t symbolType)
82 : Symbol(symbolType, name)
83 , m_dataType(dataType)
84 {
85 }
86
96 DataType(const Token &tok, _data_type dataType, symbol_type_t symbolType)
97 : Symbol(symbolType, tok)
98 , m_dataType(dataType)
99 {
100 }
101
107 _data_type getDataType() const { return m_dataType; }
108
116 DataType *getTrueDataType();
117
126 DataType *getTrueContainerDataType();
127
133 virtual bool isAlias() const { return false; }
134
140 virtual bool isArray() const { return false; }
141
147 virtual bool isBinary() const { return false; }
148
154 virtual bool isBool() const { return false; }
155
161 virtual bool isBuiltin() const { return false; }
162
168 virtual bool isEnum() const { return false; }
169
175 virtual bool isFunction() const { return false; }
176
182 virtual bool isList() const { return false; }
183
189 virtual bool isScalar() const { return false; }
190
196 virtual bool isString() const { return false; }
197
203 virtual bool isUString() const { return false; }
204
210 virtual bool isStruct() const { return false; }
211
217 virtual bool isUnion() const { return false; }
218
224 virtual bool isVoid() const { return false; }
225
226 protected:
227 _data_type m_dataType;
228 };
229
230 } // namespace erpcgen
231
232 #endif // _EMBEDDED_RPC__DATATYPE_H_
erpcgen::DataType::DataType
DataType(const std::string &name, _data_type dataType, symbol_type_t symbolType)
Constructor.
Definition: DataType.h:81
erpcgen::DataType::isBool
virtual bool isBool() const
This function return "false" value as default for identify bool type.
Definition: DataType.h:154
erpcgen::DataType::isString
virtual bool isString() const
This function return "false" value as default for identify string type.
Definition: DataType.h:196
erpcgen::DataType::isVoid
virtual bool isVoid() const
This function return "false" value as default for identify void type.
Definition: DataType.h:224
erpcgen::DataType::m_dataType
_data_type m_dataType
Definition: DataType.h:227
erpcgen::Symbol
Base class for all named declarations in the IDL.
Definition: Symbol.h:28
erpcgen::DataType::isScalar
virtual bool isScalar() const
This function return "false" value as default for identify scalar builtin type.
Definition: DataType.h:189
erpcgen::DataType::getTrueContainerDataType
DataType * getTrueContainerDataType()
This function returns pointer to true data type (enum, builtin, structs) except lists and arrays...
Definition: Type.cpp:474
erpcgen::DataType::getTrueDataType
DataType * getTrueDataType()
This function returns pointer to true data type instead of alias.
Definition: Type.cpp:460
erpcgen::DataType::isFunction
virtual bool isFunction() const
This function return "false" value as default for identify function type.
Definition: DataType.h:175
erpcgen::DataType::isStruct
virtual bool isStruct() const
This function return "false" value as default for identify struct type.
Definition: DataType.h:210
erpcgen::DataType::isBinary
virtual bool isBinary() const
This function return "false" value as default for identify binary type.
Definition: DataType.h:147
erpcgen::DataType::getDataType
_data_type getDataType() const
This function returns data type.
Definition: DataType.h:107
erpcgen::DataType
Base class for data types.
Definition: DataType.h:26
erpcgen::Token
Encapsulates all information about a token.
Definition: Token.h:60
erpcgen::DataType::DataType
DataType(_data_type dataType)
Constructor.
Definition: DataType.h:52
erpcgen::DataType::isBuiltin
virtual bool isBuiltin() const
This function return "false" value as default for identify builtin type.
Definition: DataType.h:161
erpcgen::DataType::DataType
DataType(const std::string &name, _data_type dataType)
Constructor.
Definition: DataType.h:66
erpcgen::DataType::isAlias
virtual bool isAlias() const
This function return "false" value as default for identify alias type.
Definition: DataType.h:133
erpcgen::DataType::_data_type
_data_type
Supported data types.
Definition: DataType.h:32
erpcgen::DataType::isEnum
virtual bool isEnum() const
This function return "false" value as default for identify enum type.
Definition: DataType.h:168
erpcgen::DataType::isArray
virtual bool isArray() const
This function return "false" value as default for identify array type.
Definition: DataType.h:140
erpcgen::DataType::isList
virtual bool isList() const
This function return "false" value as default for identify list type.
Definition: DataType.h:182
erpcgen::DataType::isUnion
virtual bool isUnion() const
This function return "false" value as default for identify union type.
Definition: DataType.h:217
erpcgen::DataType::isUString
virtual bool isUString() const
This function return "false" value as default for identify ustring type.
Definition: DataType.h:203
erpcgen::Symbol::symbol_type_t
symbol_type_t
Supported symbol types.
Definition: Symbol.h:34
erpcgen
Definition: AstNode.h:26
erpcgen::DataType::DataType
DataType(const Token &tok, _data_type dataType, symbol_type_t symbolType)
Constructor.
Definition: DataType.h:96