Data *f_data;
f_data = new Data();
f_data->proccessFile(...);
#ifndef DATA_H#define DATA_H....#endif // DATA_H
class Data{public: Data(); ~Data();....};
class ObjectsDispatcher{public: ObjectsDispatcher(); void registerObject(IObject* object); .....private: QMap<QString, IObject*> f_objects;};
qObjectsDispatcher.registerObject(this);
.....#endif // OBJECTSDISPATCHER_Hextern ObjectsDispatcher qObjectsDispatcher;
ObjectsDispatcher qObjectsDispatcher;
ObjectsDispatcher::ObjectsDispatcher(){ f_objects.clear();}
C++ (Qt)class ObjectDispatcher {public: ... static ObjectDispatcher & Instance() { static ObjectDispatcher dispatcher; return dispatcher; }};