diff --git a/src/servers/registrar/Jamfile b/src/servers/registrar/Jamfile index 0940cfc088..64cb620390 100644 --- a/src/servers/registrar/Jamfile +++ b/src/servers/registrar/Jamfile @@ -23,7 +23,7 @@ local registrar_sources = PriorityMessageQueue.cpp RecentApps.cpp RecentEntries.cpp - Referencable.cpp + Referenceable.cpp Registrar.cpp RosterAppInfo.cpp RosterSettingsCharStream.cpp diff --git a/src/servers/registrar/MessageDeliverer.cpp b/src/servers/registrar/MessageDeliverer.cpp index 6300743321..7b88b89544 100644 --- a/src/servers/registrar/MessageDeliverer.cpp +++ b/src/servers/registrar/MessageDeliverer.cpp @@ -15,7 +15,7 @@ #include #include "MessageDeliverer.h" -#include "Referencable.h" +#include "Referenceable.h" // sDeliverer -- the singleton instance MessageDeliverer *MessageDeliverer::sDeliverer = NULL; @@ -23,10 +23,10 @@ MessageDeliverer *MessageDeliverer::sDeliverer = NULL; static const bigtime_t kRetryDelay = 20000; // 20 ms // Message -class MessageDeliverer::Message : public Referencable { +class MessageDeliverer::Message : public Referenceable { public: Message(void *data, int32 dataSize) - : Referencable(true), + : Referenceable(true), fData(data), fDataSize(dataSize), fCreationTime(system_time()), diff --git a/src/servers/registrar/Referencable.cpp b/src/servers/registrar/Referenceable.cpp similarity index 54% rename from src/servers/registrar/Referencable.cpp rename to src/servers/registrar/Referenceable.cpp index 065ebb70b9..deada549e7 100644 --- a/src/servers/registrar/Referencable.cpp +++ b/src/servers/registrar/Referenceable.cpp @@ -1,30 +1,33 @@ -// Referencable.cpp +/* + * Copyright 2005, Ingo Weinhold, bonefish@users.sf.net. All rights reserved. + * Distributed under the terms of the MIT License. + */ #include "Debug.h" -#include "Referencable.h" +#include "Referenceable.h" // constructor -Referencable::Referencable(bool deleteWhenUnreferenced) +Referenceable::Referenceable(bool deleteWhenUnreferenced) : fReferenceCount(1), fDeleteWhenUnreferenced(deleteWhenUnreferenced) { } // destructor -Referencable::~Referencable() +Referenceable::~Referenceable() { } // AddReference void -Referencable::AddReference() +Referenceable::AddReference() { atomic_add(&fReferenceCount, 1); } // RemoveReference bool -Referencable::RemoveReference() +Referenceable::RemoveReference() { bool unreferenced = (atomic_add(&fReferenceCount, -1) == 1); if (fDeleteWhenUnreferenced && unreferenced) @@ -34,7 +37,7 @@ Referencable::RemoveReference() // CountReferences int32 -Referencable::CountReferences() const +Referenceable::CountReferences() const { return fReferenceCount; } diff --git a/src/servers/registrar/Referencable.h b/src/servers/registrar/Referenceable.h similarity index 86% rename from src/servers/registrar/Referencable.h rename to src/servers/registrar/Referenceable.h index 400b79f6e0..9acf2d29bd 100644 --- a/src/servers/registrar/Referencable.h +++ b/src/servers/registrar/Referenceable.h @@ -1,16 +1,19 @@ -// Referencable.h +/* + * Copyright 2005, Ingo Weinhold, bonefish@users.sf.net. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef REFERENCABLE_H #define REFERENCABLE_H #include -// Referencable -class Referencable { +// Referenceable +class Referenceable { public: - Referencable( + Referenceable( bool deleteWhenUnreferenced = false); - virtual ~Referencable(); + virtual ~Referenceable(); void AddReference(); bool RemoveReference(); // returns true after last