freControllerProfileBase.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: freControllerProfileBase.h,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 #include "freControllerProfileBase.h"
00023 
00024 namespace FREE
00025 {
00026 namespace CtrlProfile
00027 {
00028 
00029 bool
00030 ControllerProfileBase::
00031 IsRelatedTo(const std::string& sControllerID) const
00032 {
00033         if (sControllerID==m_sControllerID) return true;
00034 
00035         return this->m_Inheritance.IsChildOf(sControllerID);
00036 };
00037 
00038 ControllerProfileBase::
00039 ControllerProfileBase():XMLStreamObject(cXML_CP_ControllerProfile)
00040 {
00041         Reset();
00042 };
00043 
00044 ControllerProfileBase&
00045 ControllerProfileBase::
00046 operator = (const ControllerProfileBase& rProfile)
00047 {
00048         m_sControllerID = rProfile.ControllerID();
00049         m_Inheritance = rProfile.Inheritance();
00050         m_sDescription = rProfile.Description();
00051         m_Parameters = rProfile.Parameters();
00052         m_SubComponents = rProfile.SubComponents();
00053         m_MediaMap = rProfile.MediaMap();
00054 
00055   return *this;
00056 };
00057 
00058 ControllerProfileBase::
00059 ~ControllerProfileBase()
00060 {
00061   Reset();
00062 };
00063 
00064 void
00065 ControllerProfileBase::
00066 Reset()
00067 {
00068   XMLStreamObject::Reset();
00069 
00070         m_sControllerID = "";
00071         m_Inheritance.Reset();
00072         m_sDescription = "";
00073         m_Parameters.Reset();
00074         m_SubComponents.Reset();
00075         m_MediaMap.Reset();
00076 };
00077 
00078 void
00079 ControllerProfileBase::
00080 SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData)
00081 {
00082   if (rsXMLSubTag==cXML_CP_ControllerID) m_sControllerID = rsXMLSubData;
00083   else if (rsXMLSubTag==cXML_CP_Inheritance) m_Inheritance.LoadFromString(rsXMLSubElement);
00084   else if (rsXMLSubTag==cXML_CP_Description) m_sDescription = rsXMLSubData;
00085   else if (rsXMLSubTag==cXML_CP_Parameters) m_Parameters.LoadFromString(rsXMLSubElement);
00086   else if (rsXMLSubTag==cXML_CP_SubComponents) m_SubComponents.LoadFromString(rsXMLSubElement);
00087   else if (rsXMLSubTag==cXML_CP_MediaMap) m_MediaMap.LoadFromString(rsXMLSubElement);
00088 };
00089 
00090 std::string
00091 ControllerProfileBase::
00092 SaveData(const unsigned int& iDepth, bool& bHasSubElements) const
00093 {
00094   std::string result;
00095   AddSubElement(result,cXML_CP_ControllerID,m_sControllerID,iDepth);
00096   AddSubElement(result,&m_Inheritance,iDepth);
00097   AddSubElement(result,cXML_CP_Description,m_sDescription,iDepth);
00098   AddSubElement(result,&m_Parameters,iDepth);
00099   AddSubElement(result,&m_SubComponents,iDepth);
00100   AddSubElement(result,&m_MediaMap,iDepth);
00101   return result;
00102 };
00103 
00104 }//end of namespace CtrlProfile
00105 }//end of namespace FREE

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