7 #include "ctrlSelection/BookmarkSrv.hpp" 9 #include <fwData/String.hpp> 10 #include <fwServices/macros.hpp> 11 #include <fwTools/Bookmarks.hpp> 22 BookmarkSrv::BookmarkSrv() noexcept
29 BookmarkSrv::~BookmarkSrv() noexcept
37 ::fwRuntime::ConfigurationElement::sptr config =
m_configuration->findConfigurationElement(
"bookmark");
38 SLM_ASSERT(
"Problem with configuration for BookmarkSrv type, one element \"bookmark\" must be present",
m_configuration->findAllConfigurationElement(
39 "bookmark").size() == 1 );
43 if (config->hasAttribute(
"fromString"))
45 std::string uid = config->getExistingAttributeValue(
"fromString");
48 OSLM_ASSERT(
"Object '" << uid <<
"' is not a '::fwData::String'", str);
49 m_bookmarkName = str->value();
51 if (config->hasAttribute(
"fromString") && config->hasAttribute(
"name"))
53 m_bookmarkName +=
"_";
55 if (config->hasAttribute(
"name"))
57 m_bookmarkName += config->getExistingAttributeValue(
"name");
65 ::fwTools::Bookmarks::add( m_bookmarkName, this->
getObject());
virtual CTRLSELECTION_API void info(std::ostream &_sstream) override
Write information in a stream.
#define OSLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
virtual CTRLSELECTION_API void starting() override
Adds the object in bookmark.
virtual CTRLSELECTION_API void swapping() override
Do nothing.
virtual CTRLSELECTION_API void updating() override
Do nothing.
This service bookmark its object with the name given in configuration.
This interface defines control service API. Does nothing particularly, can be considered as a default...
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
Base class for each data object.
::fwRuntime::ConfigurationElement::sptr m_configuration
Configuration element used to configure service internal state using a generic XML like structure TOD...
virtual CTRLSELECTION_API void reconfiguring() override
Do nothing.
FWSERVICES_API::fwData::Object::sptr getObject()
Return the object associated to service.
virtual CTRLSELECTION_API void stopping() override
Removes the object from bookmark.
The namespace ctrlSelection contains several interfaces for manager, updater and wrapper.
#define OSLM_WARN_IF(message, cond)
virtual CTRLSELECTION_API void configuring() override