proxygen
counted_ptr_internals< Atom > Class Template Reference

#include <AtomicSharedPtrCounted.h>

Inheritance diagram for counted_ptr_internals< Atom >:
counted_ptr_base< Atom >

Public Types

template<typename T >
using CountedPtr = counted_ptr< T, Atom >
 
typedef void counted_base
 

Static Public Member Functions

template<typename T , typename... Args>
static counted_ptr< T, Atommake_ptr (Args &&...args)
 
template<typename T >
static counted_baseget_counted_base (const counted_ptr< T, Atom > &bar)
 
template<typename T >
static Tget_shared_ptr (counted_base *base)
 
template<typename T >
static Trelease_ptr (counted_ptr< T, Atom > &p)
 
template<typename T >
static counted_ptr< T, Atomget_shared_ptr_from_counted_base (counted_base *base, bool inc=true)
 
static void inc_shared_count (counted_base *base, int64_t count)
 
template<typename T >
static void release_shared (counted_base *base, uint64_t count)
 

Additional Inherited Members

- Static Protected Member Functions inherited from counted_ptr_base< Atom >
static intrusive_shared_count< Atom > * getRef (void *pt)
 

Detailed Description

template<template< typename > class Atom = std::atomic>
class counted_ptr_internals< Atom >

Definition at line 116 of file AtomicSharedPtrCounted.h.

Member Typedef Documentation

template<template< typename > class Atom = std::atomic>
typedef void counted_ptr_internals< Atom >::counted_base

Definition at line 124 of file AtomicSharedPtrCounted.h.

template<template< typename > class Atom = std::atomic>
template<typename T >
using counted_ptr_internals< Atom >::CountedPtr = counted_ptr<T, Atom>

Definition at line 123 of file AtomicSharedPtrCounted.h.

Member Function Documentation

template<template< typename > class Atom = std::atomic>
template<typename T >
static counted_base* counted_ptr_internals< Atom >::get_counted_base ( const counted_ptr< T, Atom > &  bar)
inlinestatic

Definition at line 127 of file AtomicSharedPtrCounted.h.

References counted_ptr< T, Atom >::p_.

127  {
128  return bar.p_;
129  }
template<template< typename > class Atom = std::atomic>
template<typename T >
static T* counted_ptr_internals< Atom >::get_shared_ptr ( counted_base base)
inlinestatic

Definition at line 132 of file AtomicSharedPtrCounted.h.

References T.

132  {
133  return (T*)base;
134  }
#define T(v)
Definition: http_parser.c:233
template<template< typename > class Atom = std::atomic>
template<typename T >
static counted_ptr<T, Atom> counted_ptr_internals< Atom >::get_shared_ptr_from_counted_base ( counted_base base,
bool  inc = true 
)
inlinestatic

Definition at line 144 of file AtomicSharedPtrCounted.h.

References T.

146  {
147  auto res = counted_ptr<T, Atom>(counted_shared_tag(), (T*)(base));
148  if (!inc) {
149  release_shared<T>(base, 1);
150  }
151  return res;
152  }
#define T(v)
Definition: http_parser.c:233
template<template< typename > class Atom = std::atomic>
static void counted_ptr_internals< Atom >::inc_shared_count ( counted_base base,
int64_t  count 
)
inlinestatic

Definition at line 154 of file AtomicSharedPtrCounted.h.

References counted_ptr_base< Atom >::getRef().

154  {
155  counted_ptr_base<Atom>::getRef(base)->add_ref(count);
156  }
static intrusive_shared_count< Atom > * getRef(void *pt)
int * count
template<template< typename > class Atom = std::atomic>
template<typename T , typename... Args>
static counted_ptr<T, Atom> counted_ptr_internals< Atom >::make_ptr ( Args &&...  args)
inlinestatic

Definition at line 119 of file AtomicSharedPtrCounted.h.

References testing::Args().

119  {
120  return make_counted<Atom, T>(std::forward<Args...>(args...));
121  }
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
template<template< typename > class Atom = std::atomic>
template<typename T >
static T* counted_ptr_internals< Atom >::release_ptr ( counted_ptr< T, Atom > &  p)
inlinestatic

Definition at line 137 of file AtomicSharedPtrCounted.h.

References counted_ptr< T, Atom >::p_.

137  {
138  auto res = p.p_;
139  p.p_ = nullptr;
140  return res;
141  }
template<template< typename > class Atom = std::atomic>
template<typename T >
static void counted_ptr_internals< Atom >::release_shared ( counted_base base,
uint64_t  count 
)
inlinestatic

Definition at line 159 of file AtomicSharedPtrCounted.h.

References bm::free(), and T.

159  {
160  if (count == counted_ptr_base<Atom>::getRef(base)->release_ref(count)) {
161  ((T*)base)->~T();
163  }
164  }
#define T(v)
Definition: http_parser.c:233
void free()
int * count

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