TrueReality  v0.1.1912
SmrtClass.cpp
Go to the documentation of this file.
1 /*
2 * True Reality Open Source Game and Simulation Engine
3 * Copyright © 2021 Acid Rain Studios LLC
4 *
5 * This library is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the Free
7 * Software Foundation; either version 3.0 of the License, or (at your option)
8 * any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * @author Maxim Serebrennik
20 */
21 
22 #include <trBase/SmrtClass.h>
23 
24 namespace trBase
25 {
28  {
29  return false;
30  }
31 
33  OpenThreads::Mutex * SmrtClass::GetRefMutex() const
34  {
35  return BaseClass::getRefMutex();
36  }
37 
39  OpenThreads::Mutex * SmrtClass::GetGlobalReferencedMutex()
40  {
41  return BaseClass::getGlobalReferencedMutex();
42  }
43 
45  inline int SmrtClass::Ref() const
46  {
47  return BaseClass::ref();
48  }
49 
51  inline int SmrtClass::Unref() const
52  {
53  return BaseClass::unref();
54  }
55 
58  {
59  return BaseClass::unref_nodelete();
60  }
61 
63  inline int SmrtClass::ReferenceCount() const
64  {
65  return BaseClass::referenceCount();
66  }
67 }
int ReferenceCount() const
Return the number of pointers currently referencing this object.
Definition: SmrtClass.cpp:63
int Unref() const
Decrement the reference count by one, indicating that a pointer to this object is no longer referenci...
Definition: SmrtClass.cpp:51
int UnRefNoDelete() const
Decrement the reference count by one, indicating that a pointer to this object is no longer referenci...
Definition: SmrtClass.cpp:57
int Ref() const
Increment the reference count by one, indicating that this object has another pointer which is refere...
Definition: SmrtClass.cpp:45
virtual bool GetThreadSafeRefUnref()
Get whether a mutex is used to ensure Ref() and UnRef() are thread safe.
Definition: SmrtClass.cpp:27
OpenThreads::Mutex * GetRefMutex() const
Get the mutex used to ensure thread safety of Ref()/UnRef().
Definition: SmrtClass.cpp:33
static OpenThreads::Mutex * GetGlobalReferencedMutex()
Get the optional global Referenced mutex, this can be shared between all trBase::SmrtClass.
Definition: SmrtClass.cpp:39