freStatisticValue.cxx

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: freStatisticValue.cxx,v $
00007   Language:  C++
00008 
00009 
00010   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00011   Institute for Medical Biometry and Informatics, University of Heidelberg,
00012   Germany). All rights reserved.
00013   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00014   for details.
00015 
00016      This software is distributed WITHOUT ANY WARRANTY; without even 
00017      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00018      PURPOSE.  See the above copyright notices for more information.
00019 
00020 =========================================================================*/
00021 
00022 #include "freStatisticValue.h"
00023 
00024 #include "freConvert.h"
00025 
00026 namespace FREE
00027 {
00028 
00032 
00033 const StatisticValue::ReferenceIDType StatisticValue::cUndefinedRef = 0;
00034 
00035 std::string
00036 StatisticValue::
00037 GetValue() const
00038 {
00039   return m_sValue;
00040 };
00041 
00042 void
00043 StatisticValue::
00044 SetValue(const std::string& sValue)
00045 {
00046   m_sValue = sValue;
00047 };
00048 
00049 StatisticValue::ReferenceIDType
00050 StatisticValue::
00051 GetReferenceID() const
00052 {
00053   return m_RefID;
00054 };
00055 
00056 void
00057 StatisticValue::
00058 SetReferenceID(const ReferenceIDType& refID)
00059 {
00060   m_RefID = refID;
00061 };
00062 
00063 StatisticValue&
00064 StatisticValue::
00065 operator = (const StatisticValue& value)
00066 {
00067   m_sValue = value.GetValue();
00068   m_RefID = value.GetReferenceID();
00069 
00070   return *this;
00071 };
00072 
00073 StatisticValue::
00074 StatisticValue(const std::string& sValue, const ReferenceIDType& refID):XMLStreamObject(XMLTags::StatisticValue)
00075 {
00076   SetValue(sValue);
00077   SetReferenceID(refID);
00078 };
00079 
00080 StatisticValue::
00081 StatisticValue( const StatisticValue& value):XMLStreamObject(XMLTags::StatisticValue)
00082 {
00083   *this = value;
00084 };
00085 
00086 void
00087 StatisticValue::
00088 Reset()
00089 {
00090   m_sValue = "";
00091   m_RefID = cUndefinedRef;
00092 };
00093 
00094 void
00095 StatisticValue::
00096 SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData)
00097 {
00098   m_sValue = rsXMLSubData;
00099 };
00100 
00101 std::string
00102 StatisticValue::
00103 SaveData(const unsigned int& iDepth, bool& bHasSubElements) const
00104 {
00105         bHasSubElements = false;
00106   return m_sValue;
00107 };
00108 
00109 void
00110 StatisticValue::
00111 AttributesLoadProcessing(const AttributesType& rAttributes)
00112 {
00113   AttributesType::const_iterator pos = rAttributes.find(XMLTags::StatisticValueReference);
00114   if (pos == rAttributes.end()) m_RefID = cUndefinedRef;
00115   else m_RefID = Convert::ToInt(pos->second);
00116 };
00117 
00118 void
00119 StatisticValue::
00120 SaveAttributes(AttributesSaveListType& rAttributes) const
00121 {
00122   rAttributes.push_back(AttributesSaveListType::value_type(XMLTags::StatisticValueReference,Convert::ToStr(m_RefID)));
00123 }; 
00124 
00125 } //end of namespace FREE

Generated at Sat Oct 13 17:41:44 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000