userver: rcu::ReadablePtr< T, RcuTraits > Class Template Reference
Loading...
Searching...
No Matches
rcu::ReadablePtr< T, RcuTraits > Class Template Referencefinal

#include <userver/rcu/rcu.hpp>

Detailed Description

template<typename T, typename RcuTraits>
class rcu::ReadablePtr< T, RcuTraits >

Reader smart pointer for rcu::Variable<T>. You may use operator*() or operator->() to do something with the stored value. Once created, ReadablePtr references the same immutable value: if Variable's value is changed during ReadablePtr lifetime, it will not affect value referenced by ReadablePtr.

Examples
samples/config_service/config_service.cpp.

Definition at line 206 of file rcu.hpp.

Public Member Functions

 ReadablePtr (const Variable< T, RcuTraits > &ptr)
 
 ReadablePtr (ReadablePtr &&other) noexcept=default
 
ReadablePtroperator= (ReadablePtr &&other) noexcept=default
 
 ReadablePtr (const ReadablePtr &other)=default
 
ReadablePtroperator= (const ReadablePtr &other)=default
 
const T * Get () const &
 
const T * Get () &&
 
const T * operator-> () const &
 
const T * operator-> () &&
 
const T & operator* () const &
 
const T & operator* () &&
 

Constructor & Destructor Documentation

◆ ReadablePtr()

template<typename T , typename RcuTraits >
rcu::ReadablePtr< T, RcuTraits >::ReadablePtr ( const Variable< T, RcuTraits > & ptr)
inlineexplicit

Definition at line 208 of file rcu.hpp.

Member Function Documentation

◆ Get() [1/2]

template<typename T , typename RcuTraits >
const T * rcu::ReadablePtr< T, RcuTraits >::Get ( ) &&
inline

Definition at line 261 of file rcu.hpp.

◆ Get() [2/2]

template<typename T , typename RcuTraits >
const T * rcu::ReadablePtr< T, RcuTraits >::Get ( ) const &
inline

Definition at line 256 of file rcu.hpp.

◆ operator*() [1/2]

template<typename T , typename RcuTraits >
const T & rcu::ReadablePtr< T, RcuTraits >::operator* ( ) &&
inline

Definition at line 267 of file rcu.hpp.

◆ operator*() [2/2]

template<typename T , typename RcuTraits >
const T & rcu::ReadablePtr< T, RcuTraits >::operator* ( ) const &
inline

Definition at line 266 of file rcu.hpp.

◆ operator->() [1/2]

template<typename T , typename RcuTraits >
const T * rcu::ReadablePtr< T, RcuTraits >::operator-> ( ) &&
inline

Definition at line 264 of file rcu.hpp.

◆ operator->() [2/2]

template<typename T , typename RcuTraits >
const T * rcu::ReadablePtr< T, RcuTraits >::operator-> ( ) const &
inline

Definition at line 263 of file rcu.hpp.


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