eRPC Generator (erpcgen)  Rev. 1.9.0
NXP Semiconductors
ArrayType.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__ARRAYTYPE_H_
11 #define _EMBEDDED_RPC__ARRAYTYPE_H_
12 
13 #include "DataType.h"
14 
15 #include <string>
16 
18 // Classes
20 
21 namespace erpcgen {
22 
26 class ArrayType : public DataType
27 {
28 public:
37  ArrayType(DataType *elementType, uint32_t elementCount)
38  : DataType("(array)", kArrayType)
39  , m_elementType(elementType)
40  , m_elementCount(elementCount)
41  {
42  }
43 
49  DataType *getElementType() const { return m_elementType; }
50 
56  void setElementType(DataType *elementType) { m_elementType = elementType; }
57 
63  virtual bool isArray() const { return true; }
64 
79  virtual std::string getDescription() const;
80 
86  uint32_t &getElementCount() { return m_elementCount; }
87 
88 protected:
90  uint32_t m_elementCount;
91 };
92 
93 } // namespace erpcgen
94 
95 #endif // _EMBEDDED_RPC__ARRAYTYPE_H_
Fixed length array of any other data type.
Definition: ArrayType.h:26
ArrayType(DataType *elementType, uint32_t elementCount)
Constructor.
Definition: ArrayType.h:37
void setElementType(DataType *elementType)
This function set element data type.
Definition: ArrayType.h:56
uint32_t & getElementCount()
This function returns size of array.
Definition: ArrayType.h:86
DataType * m_elementType
Definition: ArrayType.h:89
virtual bool isArray() const
This function return "true" value for identify array type.
Definition: ArrayType.h:63
Base class for data types.
Definition: DataType.h:26
uint32_t m_elementCount
Definition: ArrayType.h:90
virtual std::string getDescription() const
This function returns description about the array.
Definition: Type.cpp:274
DataType * getElementType() const
This function returns element data type.
Definition: ArrayType.h:49
Definition: AstNode.h:26