Use vector for the Ratings list.
authorCarl Hetherington <cth@carlh.net>
Thu, 27 Aug 2020 22:05:54 +0000 (00:05 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 20 Sep 2020 17:30:46 +0000 (19:30 +0200)
src/cpl.h
test/cpl_ratings_test.cc

index ba1e81963c10d9872856462cc5193f162f93aba4..bb8975c91d2d2d0d2402a2bdb13950671389cf93 100644 (file)
--- a/src/cpl.h
+++ b/src/cpl.h
@@ -152,11 +152,11 @@ public:
 
        void set_content_versions (std::vector<ContentVersion> v);
 
-       std::list<Rating> ratings () const {
+       std::vector<Rating> ratings () const {
                return _ratings;
        }
 
-       void set_ratings (std::list<Rating> r) {
+       void set_ratings (std::vector<Rating> r) {
                _ratings = r;
        }
 
@@ -177,8 +177,8 @@ private:
        std::string _annotation_text;
        std::string _content_title_text;            ///< &lt;ContentTitleText&gt;
        ContentKind _content_kind;                  ///< &lt;ContentKind&gt;
-       std::list<Rating> _ratings;
        std::vector<ContentVersion> _content_versions;
+       std::vector<Rating> _ratings;
 
        std::list<boost::shared_ptr<Reel> > _reels;
 
index 161dab0d64afd3cbf3c75f7a6742daef98dfbdd0..ae8469983b42eac8c8332dcb9c4faaf7089578c2 100644 (file)
 
 using std::list;
 using std::string;
+using std::vector;
 
 BOOST_AUTO_TEST_CASE (cpl_ratings)
 {
        dcp::CPL cpl ("annotation", dcp::FEATURE);
 
-       list<dcp::Rating> ratings;
+       vector<dcp::Rating> ratings;
        ratings.push_back (dcp::Rating("http://www.mpaa.org/2003-ratings", "PG-13"));
        ratings.push_back (dcp::Rating("http://www.movielabs.com/md/ratings/GB/BBFC/1/12A%3C/Agency", "12A"));
        cpl.set_ratings (ratings);
@@ -86,6 +87,6 @@ BOOST_AUTO_TEST_CASE (cpl_ratings)
                );
 
        dcp::CPL cpl2 ("build/test/cpl_ratings.xml");
-       list<dcp::Rating> ratings2 = cpl2.ratings ();
+       vector<dcp::Rating> ratings2 = cpl2.ratings ();
        BOOST_TEST(ratings == ratings2);
 }