Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkEnumerationPropertySerializer.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
19 namespace mitk
20 {
22  {
23  if (const EnumerationProperty *prop = dynamic_cast<const EnumerationProperty *>(m_Property.GetPointer()))
24  {
25  auto element = new TiXmlElement("enum");
26  element->SetAttribute("value", prop->GetValueAsString());
27  return element;
28  }
29  else
30  return nullptr;
31  }
32 
35 } // namespace
36 
37 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
38 MITK_REGISTER_SERIALIZER(EnumerationPropertySerializer);
MITK_REGISTER_SERIALIZER(EnumerationPropertySerializer)
DataCollection - Class to facilitate loading/accessing structured data.
virtual TiXmlElement * Serialize() override
Serializes given BaseProperty object.
BaseProperty::ConstPointer m_Property