summaryrefslogtreecommitdiff
path: root/src/MXF.cpp
diff options
context:
space:
mode:
authormilla <marc.illa@dolby.com>2021-05-26 13:59:19 +0200
committermilla <marc.illa@dolby.com>2021-06-03 14:05:45 +0200
commitfdd28f8bb3608978e75b27c5410db447396f361b (patch)
tree4fd3e9ff4fa808993214956dd5753f950a6a1e47 /src/MXF.cpp
parentf9d7fbc33aa571c547d916b145712469efd9f4b8 (diff)
Put definitions inside their corresponding namespaces
Diffstat (limited to 'src/MXF.cpp')
-rwxr-xr-xsrc/MXF.cpp44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/MXF.cpp b/src/MXF.cpp
index 94c94ad..5fcc0a6 100755
--- a/src/MXF.cpp
+++ b/src/MXF.cpp
@@ -552,8 +552,8 @@ ASDCP::MXF::Primer::InsertTag(const MDDEntry& Entry, ASDCP::TagValue& Tag)
ASDCP::Result_t
ASDCP::MXF::Primer::TagForKey(const ASDCP::UL& Key, ASDCP::TagValue& Tag)
{
- assert(m_Lookup);
- if ( m_Lookup.empty() )
+
+ if ( !m_Lookup || m_Lookup.empty() )
{
DefaultLogSink().Error("Primer lookup is empty\n");
return RESULT_FAIL;
@@ -1509,26 +1509,35 @@ ASDCP::MXF::InterchangeObject::IsA(const byte_t* label)
//------------------------------------------------------------------------------------------
-struct FactoryCompareUL
+namespace ASDCP {
+namespace MXF
{
- bool operator()(const ASDCP::UL& lhs, const ASDCP::UL& rhs) const
+ struct FactoryCompareUL
{
- ui32_t test_size = lhs.Size() < rhs.Size() ? lhs.Size() : rhs.Size();
-
- for (ui32_t i = 0; i < test_size; i++)
+ bool operator()(const ASDCP::UL& lhs, const ASDCP::UL& rhs) const
{
- if (i == 7) continue; // skip version to be symmetrical with UL::operator==
- if (lhs.Value()[i] != rhs.Value()[i])
- return lhs.Value()[i] < rhs.Value()[i];
- }
+ ui32_t test_size = lhs.Size() < rhs.Size() ? lhs.Size() : rhs.Size();
- return false;
- }
-};
+ for (ui32_t i = 0; i < test_size; i++)
+ {
+ if (i == 7) continue; // skip version to be symmetrical with UL::operator==
+ if (lhs.Value()[i] != rhs.Value()[i])
+ return lhs.Value()[i] < rhs.Value()[i];
+ }
-typedef std::map<ASDCP::UL, ASDCP::MXF::MXFObjectFactory_t, FactoryCompareUL>FactoryMap_t;
+ return false;
+ }
+ };
+}
+} // namespace asdcp
+
+typedef std::map<ASDCP::UL, ASDCP::MXF::MXFObjectFactory_t, ASDCP::MXF::FactoryCompareUL>FactoryMap_t;
typedef FactoryMap_t::iterator FLi_t;
+namespace ASDCP {
+
+namespace MXF
+{
//
class FactoryList : public FactoryMap_t
{
@@ -1559,8 +1568,11 @@ public:
}
};
+} // namespace MXF
+} // namespace asdcp
+
//
-static FactoryList s_FactoryList;
+static ASDCP::MXF::FactoryList s_FactoryList;
static Kumu::Mutex s_InitLock;
static bool s_TypesInit = false;