eRPC Generator (erpcgen)  Rev. 1.7.2
NXP Semiconductors
Interface.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__INTERFACE_H_
11 #define _EMBEDDED_RPC__INTERFACE_H_
12 
13 #include "Function.h"
14 #include "Symbol.h"
15 #include "SymbolScope.h"
16 #include <string>
17 #include <vector>
18 
20 // Classes
22 
23 namespace erpcgen {
24 
28 class Interface : public Symbol
29 {
30 public:
31  typedef std::vector<Function *> function_vector_t;
40  Interface(const Token &tok)
41  : Symbol(kInterfaceSymbol, tok)
42  , m_scope()
44  {
45  }
46 
55  void addFunction(Function *func);
56 
62  SymbolScope &getScope() { return m_scope; }
63 
69  function_vector_t &getFunctions() { return m_functions; }
70 
76  uint32_t getUniqueId() const { return m_uniqueId; }
77 
83  void setUniqueId(uint32_t newId) { m_uniqueId = newId; }
84 
100  virtual std::string getDescription() const;
101 
102 protected:
104  function_vector_t m_functions;
105  uint32_t m_uniqueId;
107  static uint32_t s_idCounter;
108 };
109 
110 } // namespace erpcgen
111 
112 #endif // _EMBEDDED_RPC__INTERFACE_H_
function_vector_t m_functions
Definition: Interface.h:104
void addFunction(Function *func)
This function will add function to the interface.
Definition: Type.cpp:509
void setUniqueId(uint32_t newId)
This function set unique id for interface.
Definition: Interface.h:83
SymbolScope & getScope()
This function return symbol scope.
Definition: Interface.h:62
function_vector_t & getFunctions()
This function return interface functions vector.
Definition: Interface.h:69
Function declaration.
Definition: Function.h:116
Base class for all named declarations in the IDL.
Definition: Symbol.h:27
uint32_t m_uniqueId
Definition: Interface.h:105
Interface(const Token &tok)
Constructor.
Definition: Interface.h:40
std::vector< Function * > function_vector_t
Definition: Interface.h:31
A scoped namespace containing symbols.
Definition: SymbolScope.h:27
SymbolScope m_scope
Definition: Interface.h:103
Encapsulates all information about a token.
Definition: Token.h:60
uint32_t getUniqueId() const
This function get unique id of interface.
Definition: Interface.h:76
virtual std::string getDescription() const
This function returns description about the interface.
Definition: Type.cpp:517
An interface that contains functions.
Definition: Interface.h:28
static uint32_t s_idCounter
Definition: Interface.h:107
Definition: AstNode.h:25