tcp: Fix 64 bit build with debugging features enabled.
[haiku.git] / src / kits / translation / Translator.cpp
blob5699901c426eb262b7a029cc7ba91ee692765efa
1 /*
2 * Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Michael Wilber
7 * Axel Dörfler, axeld@pinc-software.de
8 */
11 #include "TranslatorRosterPrivate.h"
13 #include <Translator.h>
16 BTranslator::BTranslator()
18 fOwningRoster(NULL),
19 fID(0),
20 fRefCount(1)
25 BTranslator::~BTranslator()
27 if (fOwningRoster != NULL)
28 fOwningRoster->TranslatorDeleted(fID);
32 /*!
33 Increments the refcount and returns a pointer to this object.
35 BTranslator *BTranslator::Acquire()
37 if (atomic_add(&fRefCount, 1) > 0)
38 return this;
40 return NULL;
44 /*!
45 Decrements the refcount and returns a pointer to this object.
46 When the refcount hits zero, the object is destroyed. This is
47 so multiple objects can own the BTranslator and it won't get
48 deleted until all of them are done with it.
50 \return NULL, if the object was just deleted
52 BTranslator *BTranslator::Release()
54 int32 oldValue = atomic_add(&fRefCount, -1);
55 if (oldValue > 0)
56 return this;
58 delete this;
59 return NULL;
63 int32
64 BTranslator::ReferenceCount()
66 return fRefCount;
70 /*!
71 This virtual function is for creating a configuration view
72 for the translator so the user can change its settings.
73 This method is optional.
75 status_t
76 BTranslator::MakeConfigurationView(BMessage* ioExtension,
77 BView** outView, BRect* outExtent)
79 return B_ERROR;
83 /*!
84 Puts the current configuration for the translator into
85 ioExtension. This method is optional.
87 status_t
88 BTranslator::GetConfigurationMessage(BMessage* ioExtension)
90 return B_ERROR;
94 status_t BTranslator::_Reserved_Translator_0(int32 n, void *p) { return B_ERROR; }
95 status_t BTranslator::_Reserved_Translator_1(int32 n, void *p) { return B_ERROR; }
96 status_t BTranslator::_Reserved_Translator_2(int32 n, void *p) { return B_ERROR; }
97 status_t BTranslator::_Reserved_Translator_3(int32 n, void *p) { return B_ERROR; }
98 status_t BTranslator::_Reserved_Translator_4(int32 n, void *p) { return B_ERROR; }
99 status_t BTranslator::_Reserved_Translator_5(int32 n, void *p) { return B_ERROR; }
100 status_t BTranslator::_Reserved_Translator_6(int32 n, void *p) { return B_ERROR; }
101 status_t BTranslator::_Reserved_Translator_7(int32 n, void *p) { return B_ERROR; }