Commit a3f53bb8 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

dash: Segments: Avoid copies + cosmetic.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 0290575bf9fcf61fe5a14695c2e2da9ae6cd2e0e)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent f09fa82b
......@@ -30,11 +30,12 @@
using namespace dash::mpd;
using namespace dash::exception;
SegmentInfo::SegmentInfo(std::map<std::string,std::string> attr)
SegmentInfo::SegmentInfo( const std::map<std::string,std::string>& attr) :
attributes( attr ),
initSeg( NULL )
{
this->attributes = attr;
this->initSeg = NULL;
}
SegmentInfo::~SegmentInfo ()
{
for(size_t i = 0; i < this->segments.size(); i++)
......@@ -50,14 +51,17 @@ InitSegment* SegmentInfo::getInitSegment () throw(ElementNotPrese
return this->initSeg;
}
std::vector<Segment*> SegmentInfo::getSegments ()
const std::vector<Segment*>& SegmentInfo::getSegments () const
{
return this->segments;
}
void SegmentInfo::addSegment (Segment *seg)
{
this->segments.push_back(seg);
}
void SegmentInfo::setInitSegment (InitSegment *initSeg)
{
this->initSeg = initSeg;
......
......@@ -40,11 +40,11 @@ namespace dash
class SegmentInfo
{
public:
SegmentInfo (std::map<std::string, std::string> attr);
SegmentInfo ( const std::map<std::string, std::string>& attr);
virtual ~SegmentInfo ();
InitSegment* getInitSegment () throw(dash::exception::ElementNotPresentException);
std::vector<Segment *> getSegments ();
const std::vector<Segment *>& getSegments () const;
void setInitSegment (InitSegment *initSeg);
void addSegment (Segment *seg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment