proxygen
intrusive_shared_count< Atom > Struct Template Reference

#include <AtomicSharedPtrCounted.h>

Public Member Functions

 intrusive_shared_count ()
 
void add_ref (uint64_t count=1)
 
uint64_t release_ref (uint64_t count=1)
 

Public Attributes

Atom< uint64_tcounts
 

Detailed Description

template<template< typename > class Atom = std::atomic>
struct intrusive_shared_count< Atom >

Definition at line 20 of file AtomicSharedPtrCounted.h.

Constructor & Destructor Documentation

template<template< typename > class Atom = std::atomic>
intrusive_shared_count< Atom >::intrusive_shared_count ( )
inline

Definition at line 21 of file AtomicSharedPtrCounted.h.

21  {
22  counts.store(0);
23  }

Member Function Documentation

template<template< typename > class Atom = std::atomic>
void intrusive_shared_count< Atom >::add_ref ( uint64_t  count = 1)
inline

Definition at line 24 of file AtomicSharedPtrCounted.h.

References count.

24  {
25  counts.fetch_add(count);
26  }
int * count
template<template< typename > class Atom = std::atomic>
uint64_t intrusive_shared_count< Atom >::release_ref ( uint64_t  count = 1)
inline

Definition at line 28 of file AtomicSharedPtrCounted.h.

References count.

28  {
29  return counts.fetch_sub(count);
30  }
int * count

Member Data Documentation

template<template< typename > class Atom = std::atomic>
Atom<uint64_t> intrusive_shared_count< Atom >::counts

Definition at line 31 of file AtomicSharedPtrCounted.h.


The documentation for this struct was generated from the following file: