00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "freProfileMediaMap.h"
00023
00024 namespace FREE
00025 {
00026 namespace CtrlProfile
00027 {
00028
00032
00033
00034 Media*
00035 ProfileMediaMap::
00036 AddMedia(const std::string& sName, const std::string& sType, const DataAccessType access,
00037 const Media::DimensionType& dim, const unsigned int& iGroupID, const bool& bInternal)
00038
00039 {
00040 Media::Pointer smpMedia = this->GetElement(sName);
00041
00042 if (smpMedia.IsNull())
00043 {
00044 smpMedia = Media::New();
00045 AddElement(smpMedia);
00046 };
00047
00048 smpMedia->SetDimension(dim);
00049 smpMedia->SetName(sName);
00050 smpMedia->SetDataType(sType);
00051 smpMedia->SetInternal(bInternal);
00052 smpMedia->SetAccess(access);
00053 smpMedia->SetGroup(iGroupID);
00054 return smpMedia.GetPointer();
00055 };
00056
00057 ProfileMediaMap::
00058 ProfileMediaMap()
00059 {
00060 Reset();
00061 SetXMLTag(cXML_CP_MediaMap);
00062 };
00063
00064 ProfileMediaMap::
00065 ProfileMediaMap( const ProfileMediaMap& rMediaMap)
00066 {
00067 SetXMLTag(cXML_CP_MediaMap);
00068 *this = rMediaMap;
00069 };
00070
00071 ProfileMediaMap::
00072 ~ProfileMediaMap()
00073 {
00074 Reset();
00075 };
00076
00077 void
00078 ProfileMediaMap::
00079 SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData)
00080 {
00081 if (rsXMLSubTag==cXML_CP_Media)
00082 {
00083 Media::Pointer smpNewComponent = Media::New();
00084
00085 try
00086 {
00087 smpNewComponent->LoadFromString(rsXMLSubElement);
00088 }
00089 catchAllNPassMacro("Unknown error occured while loading subcomponent definition to a collection.");
00090
00091 AddElement(smpNewComponent);
00092 }
00093 else if (rsXMLSubTag!=cXML_Text) throwExceptionMacro("Unknown xml tag, unable to load value. Incorrect Tag: " << rsXMLSubTag);
00094 };
00095
00096 }
00097 }