29 #ifndef CREGISTEREDPRINTABLES_HPP_
30 #define CREGISTEREDPRINTABLES_HPP_
32 #include <sutil/CMappedList.hpp>
33 #include <sutil/CSingleton.hpp>
41 template<
typename ObjectType>
42 void printToStream(std::ostream&,
const ObjectType&);
94 if(NULL == ret) {
return NULL; }
101 template<
typename ObjectType>
102 bool add(
const std::string& arg_name,
103 const ObjectType& arg_obj)
107 if(NULL == obj){
return false; }
108 *obj = tmp_printable_object.createObject();
128 virtual void printDataToStream(std::ostream& arg_stream)
const =0;
138 SPrintableBase(
const SPrintableBase&);
139 SPrintableBase& operator =(
const SPrintableBase&);
144 { me.printDataToStream(out);
return out; }
154 template<
typename ObjectType>
161 virtual void printDataToStream(std::ostream& ostr)
const
162 { printToStream<ObjectType>(ostr, data_); }
164 virtual SPrintableBase* createObject()
const
165 {
return new SPrintable<ObjectType>(data_); }
167 const ObjectType& data_;
171 SPrintable(
const SPrintable&);
172 SPrintable& operator=(
const SPrintable&);
friend std::ostream & operator<<(std::ostream &outstr, const SPrintableBase &me)
Definition: CRegisteredPrintables.hpp:143
Definition: CSingleton.hpp:47
Definition: CRegisteredPrintables.hpp:122
static SDataStruct * getData()
Definition: CSingleton.hpp:87
Definition: CRegisteredPrintables.hpp:50
bool reset()
Definition: CRegisteredPrintables.hpp:114
static bool resetData()
Definition: CSingleton.hpp:107
virtual ~SPrintableBase()
Definition: CRegisteredPrintables.hpp:126
bool add(const std::string &arg_name, const ObjectType &arg_obj)
Definition: CRegisteredPrintables.hpp:102