eRPC Generator (erpcgen)  Rev. 1.9.0
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 
17 #include <string>
18 #include <vector>
19 
21 // Classes
23 
24 namespace erpcgen {
25 
29 class Interface : public Symbol
30 {
31 public:
32  typedef std::vector<Function *> function_vector_t;
41  Interface(const Token &tok)
42  : Symbol(kInterfaceSymbol, tok)
43  , m_scope()
45  {
46  }
47 
56  void addFunction(Function *func);
57 
63  SymbolScope &getScope() { return m_scope; }
64 
70  function_vector_t &getFunctions() { return m_functions; }
71 
77  uint32_t getUniqueId() const { return m_uniqueId; }
78 
84  void setUniqueId(uint32_t newId) { m_uniqueId = newId; }
85 
101  virtual std::string getDescription() const;
102 
103 protected:
105  function_vector_t m_functions;
106  uint32_t m_uniqueId;
108  static uint32_t s_idCounter;
109 };
110 
111 } // namespace erpcgen
112 
113 #endif // _EMBEDDED_RPC__INTERFACE_H_
function_vector_t m_functions
Definition: Interface.h:105
void addFunction(Function *func)
This function will add function to the interface.
Definition: Type.cpp:508
void setUniqueId(uint32_t newId)
This function set unique id for interface.
Definition: Interface.h:84
SymbolScope & getScope()
This function return symbol scope.
Definition: Interface.h:63
function_vector_t & getFunctions()
This function return interface functions vector.
Definition: Interface.h:70
Function declaration.
Definition: Function.h:117
Base class for all named declarations in the IDL.
Definition: Symbol.h:28
uint32_t m_uniqueId
Definition: Interface.h:106
Interface(const Token &tok)
Constructor.
Definition: Interface.h:41
std::vector< Function * > function_vector_t
Definition: Interface.h:32
A scoped namespace containing symbols.
Definition: SymbolScope.h:28
SymbolScope m_scope
Definition: Interface.h:104
Encapsulates all information about a token.
Definition: Token.h:60
uint32_t getUniqueId() const
This function get unique id of interface.
Definition: Interface.h:77
virtual std::string getDescription() const
This function returns description about the interface.
Definition: Type.cpp:516
An interface that contains functions.
Definition: Interface.h:29
static uint32_t s_idCounter
Definition: Interface.h:108
Definition: AstNode.h:26