Medical Imaging Interaction Toolkit  2018.4.99-ef453c4b
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkBaseProperty.h"
14 
16 
18 {
19 }
20 
22 {
23 }
24 
26 {
27 }
28 
30 {
31  return std::string(VALUE_CANNOT_BE_CONVERTED_TO_STRING);
32 }
33 
35 {
36  AssignProperty(rhs);
37  return *this;
38 }
39 
41 {
42  if (this == &rhs)
43  return true; // no self assignment
44 
45  if (typeid(*this) == typeid(rhs) && Assign(rhs))
46  {
47  this->Modified();
48  return true;
49  }
50  return false;
51 }
52 
53 bool mitk::BaseProperty::operator==(const BaseProperty &property) const
54 {
55  return (typeid(*this) == typeid(property) && IsEqual(property));
56 }
BaseProperty & operator=(const BaseProperty &property)
Assigns property to this BaseProperty instance.
bool AssignProperty(const BaseProperty &property)
Assigns property to this BaseProperty instance.
virtual std::string GetValueAsString() const
Abstract base class for properties.
static const std::string VALUE_CANNOT_BE_CONVERTED_TO_STRING
Default return value if a property which can not be returned as string.
bool operator==(const BaseProperty &property) const
Subclasses must implement IsEqual(const BaseProperty&) to support comparison.