27 m_storageLocked(false)
29 this->
SetName(
"ToolStorage (no name given)");
37 this->
SetName(
"Tool Storage (no name given)");
53 if (m_ServiceRegistration) { m_ServiceRegistration.
SetProperties(m_props); }
70 m_ServiceRegistration = context->RegisterService(
this, m_props);
76 if (!m_ServiceRegistration)
79 <<
"Cannot unregister microservice as it wasn't registered before.";
84 m_ServiceRegistration = 0;
91 MITK_WARN <<
"Storage is locked, cannot modify it!";
97 MITK_WARN <<
"Tool no " << number <<
"doesn't exist, can't delete it!";
100 std::vector<mitk::NavigationTool::Pointer>::iterator it =
m_ToolCollection.begin() + number;
114 MITK_WARN <<
"Storage is locked, cannot modify it!";
126 MITK_WARN <<
"Storage is locked, cannot modify it!";
129 else if (
GetTool(tool->GetIdentifier()).IsNotNull())
131 MITK_WARN <<
"Tool ID already exists in storage, can't add!";
192 if (this->
GetTool(identifier1).IsNull())
194 MITK_WARN <<
"Identifier does not exist, cannot assign new number";
198 if ((number2 >= static_cast<int>(
m_ToolCollection.size())) || (number2 < 0))
200 MITK_WARN <<
"Invalid number, cannot assign new number";
210 if (
m_ToolCollection.at(i)->GetIdentifier() == identifier1) { number1 = i; }
217 MITK_DEBUG <<
"Swapped tool " << number2 <<
" with tool " << number1;
DataCollection - Class to facilitate loading/accessing structured data.
mitk::DataStorage::Pointer m_DataStorage
void SetProperties(const ServiceProperties &properties)
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.