rspec_parser_v2.h 1.55 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * EMULAB-COPYRIGHT
 * Copyright (c) 2010 University of Utah and the Flux Group.
 * All rights reserved.
 */

/*
 * Parser class for rspec version 2.0
 */
 
#ifdef WITH_XML 
 
#ifndef __RSPEC_PARSER_V2_H__
#define __RSPEC_PARSER_V2_H__

#include "rspec_parser.h"

class rspec_parser_v2 : public rspec_parser
{
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
48
49
50
51
52
53
 private:
  
 protected:
  std::map<std::string, std::string> ifacesSeen;
  struct link_interface getIface (const xercesc::DOMElement*);
  
 public:
  rspec_parser_v2 (int type) : rspec_parser (type) { ; }
  // Reads the interfaces on a link		
  std::vector< struct link_interface >
    readLinkInterface (const xercesc::DOMElement*, int&);
  
  struct link_characteristics readLinkCharacteristics 
    (const xercesc::DOMElement*, 
     int&,
     int defaultBandwidth = -1, 
     int unlimitedBandwidth = -1);
  
  std::vector<struct node_type> readNodeTypes
    (const xercesc::DOMElement*,
     int& typeCount,
     int unlimitedSlots);
  
  map< pair<string, string>, pair<string, string> >
    readInterfacesOnNode (const xercesc::DOMElement* node, 
			  bool& allUnique);

  std::string readAvailable(const xercesc::DOMElement* node, bool& hasTag);

  std::vector<struct link_type> 
    readLinkTypes (const xercesc::DOMElement* link, int& typeCount);

  std::vector<struct rspec_emulab_extension::type_limit>
    readTypeLimits(const xercesc::DOMElement* tag, int& count);
54
55
56

  std::vector<struct rspec_emulab_extension::fd>
    readFeaturesDesires(const xercesc::DOMElement* tag, int& count);
57
58
59
60
61
62
63
64
65
};



#endif // #ifndef __RSPEC_PARSER_V2_H__

#endif // #ifdef WITH_XML