Commit 0290575b 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>
parent 33f8d91d
......@@ -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