#include <RefCount.h>

Collaboration diagram for RefCount< C >:

Public Member Functions

 RefCount ()
 
 RefCount (C const *p)
 
 ~RefCount ()
 
 RefCount (const RefCount &p)
 
 RefCount (RefCount &&p)
 
template<class Other >
 RefCount (const RefCount< Other > &p)
 Base::Pointer = Derived::Pointer. More...
 
RefCountoperator= (const RefCount &p)
 
RefCountoperator= (RefCount &&p)
 
RefCountoperator= (std::nullptr_t)
 
 operator bool () const
 
bool operator! () const
 
Coperator-> () const
 
Coperator* () const
 
CgetRaw () const
 
bool operator== (const RefCount &p) const
 
bool operator!= (const RefCount &p) const
 
template<class Other >
bool operator== (const Other *const p) const
 
template<class Other >
bool operator!= (const Other *const p) const
 

Static Public Member Functions

template<typename... Args>
static auto Make (Args &&... args)
 

Private Member Functions

void dereference (C const *newP=nullptr)
 
void reference (const RefCount &p)
 

Private Attributes

C const * p_
 

Detailed Description

template<class C>
class RefCount< C >

Template for Reference Counting pointers.

Objects of type 'C' must inherit from 'RefCountable' in base/Lock.h which provides the locking interface used by reference counting.

Definition at line 27 of file RefCount.h.

Constructor & Destructor Documentation

◆ RefCount() [1/5]

template<class C >
RefCount< C >::RefCount ( )
inline

Definition at line 37 of file RefCount.h.

◆ RefCount() [2/5]

template<class C >
RefCount< C >::RefCount ( C const *  p)
inline

Definition at line 39 of file RefCount.h.

References RefCount< C >::reference().

◆ ~RefCount()

template<class C >
RefCount< C >::~RefCount ( )
inline

Definition at line 41 of file RefCount.h.

References RefCount< C >::dereference().

◆ RefCount() [3/5]

template<class C >
RefCount< C >::RefCount ( const RefCount< C > &  p)
inline

Definition at line 45 of file RefCount.h.

References RefCount< C >::reference().

◆ RefCount() [4/5]

template<class C >
RefCount< C >::RefCount ( RefCount< C > &&  p)
inline

Definition at line 49 of file RefCount.h.

◆ RefCount() [5/5]

template<class C >
template<class Other >
RefCount< C >::RefCount ( const RefCount< Other > &  p)
inline

Definition at line 55 of file RefCount.h.

References RefCount< C >::reference().

Member Function Documentation

◆ dereference()

template<class C >
void RefCount< C >::dereference ( C const *  newP = nullptr)
inlineprivate

Definition at line 112 of file RefCount.h.

References C, and RefCount< C >::p_.

Referenced by RefCount< C >::~RefCount(), and RefCount< C >::operator=().

◆ getRaw()

template<class C >
C * RefCount< C >::getRaw ( ) const
inline

Definition at line 89 of file RefCount.h.

References C, and RefCount< C >::p_.

Referenced by esiChoose::esiChoose(), ESIInclude::ESIInclude(), Snmp::Inquirer::Inquirer(), SBuf::Locker::Locker(), actualReplyHeader(), external_acl::add(), esiRemove::addElement(), esiTry::addElement(), esiChoose::addElement(), esiSequence::addElement(), ESIContext::addStackElement(), addSwapDir(), StoreEntry::adjustVary(), ESISegment::adsorbList(), TunnelStateData::advanceDestination(), ESIContext::appendOutboundData(), Mgr::Inquirer::applyQueryParams(), asnCacheStart(), Format::Format::assemble(), AuthenticateAcl(), authenticateAuthenticateUser(), ErrorState::buildBody(), ConnStateData::buildFakeRequest(), ErrorState::BuildHttpReply(), Http::One::Server::buildHttpRequest(), Downloader::buildRequest(), HttpStateData::buildRequestPrefix(), ConnStateData::buildSslCertGenerationParams(), StoreEntry::calcPublicKey(), DiskdFile::canNotifyClient(), ProxyAuthLookup::checkForAsync(), htcpSpecifier::checkHit(), esiChoose::checkValidSource(), clientAclChecklistFill(), clientGetMoreData(), clientProcessRequest(), clientReplyStatus(), clientStreamDetach(), clientStreamInsertHead(), clientStreamRead(), ESISegment::cloneList(), BlockingFile::close(), DiskdFile::close(), DiskThreadsDiskFile::close(), comm_read_cancel(), comm_remove_close_handler(), ErrorState::compileLegacyCode(), TunnelStateData::connectDone(), DiskdFile::create(), Fs::Ufs::UFSStrategy::create(), Ftp::Server::doProcessRequest(), HttpStateData::drop1xx(), ErrorState::Dump(), ESISegment::dumpToLog(), Adaptation::Icap::ModXact::encapsulateHead(), esiBufferRecipient(), esiProcessStream(), esiStreamDetach(), esiStreamRead(), esiStreamStatus(), external_acl_cache_delete(), external_acl_cache_touch(), ESIVarState::extractChar(), CommonPool::Factory(), esiChoose::fail(), htcpSpecifier::fillChecklist(), UrnState::fillChecklist(), Ssl::ErrorDetailsManager::findDetail(), findPreviouslyCachedEntry(), ESIAssign::finish(), esiTry::finish(), esiChoose::finish(), FinishAnElement(), ESIContext::finishChildren(), ESIContext::fixupOutboundTail(), HttpStateData::forwardUpgrade(), ftpSendReply(), Client::handleAdaptationBlocked(), Client::handledEarlyAdaptationAbort(), Ftp::Server::handleFeatReply(), Http::Tunneler::handleResponse(), ESIContext::hasCachedAST(), HttpStateData::haveParsedReplyHeaders(), htcpAccessAllowed(), htcpClrStore(), httpHdrAdd(), httpHdrMangle(), httpMaybeRemovePublic(), ConnStateData::httpsPeeked(), icapLogLog(), ESIContext::kick(), ESISegment::listAppend(), ESISegment::listLength(), ESISegment::listToChar(), ESISegment::ListTransfer(), MimeIcon::load(), ClientHttpRequest::logRequest(), esiChoose::makeCachableElements(), esiSequence::makeCachableElements(), esiTry::makeCacheable(), esiChoose::makeCacheable(), esiSequence::makeCacheable(), HappyConnOpener::makeError(), esiTry::makeUsable(), esiChoose::makeUsable(), esiChoose::makeUsableElements(), esiSequence::makeUsableElements(), Acl::NoteCheck::match(), Client::maybePurgeOthers(), netdbExchangeStart(), ErrorState::NewForwarding(), ClientHttpRequest::noteAdaptationAnswer(), Client::noteAdaptationAnswer(), Adaptation::Icap::ServiceRep::noteAdaptationAnswer(), Adaptation::Iterator::noteAdaptationAnswer(), TunnelStateData::noteConnection(), TunnelStateData::noteDestinationsEnd(), TunnelStateData::noteSecurityPeerConnectorAnswer(), Mgr::Inquirer::noteWroteHeader(), esiTry::notifyParent(), esiChoose::NULLUnChosen(), MemObject::objectBytesOnDisk(), DiskdFile::open(), Fs::Ufs::UFSStrategy::open(), HappyConnOpener::openFreshConnection(), PeerPoolMgr::openNewConnection(), DelayId::operator bool(), DelayTaggedUpdateVisitor::operator()(), DelayUserUpdateVisitor::operator()(), PeerConnectionPointer::operator->(), operator<<(), operator==(), ESIContext::parse(), ESIContext::parseOneBuffer(), Adaptation::Icap::OptXact::parseResponse(), ConnStateData::parseTlsHandshake(), peerAllowedToUse(), Adaptation::Icap::ModXact::prepEchoing(), Http::One::Server::proceedAfterBodyContinuation(), ESIContext::process(), esiTry::process(), esiChoose::process(), esiLiteral::process(), esiSequence::process(), Http::One::Server::processParsedRequest(), esiSequence::provideData(), ESIContext::provideData(), BlockingFile::read(), DiskdFile::read(), DiskThreadsDiskFile::read(), Rock::SwapDir::readCompleted(), Fs::Ufs::UFSStoreState::readCompleted(), refreshCheckDigest(), esiComment::render(), esiTry::render(), esiChoose::render(), ESIInclude::render(), esiLiteral::render(), Fs::Ufs::UFSSwapDir::replacementRemove(), TunnelStateData::retryOrBail(), BandwidthBucket::SelectBucket(), ESIContext::send(), DiskdIOStrategy::send(), Client::sendBodyIsTooLargeError(), ConnStateData::sendControlMsg(), Http::One::Server::setReplyError(), ESIInclude::start(), ESIContext::start(), ESIInclude::Start(), UrnState::start(), ConnStateData::startPeekAndSplice(), MemObject::stat(), Ftp::Server::stopWaitingForOrigin(), ESIInclude::subRequestDone(), StoreEntry::swapOutFileClose(), ESISegment::tail(), TestRefCount::testDoubleInheritToSingleInherit(), TestRefCount::testPointerConst(), TestRefCount::testPointerFromRefCounter(), TestRefCount::testRefCountFromConst(), TestStoreController::testSearch(), TestStoreHashIndex::testSearch(), ESIContext::trimBlanks(), TunnelStateData::tunnelEstablishmentDone(), ESIContext::updateCachedAST(), urnHandleReply(), TunnelStateData::usePinned(), ACLFilledChecklist::verifyAle(), and Rock::SwapDir::writeCompleted().

◆ Make()

template<class C >
template<typename... Args>
static auto RefCount< C >::Make ( Args &&...  args)
inlinestatic

creates a new C object using given C constructor arguments (if any)

Returns
a refcounting pointer to the created object

Definition at line 34 of file RefCount.h.

References C.

◆ operator bool()

template<class C >
RefCount< C >::operator bool ( ) const
inlineexplicit

Definition at line 78 of file RefCount.h.

References RefCount< C >::p_.

◆ operator!()

template<class C >
bool RefCount< C >::operator! ( ) const
inline

Definition at line 80 of file RefCount.h.

References RefCount< C >::p_.

◆ operator!=() [1/2]

template<class C >
template<class Other >
bool RefCount< C >::operator!= ( const Other *const  p) const
inline

Definition at line 106 of file RefCount.h.

References RefCount< C >::p_.

◆ operator!=() [2/2]

template<class C >
bool RefCount< C >::operator!= ( const RefCount< C > &  p) const
inline

Definition at line 95 of file RefCount.h.

References RefCount< C >::p_.

◆ operator*()

template<class C >
C & RefCount< C >::operator* ( ) const
inline

Definition at line 84 of file RefCount.h.

References assert, C, and RefCount< C >::p_.

◆ operator->()

template<class C >
C * RefCount< C >::operator-> ( ) const
inline

Definition at line 82 of file RefCount.h.

References C, and RefCount< C >::p_.

◆ operator=() [1/3]

template<class C >
RefCount & RefCount< C >::operator= ( const RefCount< C > &  p)
inline

◆ operator=() [2/3]

template<class C >
RefCount & RefCount< C >::operator= ( RefCount< C > &&  p)
inline

Definition at line 68 of file RefCount.h.

References RefCount< C >::dereference().

◆ operator=() [3/3]

template<class C >
RefCount & RefCount< C >::operator= ( std::nullptr_t  )
inline

Definition at line 76 of file RefCount.h.

References RefCount< C >::dereference().

◆ operator==() [1/2]

template<class C >
template<class Other >
bool RefCount< C >::operator== ( const Other *const  p) const
inline

Definition at line 100 of file RefCount.h.

References RefCount< C >::p_.

◆ operator==() [2/2]

template<class C >
bool RefCount< C >::operator== ( const RefCount< C > &  p) const
inline

Definition at line 91 of file RefCount.h.

References RefCount< C >::p_.

◆ reference()

template<class C >
void RefCount< C >::reference ( const RefCount< C > &  p)
inlineprivate

Definition at line 124 of file RefCount.h.

References RefCount< C >::p_.

Referenced by RefCount< C >::RefCount(), and RefCount< C >::operator=().

Member Data Documentation

◆ p_


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors