eRPC Generator (erpcgen)  Rev. 1.7.0
NXP Semiconductors
Group.h
1 /*
2  * The Clear BSD License
3  * Copyright 2017 NXP
4  * All rights reserved.
5  *
6  *
7  * Redistribution and use in source and binary forms, with or without modification,
8  * are permitted (subject to the limitations in the disclaimer below) provided
9  * that the following conditions are met:
10  *
11  * o Redistributions of source code must retain the above copyright notice, this list
12  * of conditions and the following disclaimer.
13  *
14  * o Redistributions in binary form must reproduce the above copyright notice, this
15  * list of conditions and the following disclaimer in the documentation and/or
16  * other materials provided with the distribution.
17  *
18  * o Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
27  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef _EMBEDDED_RPC__GROUP_H_
36 #define _EMBEDDED_RPC__GROUP_H_
37 
38 #include "Interface.h"
39 #include "cpptempl.h"
40 #include <set>
41 #include <string>
42 #include <vector>
43 
45 // Classes
47 
48 namespace erpcgen {
49 
53 class Group
54 {
55 public:
56  typedef std::vector<Interface *> interface_list_t;
57  typedef std::vector<Symbol *> symbols_list_t;
58  typedef std::map<Symbol *, std::set<_param_direction> >
66  Group(const std::string name)
67  : m_name(name)
68  {
69  }
70 
76  const std::string &getName() const { return m_name; }
77 
83  void addInterface(Interface *iface);
84 
90  const interface_list_t &getInterfaces() const { return m_interfaces; }
91 
98  void addDirToSymbolsMap(Symbol *symbol, _param_direction dir);
99 
107  const std::set<_param_direction> getSymbolDirections(Symbol *symbol) const;
108 
116  const symbols_list_t &getSymbols() const { return m_symbols; }
117 
123  void setTemplate(cpptempl::data_map groupTemplate);
124 
130  cpptempl::data_map &getTemplate() { return m_template; }
131 
147  std::string getDescription() const;
148 
149 private:
150  interface_list_t m_interfaces;
151  symbol_directions_map_t m_symbolDirections;
152  symbols_list_t m_symbols;
153  cpptempl::data_map m_template;
154  std::string m_name;
155 };
156 
157 } // namespace erpcgen
158 
159 #endif // _EMBEDDED_RPC__GROUP_H_
const std::set< _param_direction > getSymbolDirections(Symbol *symbol) const
This function returns set with symbol directions.
Definition: Type.cpp:451
Group(const std::string name)
Constructor.
Definition: Group.h:66
const symbols_list_t & getSymbols() const
This function returns vector with symbols.
Definition: Group.h:116
std::string getDescription() const
This function returns description about the interface.
Definition: Type.cpp:463
Base class for all named declarations in the IDL.
Definition: Symbol.h:53
void addDirToSymbolsMap(Symbol *symbol, _param_direction dir)
This function will add direction for specified symbol held in a symbol map.
Definition: Type.cpp:425
cpptempl::data_map & getTemplate()
This function returns group template.
Definition: Group.h:130
const std::string & getName() const
This function returns the group name.
Definition: Group.h:76
std::vector< Interface * > interface_list_t
Definition: Group.h:56
std::vector< Symbol * > symbols_list_t
Definition: Group.h:57
An interface that contains functions.
Definition: Group.h:53
std::map< Symbol *, std::set< _param_direction > > symbol_directions_map_t
Definition: Group.h:59
Definition: cpptempl.h:190
void setTemplate(cpptempl::data_map groupTemplate)
This function will set group template.
Definition: Type.cpp:446
An interface that contains functions.
Definition: Interface.h:54
void addInterface(Interface *iface)
This function will add pointer to interface into vector of group interfaces.
Definition: Type.cpp:419
Definition: AstNode.h:51
const interface_list_t & getInterfaces() const
This function returns vector with pointers to interfaces belonging to the group.
Definition: Group.h:90