| eRPC Generator (erpcgen) Rev. 1.8.1 NXP Semiconductors

- Main Page
- Classes
- Files

- File List

StructMember.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__STRUCTMEMBER_H_
11 #define _EMBEDDED_RPC__STRUCTMEMBER_H_
12
13 #include "DataType.h"
14 #include "Symbol.h"
15
16 #include <string>
17
19 // Classes
21
22 namespace erpcgen {
23
27 enum _param_direction
28 {
29 kInDirection,
30 kOutDirection,
31 kInoutDirection,
32 kReturn
33 };
34
38 class StructMember : public Symbol
39 {
40 public:
49 StructMember(const std::string &name, DataType *dataType)
50 : Symbol(kStructMemberSymbol, name)
51 , m_dataType(dataType)
52 , m_paramDirection()
53 , m_containList()
54 , m_containString()
55 , m_byref(false)
56 {
57 }
58
67 StructMember(const Token &tok, DataType *dataType)
68 : Symbol(kStructMemberSymbol, tok)
69 , m_dataType(dataType)
70 , m_paramDirection()
71 , m_containList()
72 , m_containString()
73 , m_byref(false)
74 {
75 }
76
82 DataType *getDataType() { return m_dataType; }
83
89 void setDataType(DataType *dataType) { m_dataType = dataType; }
90
105 virtual std::string getDescription() const;
106
114 void setDirection(_param_direction paramDirection) { m_paramDirection = paramDirection; }
115
123 _param_direction getDirection() const { return m_paramDirection; }
124
130 void setContainList(bool containList) { m_containList = containList; }
131
137 bool getContainList() { return m_containList; }
138
144 void setContainString(bool containString) { m_containString = containString; }
145
151 bool getContainString() { return m_containString; }
152
158 bool isByref() { return m_byref; }
159
165 void setByref(bool byref) { m_byref = byref; }
166
167 protected:
168 DataType *m_dataType;
169 _param_direction m_paramDirection;
170 bool m_containList;
171 bool m_containString;
172 bool m_byref;
173 };
174
175 } // namespace erpcgen
176
177 #endif // _EMBEDDED_RPC__STRUCTMEMBER_H_
erpcgen::StructMember
Member of a struct.
Definition: StructMember.h:38
erpcgen::StructMember::m_paramDirection
_param_direction m_paramDirection
Definition: StructMember.h:169
erpcgen::StructMember::StructMember
StructMember(const std::string &name, DataType *dataType)
Constructor.
Definition: StructMember.h:49
erpcgen::StructMember::m_containList
bool m_containList
Definition: StructMember.h:170
erpcgen::StructMember::StructMember
StructMember(const Token &tok, DataType *dataType)
Constructor.
Definition: StructMember.h:67
erpcgen::Symbol
Base class for all named declarations in the IDL.
Definition: Symbol.h:28
erpcgen::StructMember::setDataType
void setDataType(DataType *dataType)
This function will set element data type.
Definition: StructMember.h:89
erpcgen::StructMember::getDataType
DataType * getDataType()
This function returns pointer to element data type.
Definition: StructMember.h:82
erpcgen::StructMember::m_byref
bool m_byref
Definition: StructMember.h:172
erpcgen::StructMember::isByref
bool isByref()
This function returns information if parameter is byref.
Definition: StructMember.h:158
erpcgen::StructMember::m_containString
bool m_containString
Definition: StructMember.h:171
erpcgen::StructMember::setContainString
void setContainString(bool containString)
This function set information about if member contains string data type.
Definition: StructMember.h:144
erpcgen::StructMember::setDirection
void setDirection(_param_direction paramDirection)
This function set direction type for parameter.
Definition: StructMember.h:114
erpcgen::DataType
Base class for data types.
Definition: DataType.h:26
erpcgen::Token
Encapsulates all information about a token.
Definition: Token.h:60
erpcgen::StructMember::setByref
void setByref(bool byref)
This function sets byref flag to the paramter.
Definition: StructMember.h:165
erpcgen::StructMember::getDescription
virtual std::string getDescription() const
This function returns description about the struct member.
Definition: Type.cpp:341
erpcgen::StructMember::m_dataType
DataType * m_dataType
Definition: StructMember.h:168
erpcgen::StructMember::getContainList
bool getContainList()
This function set information about if member contains list data type.
Definition: StructMember.h:137
erpcgen::StructMember::getContainString
bool getContainString()
This function set information about if member contains string data type.
Definition: StructMember.h:151
erpcgen::StructMember::getDirection
_param_direction getDirection() const
This function returns routing for parameter.
Definition: StructMember.h:123
erpcgen::StructMember::setContainList
void setContainList(bool containList)
This function set information about if member contains list data type.
Definition: StructMember.h:130
erpcgen
Definition: AstNode.h:26