VMware GemFire Native C++ Reference
9.2.4
SharedBase.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#ifndef GEODE_SHAREDBASE_H_
4
#define GEODE_SHAREDBASE_H_
5
6
// SharedBase.hpp -*- mode: c++ -*-
7
8
/*
9
* Licensed to the Apache Software Foundation (ASF) under one or more
10
* contributor license agreements. See the NOTICE file distributed with
11
* this work for additional information regarding copyright ownership.
12
* The ASF licenses this file to You under the Apache License, Version 2.0
13
* (the "License"); you may not use this file except in compliance with
14
* the License. You may obtain a copy of the License at
15
*
16
* http://www.apache.org/licenses/LICENSE-2.0
17
*
18
* Unless required by applicable law or agreed to in writing, software
19
* distributed under the License is distributed on an "AS IS" BASIS,
20
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
* See the License for the specific language governing permissions and
22
* limitations under the License.
23
*/
24
25
#include "geode_globals.hpp"
26
30
namespace
apache
{
31
namespace
geode
{
32
namespace
client {
33
40
class
CPPCACHE_EXPORT
SharedBase
{
41
public
:
43
inline
SharedBase
() : m_refCount(0) {}
44
46
void
preserveSB()
const
;
47
52
void
releaseSB()
const
;
53
55
inline
int32_t
refCount
() {
return
m_refCount; }
56
57
protected
:
58
inline
SharedBase
(
bool
noInit) {}
59
60
virtual
~SharedBase() {}
61
62
private
:
63
mutable
volatile
int32_t m_refCount;
64
65
void
operator=(
const
SharedBase& rhs);
66
};
67
73
class
CPPCACHE_EXPORT
NullSharedBase
:
public
SharedBase
{
74
public
:
75
static
const
NullSharedBase
*
const
s_instancePtr;
76
77
private
:
78
NullSharedBase
() {}
79
// never defined
80
NullSharedBase
(
const
NullSharedBase
&);
81
NullSharedBase
& operator=(
const
NullSharedBase
&);
82
83
friend
class
SharedBase
;
// just to get rid of warning with gcc3.x
84
};
85
}
// namespace client
86
}
// namespace geode
87
}
// namespace apache
88
89
#define NULLPTR ::apache::geode::client::NullSharedBase::s_instancePtr
90
91
#endif // GEODE_SHAREDBASE_H_
apache
Each enum represents a predefined RegionAttributes in a {}.
Definition:
Assert.hpp:31
geode
apache::geode::client::NullSharedBase
Class encapsulating a NULL SharedBase smart pointer.
Definition:
SharedBase.hpp:73
CPPCACHE_EXPORT
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition:
geode_base.hpp:58
apache::geode::client::SharedBase::refCount
int32_t refCount()
Definition:
SharedBase.hpp:55
apache::geode::client::SharedBase::SharedBase
SharedBase()
Constructor.
Definition:
SharedBase.hpp:43
apache::geode::client::SharedBase
Definition:
SharedBase.hpp:40
Pivotal GemFire C++ Cache API Documentation