freComponentMediaLink.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: freComponentMediaLink.cxx,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 "freComponentMediaLink.h"
00023 
00024 #include "freConvert.h"
00025 
00026 namespace FREE
00027 {
00028 
00029 ComponentMediaLink::
00030 ComponentMediaLink() : XMLStreamObject(cXML_MediaLink)
00031 {
00032   Reset();
00033 };
00034 
00035 ComponentMediaLink&
00036 ComponentMediaLink::
00037 operator = (const ComponentMediaLink& rLink)
00038 {
00039   if (this == &rLink) return *this;
00040 
00041   this->SetMediaID(rLink.GetMediaID());
00042   this->SetSourceIDPath(rLink.GetSourceIDPath());
00043   this->SetTemplateID(rLink.GetTemplateID());
00044 
00045         return *this;
00046 };
00047 
00048 ComponentMediaLink::
00049 ~ComponentMediaLink()
00050 {
00051 };
00052 
00053 void
00054 ComponentMediaLink::
00055 Reset()
00056 {
00057   FREE::XMLStreamObject::Reset();
00058 
00059   m_sMediaID = "";
00060         m_SourcePath.Reset();
00061   m_sTemplateID = "";
00062 };
00063 
00064 void
00065 ComponentMediaLink::
00066 AttributesLoadProcessing(const AttributesType& rAttributes)
00067 {
00068   for (AttributesType::const_iterator pos = rAttributes.begin(); pos!= rAttributes.end(); pos++)
00069   {
00070     if (pos->first==cXML_MediaID) m_sMediaID = pos->second;
00071     else if (pos->first==cXML_TemplateID) m_sTemplateID = pos->second;
00072   };
00073 };
00074 
00075 void
00076 ComponentMediaLink::
00077 SaveAttributes(AttributesSaveListType& rAttributes) const
00078 {
00079   rAttributes.push_back(AttributesType::value_type(cXML_MediaID,m_sMediaID));
00080 
00081   if (this->IsTemplateBased()) rAttributes.push_back(AttributesType::value_type(cXML_TemplateID,m_sTemplateID));
00082 }; 
00083 
00084 void
00085 ComponentMediaLink::
00086 SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData)
00087 {
00088   if (rsXMLSubTag==cXML_IDPath) m_SourcePath.LoadFromString(rsXMLSubElement);
00089 };
00090 
00091 std::string
00092 ComponentMediaLink::
00093 SaveData(const unsigned int& iDepth, bool& bHasSubElements) const
00094 {
00095   std::string sResult = "";
00096   if (!m_SourcePath.IsEmpty())
00097   {
00098     AddSubElement(sResult, &m_SourcePath, iDepth);
00099     bHasSubElements = true;
00100   }
00101   
00102   return sResult;
00103 };
00104 
00105 }//end of namespace FREE

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