eRPC Generator (erpcgen)  Rev. 1.7.0
NXP Semiconductors
Interface.h
1 /*
2  * The Clear BSD License
3  * Copyright (c) 2014, Freescale Semiconductor, Inc.
4  * Copyright 2016 NXP
5  * All rights reserved.
6  *
7  *
8  * Redistribution and use in source and binary forms, with or without modification,
9  * are permitted (subject to the limitations in the disclaimer below) provided
10  * that the following conditions are met:
11  *
12  * o Redistributions of source code must retain the above copyright notice, this list
13  * of conditions and the following disclaimer.
14  *
15  * o Redistributions in binary form must reproduce the above copyright notice, this
16  * list of conditions and the following disclaimer in the documentation and/or
17  * other materials provided with the distribution.
18  *
19  * o Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from this
21  * software without specific prior written permission.
22  *
23  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
28  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #ifndef _EMBEDDED_RPC__INTERFACE_H_
37 #define _EMBEDDED_RPC__INTERFACE_H_
38 
39 #include "Function.h"
40 #include "Symbol.h"
41 #include "SymbolScope.h"
42 #include <string>
43 #include <vector>
44 
46 // Classes
48 
49 namespace erpcgen {
50 
54 class Interface : public Symbol
55 {
56 public:
57  typedef std::vector<Function *> function_vector_t;
66  Interface(const Token &tok)
67  : Symbol(kInterfaceSymbol, tok)
68  , m_scope()
70  {
71  }
72 
81  void addFunction(Function *func);
82 
88  SymbolScope &getScope() { return m_scope; }
89 
95  function_vector_t &getFunctions() { return m_functions; }
96 
102  uint32_t getUniqueId() const { return m_uniqueId; }
103 
109  void setUniqueId(uint32_t newId) { m_uniqueId = newId; }
110 
126  virtual std::string getDescription() const;
127 
128 protected:
130  function_vector_t m_functions;
131  uint32_t m_uniqueId;
133  static uint32_t s_idCounter;
134 };
135 
136 } // namespace erpcgen
137 
138 #endif // _EMBEDDED_RPC__INTERFACE_H_
function_vector_t m_functions
Definition: Interface.h:130
void addFunction(Function *func)
This function will add function to the interface.
Definition: Type.cpp:535
void setUniqueId(uint32_t newId)
This function set unique id for interface.
Definition: Interface.h:109
SymbolScope & getScope()
This function return symbol scope.
Definition: Interface.h:88
function_vector_t & getFunctions()
This function return interface functions vector.
Definition: Interface.h:95
Function declaration.
Definition: Function.h:142
Base class for all named declarations in the IDL.
Definition: Symbol.h:53
uint32_t m_uniqueId
Definition: Interface.h:131
Interface(const Token &tok)
Constructor.
Definition: Interface.h:66
std::vector< Function * > function_vector_t
Definition: Interface.h:57
A scoped namespace containing symbols.
Definition: SymbolScope.h:53
SymbolScope m_scope
Definition: Interface.h:129
Encapsulates all information about a token.
Definition: Token.h:86
uint32_t getUniqueId() const
This function get unique id of interface.
Definition: Interface.h:102
virtual std::string getDescription() const
This function returns description about the interface.
Definition: Type.cpp:543
An interface that contains functions.
Definition: Interface.h:54
static uint32_t s_idCounter
Definition: Interface.h:133
Definition: AstNode.h:51