From 757bc7b9345d8578f5f1cca055762b62019a4c97 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 25 Jan 2005 16:10:03 +0000 Subject: [PATCH] Renamed Referencable to Referenceable (mainly to make Axel happier :-). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11035 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/registrar/Jamfile | 2 +- src/servers/registrar/MessageDeliverer.cpp | 6 +++--- .../{Referencable.cpp => Referenceable.cpp} | 17 ++++++++++------- .../{Referencable.h => Referenceable.h} | 13 ++++++++----- 4 files changed, 22 insertions(+), 16 deletions(-) rename src/servers/registrar/{Referencable.cpp => Referenceable.cpp} (54%) rename src/servers/registrar/{Referencable.h => Referenceable.h} (86%) 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