| eRPC Generator (erpcgen) Rev. 1.8.1 NXP Semiconductors

- Main Page
- Classes
- Files

- File List

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
31 class UniqueIdChecker
32 {
33 public:
34 typedef std::pair<int, std::string> idAndName_t;
41 void makeIdsUnique(erpcgen::InterfaceDefinition &def);
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_
erpcgen::InterfaceDefinition
Collects all definitions from an IDL.
Definition: InterfaceDefinition.h:31
erpcgen::Annotation
Annotation class.
Definition: Annotation.h:28
erpcgen::Function
Function declaration.
Definition: Function.h:117
erpcgen::UniqueIdChecker::idAndName_t
std::pair< int, std::string > idAndName_t
Definition: UniqueIdChecker.h:34
erpcgen::UniqueIdChecker
Add ids to interfaces and functions.
Definition: UniqueIdChecker.h:31
erpcgen::SymbolScope::symbol_vector_t
std::vector< Symbol * > symbol_vector_t
Definition: SymbolScope.h:32
erpcgen::UniqueIdChecker::makeIdsUnique
void makeIdsUnique(erpcgen::InterfaceDefinition &def)
This function will set unique id numbers for functions and interfaces.
Definition: UniqueIdChecker.cpp:28
erpcgen::Interface
An interface that contains functions.
Definition: Interface.h:29
erpcgen
Definition: AstNode.h:26