rspec_parser_v2.h 2.35 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
 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&);
  
32 33 34 35
  struct link_characteristics 
    readLinkCharacteristics (const xercesc::DOMElement*, int&,
			     int defaultBandwidth = -1, 
			     int unlimitedBandwidth = -1);
36
  
37 38 39
  std::vector<struct node_type> 
    readNodeTypes (const xercesc::DOMElement*, int& typeCount, 
		   int unlimitedSlots);
40 41 42 43 44 45 46 47 48 49 50 51
  
  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);
52 53 54

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

  std::vector<struct rspec_emulab_extension::vclass>
    readVClasses (const xercesc::DOMElement* tag);
  std::string readSubnodeOf (const xercesc::DOMElement* tag, bool&, int&);
  bool readDisallowTrivialMix (const xercesc::DOMElement* tag);
  bool readUnique (const xercesc::DOMElement* tag);
  int readTrivialBandwidth (const xercesc::DOMElement* tag, bool&);
  std::string readHintTo (const xercesc::DOMElement* tag, bool&);
  bool readNoDelay (const xercesc::DOMElement* tag);
  bool readTrivialOk (const xercesc::DOMElement* tag);
65 66 67
  bool readMultiplexOk (const xercesc::DOMElement* tag);
  std::vector<struct rspec_emulab_extension::policy>
    readPolicies (const xercesc::DOMElement* tag, int& count);
68 69
  std::string convertType (const std::string);
  std::string convertType (const std::string, const std::string);
70 71 72 73 74 75 76 77 78
};



#endif // #ifndef __RSPEC_PARSER_V2_H__

#endif // #ifdef WITH_XML