eRPC Generator (erpcgen)  Rev. 1.7.2
NXP Semiconductors
AliasType.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__ALIASTYPE_H_
11 #define _EMBEDDED_RPC__ALIASTYPE_H_
12 
13 #include "DataType.h"
14 #include <string>
15 
17 // Classes
19 
20 namespace erpcgen {
21 
25 class AliasType : public DataType
26 {
27 public:
36  AliasType(std::string name, DataType *elementType)
37  : DataType(name, kAliasType, kAliasTypeSymbol)
38  , m_elementType(elementType)
39  {
40  }
41 
50  AliasType(const Token &tok, DataType *elementType)
51  : DataType(tok, kAliasType, kAliasTypeSymbol)
52  , m_elementType(elementType)
53  {
54  }
55 
61  virtual bool isAlias() const { return true; }
62 
68  DataType *getElementType() const { return m_elementType; }
69 
77  void setElementType(DataType *elementType) { m_elementType = elementType; }
78 
93  virtual std::string getDescription() const;
94 
95 protected:
97 };
98 
99 } // namespace erpcgen
100 
101 #endif // _EMBEDDED_RPC__ALIASTYPE_H_
AliasType(const Token &tok, DataType *elementType)
Constructor.
Definition: AliasType.h:50
Typedef.
Definition: AliasType.h:25
virtual bool isAlias() const
This function return "true" value for identify alias type.
Definition: AliasType.h:61
void setElementType(DataType *elementType)
This function set element data type.
Definition: AliasType.h:77
DataType * getElementType() const
This function return element data type.
Definition: AliasType.h:68
Base class for data types.
Definition: DataType.h:25
Encapsulates all information about a token.
Definition: Token.h:60
DataType * m_elementType
Definition: AliasType.h:96
virtual std::string getDescription() const
This function returns description about the alias.
Definition: Type.cpp:454
AliasType(std::string name, DataType *elementType)
Constructor.
Definition: AliasType.h:36
Definition: AstNode.h:25