X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdkdm_wrapper.h;h=09e9d25c428c3808869fc6b20429edcc9fa73876;hb=234bca29f70aeeba4fffd67f987de876ff89b6cc;hp=b877722d91732eb103a42bee80e86b81ca11e44b;hpb=bfb8c684886592f325f85c490d9f0aafd7056734;p=dcpomatic.git diff --git a/src/lib/dkdm_wrapper.h b/src/lib/dkdm_wrapper.h index b877722d9..09e9d25c4 100644 --- a/src/lib/dkdm_wrapper.h +++ b/src/lib/dkdm_wrapper.h @@ -20,24 +20,39 @@ #include #include +#include namespace xmlpp { class Element; } -class DKDMBase +class DKDMGroup; + +class DKDMBase : public boost::enable_shared_from_this { public: + virtual ~DKDMBase () {} virtual std::string name () const = 0; virtual void as_xml (xmlpp::Element *) const = 0; static boost::shared_ptr read (cxml::ConstNodePtr node); + + boost::shared_ptr parent () const { + return _parent; + } + + void set_parent (boost::shared_ptr parent) { + _parent = parent; + } + +private: + boost::shared_ptr _parent; }; class DKDM : public DKDMBase { public: - DKDM (dcp::EncryptedKDM k) + explicit DKDM (dcp::EncryptedKDM k) : _dkdm (k) {} @@ -55,7 +70,7 @@ private: class DKDMGroup : public DKDMBase { public: - DKDMGroup (std::string name) + explicit DKDMGroup (std::string name) : _name (name) {} @@ -69,7 +84,7 @@ public: return _children; } - void add (boost::shared_ptr child); + void add (boost::shared_ptr child, boost::shared_ptr previous = boost::shared_ptr ()); void remove (boost::shared_ptr child); private: