| eRPC Generator (erpcgen) Rev. 1.8.1 NXP Semiconductors

- Main Page
- Classes
- Files

- File List

StructType.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__STRUCTTYPE_H_
11 #define _EMBEDDED_RPC__STRUCTTYPE_H_
12
13 #include "DataType.h"
14 #include "StructMember.h"
15 #include "SymbolScope.h"
16
17 #include <string>
18 #include <vector>
19
21 // Classes
23
24 namespace erpcgen {
25
29 class StructType : public DataType
30 {
31 public:
32 typedef std::vector<StructMember *> member_vector_t;
41 StructType(const std::string &name)
42 : DataType(name, kStructType, kStructTypeSymbol)
43 {
44 }
45
53 StructType(const Token &tok)
54 : DataType(tok, kStructType, kStructTypeSymbol)
55 {
56 }
57
66 void addMember(StructMember *newMember);
67
73 SymbolScope &getScope() { return m_scope; }
74
80 member_vector_t &getMembers() { return m_members; }
81
87 virtual bool isStruct() const { return true; }
88
103 virtual std::string getDescription() const;
104
110 bool containListMember();
111
117 bool containStringMember();
118
124 bool containByrefMember();
125
126 protected:
127 SymbolScope m_scope;
128 member_vector_t m_members;
129 };
130
131 } // namespace erpcgen
132
133 #endif // _EMBEDDED_RPC__STRUCTTYPE_H_
erpcgen::StructMember
Member of a struct.
Definition: StructMember.h:38
erpcgen::StructType::addMember
void addMember(StructMember *newMember)
This function will add struct member to the struct.
Definition: Type.cpp:316
erpcgen::StructType::StructType
StructType(const std::string &name)
Constructor.
Definition: StructType.h:41
erpcgen::StructType::getDescription
virtual std::string getDescription() const
This function returns description about the struct.
Definition: Type.cpp:324
erpcgen::StructType
Structure data type.
Definition: StructType.h:29
erpcgen::StructType::StructType
StructType(const Token &tok)
Constructor.
Definition: StructType.h:53
erpcgen::StructType::containByrefMember
bool containByrefMember()
This function return true, when has member, which contains flag byref.
Definition: Type.cpp:304
erpcgen::StructType::getScope
SymbolScope & getScope()
This function returns symbol scope.
Definition: StructType.h:73
erpcgen::StructType::isStruct
virtual bool isStruct() const
This function return "true" value for identify struct type.
Definition: StructType.h:87
erpcgen::SymbolScope
A scoped namespace containing symbols.
Definition: SymbolScope.h:28
erpcgen::DataType
Base class for data types.
Definition: DataType.h:26
erpcgen::Token
Encapsulates all information about a token.
Definition: Token.h:60
erpcgen::StructType::m_members
member_vector_t m_members
Definition: StructType.h:128
erpcgen::StructType::member_vector_t
std::vector< StructMember * > member_vector_t
Definition: StructType.h:32
erpcgen::StructType::m_scope
SymbolScope m_scope
Definition: StructType.h:127
erpcgen::StructType::containStringMember
bool containStringMember()
This function return true, when has member, which contains string type.
Definition: Type.cpp:292
erpcgen::StructType::containListMember
bool containListMember()
This function return true, when has member, which contains list type.
Definition: Type.cpp:280
erpcgen::StructType::getMembers
member_vector_t & getMembers()
This function returns struct members vector.
Definition: StructType.h:80
erpcgen
Definition: AstNode.h:26