Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkBaseProperty.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 
17 #include "mitkBaseProperty.h"
18 
20 
22 {
23 }
24 
26 {
27 }
28 
30 {
31 }
32 
34 {
35  return std::string(VALUE_CANNOT_BE_CONVERTED_TO_STRING);
36 }
37 
39 {
40  AssignProperty(rhs);
41  return *this;
42 }
43 
45 {
46  if (this == &rhs)
47  return true; // no self assignment
48 
49  if (typeid(*this) == typeid(rhs) && Assign(rhs))
50  {
51  this->Modified();
52  return true;
53  }
54  return false;
55 }
56 
57 bool mitk::BaseProperty::operator==(const BaseProperty &property) const
58 {
59  return (typeid(*this) == typeid(property) && IsEqual(property));
60 }
BaseProperty & operator=(const BaseProperty &property)
Assigns property to this BaseProperty instance.
bool operator==(const BaseProperty &property) const
Subclasses must implement IsEqual(const BaseProperty&) to support comparison.
bool AssignProperty(const BaseProperty &property)
Assigns property to this BaseProperty instance.
Abstract base class for properties.
virtual std::string GetValueAsString() const
static const std::string VALUE_CANNOT_BE_CONVERTED_TO_STRING
Default return value if a property which can not be returned as string.