-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSchema.hh
47 lines (39 loc) · 974 Bytes
/
Schema.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _SCHEMA_HH_
#define _SCHEMA_HH_
#include <cassert>
#include <stdexcept>
#include <sstream>
#include <map>
#include <vector>
#include "Common.hh"
namespace Yang
{
namespace Ast
{
class ModuleBase;
class InteriorNode;
}
}
typedef std::map<std::string, Yang::Ast::ModuleBase*> Mods;
class Modules
{
public:
void addModule(const std::string& name, Yang::Ast::ModuleBase* module);
Mods& getModules() { return _modules; }
Yang::Ast::ModuleBase* findModule(const std::string& name);
Yang::Ast::InteriorNode* findInteriorNode(const std::string& name);
private:
Mods _modules;
};
class Schema
{
public:
Schema(const std::list<std::string>& schemas);
Mods& getModules() { return _modules.getModules(); }
Yang::Ast::InteriorNode* findInteriorNode(const std::string& name);
void print();
private:
void addSchema(const std::string& fileName);
Modules _modules;
};
#endif