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

dash: Group: Adding a getter for Representation by id.

This will be used to implement @dependencyId
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 3dab8a80
...@@ -84,6 +84,20 @@ std::vector<Representation*> Group::getRepresentations () ...@@ -84,6 +84,20 @@ std::vector<Representation*> Group::getRepresentations ()
return this->representations; return this->representations;
} }
const Representation *Group::getRepresentationById(const std::string &id) const
{
std::vector<Representation*>::const_iterator it = this->representations.begin();
std::vector<Representation*>::const_iterator end = this->representations.end();
while ( it != end )
{
if ( (*it)->getId() == id )
return *it;
++it;
}
return NULL;
}
void Group::addRepresentation (Representation *rep) void Group::addRepresentation (Representation *rep)
{ {
this->representations.push_back(rep); this->representations.push_back(rep);
......
...@@ -50,6 +50,7 @@ namespace dash ...@@ -50,6 +50,7 @@ namespace dash
std::string getSubSegmentAlignment () throw(dash::exception::AttributeNotPresentException); std::string getSubSegmentAlignment () throw(dash::exception::AttributeNotPresentException);
std::vector<Representation *> getRepresentations (); std::vector<Representation *> getRepresentations ();
const Representation* getRepresentationById ( const std::string &id ) const;
Viewpoint* getViewpoint () throw(dash::exception::ElementNotPresentException); Viewpoint* getViewpoint () throw(dash::exception::ElementNotPresentException);
Accessibility* getAccessibility () throw(dash::exception::ElementNotPresentException); Accessibility* getAccessibility () throw(dash::exception::ElementNotPresentException);
Rating* getRating () throw(dash::exception::ElementNotPresentException); Rating* getRating () throw(dash::exception::ElementNotPresentException);
......
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