eRPC Generator (erpcgen)  Rev. 1.9.0
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 "Interface.h"
13 #include "InterfaceDefinition.h"
14 #include "SymbolScope.h"
15 
16 #include <cstdio>
17 #include <set>
18 #include <string>
19 #include <utility>
20 #include <vector>
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:31
Annotation class.
Definition: Annotation.h:28
Function declaration.
Definition: Function.h:117
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:32
void makeIdsUnique(erpcgen::InterfaceDefinition &def)
This function will set unique id numbers for functions and interfaces.
Definition: UniqueIdChecker.cpp:28
An interface that contains functions.
Definition: Interface.h:29
Definition: AstNode.h:26