class RWLock should not be in the Exiv2::Internal namespace

This commit is contained in:
Robin Mills 2017-03-07 21:30:05 +00:00
parent 2ebacb6b0b
commit 54cfc47346
3 changed files with 11 additions and 13 deletions

View File

@ -109,11 +109,11 @@ namespace Exiv2 {
//! Prevent assignment: not implemented.
XmpProperties& operator=(const XmpProperties& rhs);
private:
private:
static const XmpNsInfo* nsInfoUnsafe(const std::string& prefix);
static void unregisterNsUnsafe(const std::string& ns);
static const XmpNsInfo* lookupNsRegistryUnsafe(const XmpNsInfo::Prefix& prefix);
public:
/*!
@brief Return the title (label) of the property.
@ -213,7 +213,7 @@ namespace Exiv2 {
@note This invalidates XMP keys generated in this namespace.
*/
static void unregisterNs(const std::string& ns);
static Internal::RWLock rwLock_;
static Exiv2::RWLock rwLock_;
/*!
@brief Unregister all custom namespaces.

View File

@ -27,7 +27,6 @@
#endif
namespace Exiv2 {
namespace Internal {
#ifdef _MSC_VER
// Visual Studio 2013 and later use SRWLOCK
#if _MSC_VER >= 1800
@ -207,7 +206,6 @@ namespace Exiv2 {
private:
RWLock &rwlock_;
};
}
}
#endif // RW_LOCK_HPP

View File

@ -2488,11 +2488,11 @@ namespace Exiv2 {
}
XmpProperties::NsRegistry XmpProperties::nsRegistry_;
Internal::RWLock XmpProperties::rwLock_;
Exiv2::RWLock XmpProperties::rwLock_;
const XmpNsInfo* XmpProperties::lookupNsRegistry(const XmpNsInfo::Prefix& prefix)
{
Internal::ScopedReadLock srl(rwLock_);
ScopedReadLock srl(rwLock_);
return lookupNsRegistryUnsafe(prefix);
}
@ -2508,7 +2508,7 @@ namespace Exiv2 {
void XmpProperties::registerNs(const std::string& ns,
const std::string& prefix)
{
Internal::ScopedWriteLock swl(rwLock_);
ScopedWriteLock swl(rwLock_);
std::string ns2 = ns;
if ( ns2.substr(ns2.size() - 1, 1) != "/"
@ -2541,7 +2541,7 @@ namespace Exiv2 {
void XmpProperties::unregisterNs(const std::string& ns)
{
Internal::ScopedWriteLock swl(rwLock_);
ScopedWriteLock swl(rwLock_);
unregisterNsUnsafe(ns);
}
@ -2557,7 +2557,7 @@ namespace Exiv2 {
void XmpProperties::unregisterNs()
{
Internal::ScopedWriteLock swl(rwLock_);
ScopedWriteLock swl(rwLock_);
NsRegistry::iterator i = nsRegistry_.begin();
while (i != nsRegistry_.end()) {
@ -2568,7 +2568,7 @@ namespace Exiv2 {
std::string XmpProperties::prefix(const std::string& ns)
{
Internal::ScopedReadLock srl(rwLock_);
ScopedReadLock srl(rwLock_);
std::string ns2 = ns;
if ( ns2.substr(ns2.size() - 1, 1) != "/"
&& ns2.substr(ns2.size() - 1, 1) != "#") ns2 += "/";
@ -2586,7 +2586,7 @@ namespace Exiv2 {
std::string XmpProperties::ns(const std::string& prefix)
{
Internal::ScopedReadLock srl(rwLock_);
ScopedReadLock srl(rwLock_);
const XmpNsInfo* xn = lookupNsRegistryUnsafe(XmpNsInfo::Prefix(prefix));
if (xn != 0) return xn->ns_;
return nsInfoUnsafe(prefix)->ns_;
@ -2653,7 +2653,7 @@ namespace Exiv2 {
const XmpNsInfo* XmpProperties::nsInfo(const std::string& prefix)
{
Internal::ScopedReadLock srl(rwLock_);
ScopedReadLock srl(rwLock_);
return nsInfoUnsafe(prefix);
}