00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 }
00105 }