3 *****************************************************************************
4 * Copyright (C) 2010 - 2011 Klagenfurt University
6 * Created on: Aug 10, 2010
7 * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
8 * Christian Timmerer <christian.timmerer@itec.uni-klu.ac.at>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published
12 * by the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
27 using namespace dash::mpd;
28 using namespace dash::exception;
30 Group::Group ( const std::map<std::string, std::string>& attributes) :
31 attributes( attributes ),
32 contentProtection( NULL ),
33 accessibility( NULL ),
41 for(size_t i = 1; i < this->representations.size(); i++)
42 delete(this->representations.at(i));
44 delete(this->contentProtection);
46 delete(this->viewpoint);
47 delete(this->accessibility);
50 std::string Group::getSubSegmentAlignment () throw(AttributeNotPresentException)
52 if(this->attributes.find("subsegmentAlignmentFlag") == this->attributes.end())
53 throw AttributeNotPresentException();
55 return this->attributes["subsegmentAlignmentFlag"];
58 Viewpoint* Group::getViewpoint () throw(ElementNotPresentException)
60 if(this->viewpoint == NULL)
61 throw ElementNotPresentException();
63 return this->viewpoint;
66 Rating* Group::getRating () throw(ElementNotPresentException)
68 if(this->rating == NULL)
69 throw ElementNotPresentException();
74 Accessibility* Group::getAccessibility () throw(ElementNotPresentException)
76 if(this->accessibility == NULL)
77 throw ElementNotPresentException();
79 return this->accessibility;
82 std::vector<Representation*> Group::getRepresentations ()
84 return this->representations;
87 const Representation *Group::getRepresentationById(const std::string &id) const
89 std::vector<Representation*>::const_iterator it = this->representations.begin();
90 std::vector<Representation*>::const_iterator end = this->representations.end();
94 if ( (*it)->getId() == id )
101 void Group::addRepresentation (Representation *rep)
103 this->representations.push_back(rep);
106 void Group::setRating (Rating *rating)
108 this->rating = rating;
111 void Group::setContentProtection (ContentProtection *protection)
113 this->contentProtection = protection;
116 void Group::setAccessibility (Accessibility *accessibility)
118 this->accessibility = accessibility;
121 void Group::setViewpoint (Viewpoint *viewpoint)
123 this->viewpoint = viewpoint;