this->attributes = attributes;
this->programInfo = NULL;
}
-MPD::MPD ()
-{
-}
MPD::~MPD ()
{
for(size_t i = 0; i < this->periods.size(); i++)
delete(this->programInfo);
}
-std::vector<Period*> MPD::getPeriods ()
+const std::vector<Period*>& MPD::getPeriods () const
{
return this->periods;
}
-std::vector<BaseUrl*> MPD::getBaseUrls ()
+
+const std::vector<BaseUrl*>& MPD::getBaseUrls () const
{
return this->baseUrls;
}
-std::string MPD::getMinBufferTime () throw(AttributeNotPresentException)
+
+const std::string& MPD::getMinBufferTime () const throw(AttributeNotPresentException)
{
- if(this->attributes.find("minBufferTime") == this->attributes.end())
+ AttributesMap::const_iterator it = this->attributes.find("minBufferTime");
+ if( it == this->attributes.end())
throw AttributeNotPresentException();
- return this->attributes["minBufferTime"];
+ return it->second;
}
-std::string MPD::getType () throw(AttributeNotPresentException)
+
+const std::string& MPD::getType () const throw(AttributeNotPresentException)
{
- if(this->attributes.find("type") == this->attributes.end())
+ AttributesMap::const_iterator it = this->attributes.find( "type" );
+ if( it == this->attributes.end() )
throw AttributeNotPresentException();
- return this->attributes["type"];
+ return it->second;
}
-std::string MPD::getDuration () throw(AttributeNotPresentException)
+const std::string& MPD::getDuration () const throw(AttributeNotPresentException)
{
- if(this->attributes.find("mediaPresentationDuration") == this->attributes.end())
+ AttributesMap::const_iterator it = this->attributes.find("mediaPresentationDuration");
+
+ if( it == this->attributes.end())
throw AttributeNotPresentException();
- return this->attributes["mediaPresentationDuration"];
+ return it->second;
}
ProgramInformation* MPD::getProgramInformation () throw(ElementNotPresentException)
{