From fdd28f8bb3608978e75b27c5410db447396f361b Mon Sep 17 00:00:00 2001 From: milla Date: Wed, 26 May 2021 13:59:19 +0200 Subject: Put definitions inside their corresponding namespaces --- src/MXF.cpp | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) (limited to 'src/MXF.cpp') 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::mapFactoryMap_t; + return false; + } + }; +} +} // namespace asdcp + +typedef std::mapFactoryMap_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; -- cgit v1.2.3