34 #include "boost/bind.hpp"
46 mPluginContext(pluginContext),
49 this->initServiceListener();
52 void SessionStorageServiceProxy::initServiceListener()
56 boost::bind(&SessionStorageServiceProxy::onServiceAdded,
this, _1),
58 boost::bind(&SessionStorageServiceProxy::onServiceRemoved,
this, _1)
60 mServiceListener->open();
63 void SessionStorageServiceProxy::onServiceAdded(SessionStorageService* service)
65 mService.reset(service, null_deleter());
75 void SessionStorageServiceProxy::onServiceRemoved(SessionStorageService *service)
105 return mService->isValid();
110 return mService->getRootFolder();
void isLoading(QDomElement &root)
emitted while loading a session. Xml storage is available, getRootFolder() is set to loaded value...
virtual void load(QString dir)
load session from dir, or create new session in this location if none exist
static SessionStorageServicePtr create(ctkPluginContext *pluginContext)
SessionStorageServiceProxy(ctkPluginContext *pluginContext)
virtual void save()
Save all application data to XML file.
void sessionChanged()
emitted after change to a new session (new or loaded or cleared)
virtual bool isValid() const
void cleared()
emitted when session is cleared, before isLoading is called
Helper class for listening to services being added, modified and removed.
virtual bool isNull() const
virtual QString getRootFolder() const
static SessionStorageServicePtr getNullObject()
void isSaving(QDomElement &root)
xml storage is available
boost::shared_ptr< class SessionStorageService > SessionStorageServicePtr