eRPC Generator (erpcgen)  Rev. 1.7.2
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 #include <string>
15 
17 // Classes
19 
20 namespace erpcgen {
21 
25 class ArrayType : public DataType
26 {
27 public:
36  ArrayType(DataType *elementType, uint32_t elementCount)
37  : DataType("(array)", kArrayType)
38  , m_elementType(elementType)
39  , m_elementCount(elementCount)
40  {
41  }
42 
48  DataType *getElementType() const { return m_elementType; }
49 
55  void setElementType(DataType *elementType) { m_elementType = elementType; }
56 
62  virtual bool isArray() const { return true; }
63 
78  virtual std::string getDescription() const;
79 
85  uint32_t &getElementCount() { return m_elementCount; }
86 
87 protected:
89  uint32_t m_elementCount;
90 };
91 
92 } // namespace erpcgen
93 
94 #endif // _EMBEDDED_RPC__ARRAYTYPE_H_
Fixed length array of any other data type.
Definition: ArrayType.h:25
ArrayType(DataType *elementType, uint32_t elementCount)
Constructor.
Definition: ArrayType.h:36
void setElementType(DataType *elementType)
This function set element data type.
Definition: ArrayType.h:55
uint32_t & getElementCount()
This function returns size of array.
Definition: ArrayType.h:85
DataType * m_elementType
Definition: ArrayType.h:88
virtual bool isArray() const
This function return "true" value for identify array type.
Definition: ArrayType.h:62
Base class for data types.
Definition: DataType.h:25
uint32_t m_elementCount
Definition: ArrayType.h:89
virtual std::string getDescription() const
This function returns description about the array.
Definition: Type.cpp:273
DataType * getElementType() const
This function returns element data type.
Definition: ArrayType.h:48
Definition: AstNode.h:25