| eRPC Generator (erpcgen) Rev. 1.8.1 NXP Semiconductors

- Main Page
- Classes
- Files

- File List

ListType.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__LISTTYPE_H_
11 #define _EMBEDDED_RPC__LISTTYPE_H_
12
13 #include "DataType.h"
14
15 #include <string>
16
18 // Classes
20
21 namespace erpcgen {
22
26 class ListType : public DataType
27 {
28 public:
36 ListType(DataType *elementType)
37 : DataType("(list)", kListType)
38 , m_elementType(elementType)
39 , m_lengthVariableName("")
40 {
41 }
42
48 DataType *getElementType() const { return m_elementType; }
49
55 void setElementType(DataType *elementType) { m_elementType = elementType; }
56
62 virtual bool isList() const { return true; }
63
78 virtual std::string getDescription() const;
79
85 void setLengthVariableName(const std::string &lengthVariableName) { m_lengthVariableName = lengthVariableName; }
86
92 std::string &getLengthVariableName() { return m_lengthVariableName; }
93
100 bool hasLengthVariable() { return "" != m_lengthVariableName; }
101
102 protected:
103 DataType *m_elementType;
104 std::string m_lengthVariableName;
105 };
106
107 } // namespace erpcgen
108
109 #endif // _EMBEDDED_RPC__LISTTYPE_H_
erpcgen::ListType::hasLengthVariable
bool hasLengthVariable()
This function returns information if object contains length variable.
Definition: ListType.h:100
erpcgen::ListType::getDescription
virtual std::string getDescription() const
This function returns description about the list.
Definition: Type.cpp:269
erpcgen::ListType
Variable length list of another data type.
Definition: ListType.h:26
erpcgen::ListType::getElementType
DataType * getElementType() const
This function returns element data type.
Definition: ListType.h:48
erpcgen::ListType::m_elementType
DataType * m_elementType
Definition: ListType.h:103
erpcgen::DataType
Base class for data types.
Definition: DataType.h:26
erpcgen::ListType::ListType
ListType(DataType *elementType)
Constructor.
Definition: ListType.h:36
erpcgen::ListType::setLengthVariableName
void setLengthVariableName(const std::string &lengthVariableName)
This function set variable name. This variable is used in generated file to store size of list...
Definition: ListType.h:85
erpcgen::ListType::isList
virtual bool isList() const
This function return "true" value for identify list type.
Definition: ListType.h:62
erpcgen::ListType::setElementType
void setElementType(DataType *elementType)
This function set element data type.
Definition: ListType.h:55
erpcgen::ListType::m_lengthVariableName
std::string m_lengthVariableName
Definition: ListType.h:104
erpcgen::ListType::getLengthVariableName
std::string & getLengthVariableName()
This function returns variable name. This variable is used in generated file to store size of list...
Definition: ListType.h:92
erpcgen
Definition: AstNode.h:26