summaryrefslogtreecommitdiff
path: root/src/MXF.h
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2015-11-10 19:40:55 +0000
committerjhurst <>2015-11-10 19:40:55 +0000
commit02915821cfb49cb6851086f5d991cee58328102b (patch)
treec71cb099421c6ecf71a5a5ac469ba5e7fcfc413d /src/MXF.h
parentf758bec505d45084d2563f20514ab4a81b27283a (diff)
release
Diffstat (limited to 'src/MXF.h')
-rwxr-xr-xsrc/MXF.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/MXF.h b/src/MXF.h
index 046a7b2..b90ebb7 100755
--- a/src/MXF.h
+++ b/src/MXF.h
@@ -235,8 +235,12 @@ namespace ASDCP
public:
optional_property() : m_has_value(false) {}
- optional_property(const PropertyType& value) : m_property(value), m_has_value(false) {}
- const optional_property<PropertyType>& operator=(const PropertyType& rhs) { this->m_property = rhs; this->m_has_value = true; return *this; }
+ optional_property(const PropertyType& value) : m_property(value), m_has_value(true) {}
+ const optional_property<PropertyType>& operator=(const PropertyType& rhs) {
+ this->m_property = rhs;
+ this->m_has_value = true;
+ return *this;
+ }
bool operator==(const PropertyType& rhs) const { return this->m_property == rhs; }
bool operator==(const optional_property<PropertyType>& rhs) const { return this->m_property == rhs.m_property; }
operator PropertyType&() { return this->m_property; }
@@ -248,6 +252,30 @@ namespace ASDCP
const PropertyType& const_get() const { return m_property; }
};
+ // wrapper object manages optional properties
+ template <class PropertyType>
+ class optional_container_property
+ {
+ PropertyType m_property;
+
+ public:
+ optional_container_property() {}
+ optional_container_property(const PropertyType& value) : m_property(value) {}
+ const optional_container_property<PropertyType>& operator=(const PropertyType& rhs) {
+ this->Copy(rhs.m_property);
+ return *this;
+ }
+
+ bool operator==(const PropertyType& rhs) const { return this->m_property == rhs; }
+ bool operator==(const optional_property<PropertyType>& rhs) const { return this->m_property == rhs.m_property; }
+ operator PropertyType&() { return this->m_property; }
+ void set(const PropertyType& rhs) { this->m_property = rhs; }
+ void reset(const PropertyType& rhs) { this->clear(); }
+ bool empty() const { return ! this->m_property.HasValue(); }
+ PropertyType& get() { return m_property; }
+ const PropertyType& const_get() const { return m_property; }
+ };
+
// base class of all metadata objects
//
class InterchangeObject : public ASDCP::KLVPacket