proxygen
folly::observer::Snapshot< T > Class Template Reference

#include <Observer.h>

Public Member Functions

const Toperator* () const
 
const Toperator-> () const
 
const Tget () const
 
std::shared_ptr< const TgetShared () const
 
size_t getVersion () const
 

Private Member Functions

 Snapshot (const observer_detail::Core &core, std::shared_ptr< const T > data, size_t version)
 

Private Attributes

std::shared_ptr< const Tdata_
 
size_t version_
 
const observer_detail::Corecore_
 

Friends

class Observer< T >
 

Detailed Description

template<typename T>
class folly::observer::Snapshot< T >

Definition at line 80 of file Observer.h.

Constructor & Destructor Documentation

template<typename T>
folly::observer::Snapshot< T >::Snapshot ( const observer_detail::Core core,
std::shared_ptr< const T data,
size_t  version 
)
inlineprivate

Definition at line 108 of file Observer.h.

References folly::observer::Snapshot< T >::data_.

112  : data_(std::move(data)), version_(version), core_(&core) {
113  DCHECK(data_);
114  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::shared_ptr< const T > data_
Definition: Observer.h:116
ProtocolVersion version
constexpr auto data(C &c) -> decltype(c.data())
Definition: Access.h:71
const observer_detail::Core * core_
Definition: Observer.h:118

Member Function Documentation

template<typename T>
const T* folly::observer::Snapshot< T >::get ( ) const
inline

Definition at line 90 of file Observer.h.

References folly::observer::Snapshot< T >::data_.

90  {
91  return data_.get();
92  }
std::shared_ptr< const T > data_
Definition: Observer.h:116
template<typename T>
std::shared_ptr<const T> folly::observer::Snapshot< T >::getShared ( ) const
inline

Definition at line 94 of file Observer.h.

References folly::observer::Snapshot< T >::data_.

94  {
95  return data_;
96  }
std::shared_ptr< const T > data_
Definition: Observer.h:116
template<typename T>
size_t folly::observer::Snapshot< T >::getVersion ( ) const
inline

Return the version of the observed object.

Definition at line 101 of file Observer.h.

References folly::observer::Snapshot< T >::version_.

Referenced by folly::observer::Observer< T >::needRefresh().

101  {
102  return version_;
103  }
template<typename T>
const T& folly::observer::Snapshot< T >::operator* ( ) const
inline

Definition at line 82 of file Observer.h.

82  {
83  return *get();
84  }
template<typename T>
const T* folly::observer::Snapshot< T >::operator-> ( ) const
inline

Definition at line 86 of file Observer.h.

86  {
87  return get();
88  }

Friends And Related Function Documentation

template<typename T>
friend class Observer< T >
friend

Definition at line 106 of file Observer.h.

Member Data Documentation

template<typename T>
const observer_detail::Core* folly::observer::Snapshot< T >::core_
private

Definition at line 118 of file Observer.h.

Referenced by folly::observer::Observer< T >::needRefresh().

template<typename T>
std::shared_ptr<const T> folly::observer::Snapshot< T >::data_
private
template<typename T>
size_t folly::observer::Snapshot< T >::version_
private

Definition at line 117 of file Observer.h.

Referenced by folly::observer::Snapshot< T >::getVersion().


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