00001 #ifndef SCTDATADISPLAY_DISPLAYMANAGER_H 00002 #define SCTDATADISPLAY_DISPLAYMANAGER_H 00003 00004 #include <boost/shared_ptr.hpp> 00005 #include <map> 00006 #include <string> 00007 #include <vector> 00008 00009 using std::map; 00010 using std::vector; 00011 using std::string; 00012 using boost::shared_ptr; 00013 00014 namespace Sct { 00015 class Serializable; 00016 } 00017 00018 namespace SctDataDisplay { 00019 00020 class Displayer; 00021 class GenericDisplayer; 00022 class DisplayInfo; 00023 class DisplayData; 00024 00029 class DisplayManager { 00030 public: 00034 static DisplayManager& instance(); 00035 00040 static bool addToMap(string className, shared_ptr<Displayer> displayer); 00041 00046 static shared_ptr<DisplayData> display(shared_ptr<const Sct::Serializable> ob, const DisplayInfo& info, std::ostream& os); 00047 00048 00054 static bool addGeneric(shared_ptr<GenericDisplayer> generic); 00055 00059 static bool batchMode(); 00063 static void setBatchMode(bool b=true); 00064 00068 static std::string getOutputDir(); 00072 static void setOutputDir(const std::string& dirname); 00076 static void OutputCanvases(); 00077 private: 00078 DisplayManager(); 00079 map<string, shared_ptr<Displayer> > displayerMap; 00080 vector<shared_ptr<GenericDisplayer> > genericList; 00081 bool m_batchMode; 00082 std::string m_outputdir; 00083 }; 00084 00085 } 00086 00087 #endif //SCTDATADISPLAY_DISPLAYMANAGER_H