Stun Server
Compliant with the latest RFCs including 5389, 5769, and 5780
discover the local host's own external IP address
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
refcountobject.cpp
Go to the documentation of this file.
1
/*
2
Copyright 2011 John Selbie
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16
17
18
#include "
commonincludes.hpp
"
19
#include "
refcountobject.h
"
20
21
22
#include "
atomichelpers.h
"
23
24
25
CBasicRefCount::CBasicRefCount
()
26
{
27
m_nRefs
= 0;
28
}
29
30
CBasicRefCount::~CBasicRefCount
()
31
{
32
;
33
}
34
35
int
CBasicRefCount::InternalAddRef
()
36
{
37
return
AtomicIncrement
(&
m_nRefs
);
38
}
39
40
int
CBasicRefCount::InternalRelease
()
41
{
42
int
refcount =
AtomicDecrement
(&
m_nRefs
);
43
if
(refcount == 0)
44
{
45
OnFinalRelease
();
46
}
47
return
refcount;
48
}
49
50
void
CBasicRefCount::OnFinalRelease
()
51
{
52
delete
this
;
53
}
54
55
56
commonincludes.hpp
AtomicIncrement
int AtomicIncrement(int *pInt)
Definition:
atomichelpers.cpp:61
CBasicRefCount::OnFinalRelease
virtual void OnFinalRelease()
Definition:
refcountobject.cpp:50
atomichelpers.h
CBasicRefCount::InternalRelease
int InternalRelease()
Definition:
refcountobject.cpp:40
CBasicRefCount::CBasicRefCount
CBasicRefCount()
Definition:
refcountobject.cpp:25
CBasicRefCount::InternalAddRef
int InternalAddRef()
Definition:
refcountobject.cpp:35
CBasicRefCount::m_nRefs
int m_nRefs
Definition:
refcountobject.h:37
CBasicRefCount::~CBasicRefCount
virtual ~CBasicRefCount()
Definition:
refcountobject.cpp:30
refcountobject.h
AtomicDecrement
int AtomicDecrement(int *pInt)
Definition:
atomichelpers.cpp:68
common
refcountobject.cpp
Generated by
1.8.11