freStatisticEntryDefinition.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: freStatisticEntryDefinition.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 "freStatisticEntryDefinition.h"
00023 #include "freConvert.h"
00024 
00025 namespace FREE
00026 {
00027 
00031 
00032 StatisticEntryDefinition&
00033 StatisticEntryDefinition::
00034 operator = (const StatisticEntryDefinition& rEntry)
00035 {
00036   if (this != &rEntry)
00037   {
00038     this->Reset();
00039     SetRefID(rEntry.GetRefID());
00040     SetIDPath(rEntry.GetIDPath());
00041     SetName(rEntry.GetName());
00042     SetDescription(rEntry.GetDescription());
00043     SetControllerID(rEntry.GetControllerID());
00044   };
00045 
00046   return *this;
00047 };
00048 
00049 StatisticEntryDefinition::
00050 StatisticEntryDefinition():XMLStreamObject(XMLTags::StatisticEntryDefinition)
00051 {
00052   Reset();
00053 };
00054 
00055 StatisticEntryDefinition::
00056 ~StatisticEntryDefinition()
00057 {};
00058 
00059 void
00060 StatisticEntryDefinition::
00061 Reset()
00062 {
00063   XMLStreamObject::Reset();
00064   m_sName = "";
00065   m_sDescription = "";
00066   m_sControllerID = "";
00067   m_sIDPath = "";
00068   m_RefID = 0;
00069 };
00070 
00071 void
00072 StatisticEntryDefinition::
00073 SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData)
00074 {
00075   if (rsXMLSubTag == XMLTags::StatisticEntryDefName) m_sName = rsXMLSubData;
00076   else if (rsXMLSubTag == XMLTags::StatisticEntryDefDescription) m_sDescription = rsXMLSubData;
00077   else if (rsXMLSubTag == XMLTags::StatisticEntryDefControllerID) m_sControllerID = rsXMLSubData;
00078   else if (rsXMLSubTag == XMLTags::StatisticEntryDefIDPath) m_sIDPath = rsXMLSubData;
00079   else if (rsXMLSubTag == XMLTags::StatisticEntryReference) m_RefID = Convert::ToInt(rsXMLSubData);
00080 };
00081 
00082 std::string
00083 StatisticEntryDefinition::
00084 SaveData(const unsigned int& iDepth, bool& bHasSubElements) const
00085 {
00086   std::string result;
00087         AddSubElement(result, XMLTags::StatisticEntryReference, Convert::ToStr(m_RefID), iDepth);
00088   AddSubElement(result, XMLTags::StatisticEntryDefName, m_sName, iDepth);
00089   AddSubElement(result, XMLTags::StatisticEntryDefControllerID, m_sControllerID, iDepth);
00090   AddSubElement(result, XMLTags::StatisticEntryDefIDPath, m_sIDPath, iDepth);
00091   AddSubElement(result, XMLTags::StatisticEntryDefDescription, m_sDescription, iDepth);
00092 
00093   return result;
00094 };
00095 
00096 } //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