Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef CONTAINER_H_
00009 #define CONTAINER_H_
00010
00011 #include <string>
00012 #include <iostream>
00013 #include <map>
00014 #include <string>
00015 #include <sstream>
00016
00017 #define DOT_FILE_EXT ".xot"
00018
00019 class Container{
00020 static int& id_counter(){static int c; return c; }
00021 public:
00022 static void reset_id_counter(){ id_counter()=0; }
00023 static std::string get_id_counter(){ std::stringstream s; s<<id_counter()++; return s.str();}
00024 static std::map<std::string, std::string>& map_id_to_number(){ static std::map<std::string, std::string> m; return m; }
00025 static std::stringstream& postData(){ static std::stringstream s; return s; }
00026 static void clear_postData(){
00027 postData().str(""); }
00028
00029 virtual ~Container(){}
00030
00031 virtual bool contains(std::string name)const=0;
00032
00033 virtual std::string copy(std::string name)const=0;
00034
00035 virtual void saveXml(std::ostream& out, std::string tab, std::string name, std::string id)const=0;
00036
00037 virtual void saveDot(std::ostream& out, std::string tab, std::string name, std::string id)const=0;
00038
00039 virtual void map_ids(std::string name, std::string id)const=0;
00040 };
00041
00042
00043 #endif