eRPC Generator (erpcgen)  Rev. 1.7.2
NXP Semiconductors
UniqueIdChecker.h
1 /*
2  * Copyright (c) 2016, 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__UNIQUEIDCHECKER_H_
11 #define _EMBEDDED_RPC__UNIQUEIDCHECKER_H_
12 #include <cstdio>
13 #include <set>
14 #include <string>
15 #include <utility>
16 #include <vector>
17 
18 #include "Interface.h"
19 #include "InterfaceDefinition.h"
20 #include "SymbolScope.h"
21 
23 // Classes
25 
26 namespace erpcgen {
27 
32 {
33 public:
34  typedef std::pair<int, std::string> idAndName_t;
42 
43 private:
49  void initUsedInterfaceIds(erpcgen::SymbolScope::symbol_vector_t ifaces);
50 
56  void initUsedFunctionIds(erpcgen::Interface *iface);
57 
64  void setFunctionId(Function *fn, Annotation *idAnnotation);
65 
72  void setInterfaceId(Interface *iface, Annotation *interfaceId);
73 
83  void checkDuplicateIds(std::vector<idAndName_t> ids, std::string idType);
84 
91  void printDuplicateIdWarning(std::set<idAndName_t> duplicateIds, std::string idType);
92 
93  std::vector<idAndName_t> m_usedFunctionIds;
94  std::vector<idAndName_t> m_usedInterfaceIds;
95 };
96 } // namespace erpcgen
97 
98 #endif // _EMBEDDED_RPC__UNIQUEIDCHECKER_H_
Collects all definitions from an IDL.
Definition: InterfaceDefinition.h:30
Annotation class.
Definition: Annotation.h:27
Function declaration.
Definition: Function.h:116
std::pair< int, std::string > idAndName_t
Definition: UniqueIdChecker.h:34
Add ids to interfaces and functions.
Definition: UniqueIdChecker.h:31
std::vector< Symbol * > symbol_vector_t
Definition: SymbolScope.h:31
void makeIdsUnique(erpcgen::InterfaceDefinition &def)
This function will set unique id numbers for functions and interfaces.
Definition: UniqueIdChecker.cpp:27
An interface that contains functions.
Definition: Interface.h:28
Definition: AstNode.h:25