00001 #ifndef TrigConf_DiffStruct
00002 #define TrigConf_DiffStruct
00003
00004 #include <boost/unordered_map.hpp>
00005
00006 #include <string>
00007 #include <vector>
00008
00009 namespace TrigConf {
00010 class DiffStruct {
00011 public:
00012 DiffStruct(const std::string& tagname, const std::string& name="");
00013 ~DiffStruct();
00014
00015 void check(const std::string& attname, const std::string& lval, const std::string& rval);
00016 void check(const std::string& attname, int lval, int rval);
00017 void check(const std::string& attname, unsigned int lval, unsigned int rval);
00018 void check(const std::string& attname, float lval, float rval);
00019 void check(const std::string& attname, bool lval, bool rval);
00020
00021 void addSub(DiffStruct* sub);
00022 void addRightOnlySub(const std::string& tagname, const std::string& name);
00023 void addLeftOnlySub(const std::string& tagname, const std::string& name);
00024
00025 bool empty() const;
00026
00027 void writeXML(std::ofstream & xmlfile, const std::string& prefix="") const;
00028
00029 struct AttDiff {
00030 AttDiff(const std::string& attname_, const std::string& lval_, const std::string& rval_) : attname(attname_), lval(lval_), rval(rval_) {}
00031 std::string attname;
00032 std::string lval;
00033 std::string rval;
00034 };
00035 std::string tagname;
00036 std::string name;
00037 std::vector<AttDiff> attdiffs;
00038 std::vector<DiffStruct*> subs;
00039 typedef boost::unordered_map<std::string, std::string> OnlyMap_t;
00040 OnlyMap_t rightonly;
00041 OnlyMap_t leftonly;
00042
00043
00044 };
00045 }
00046
00047 #endif