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

#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 108 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 110 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 163 of file rcu.hpp.

◆ Get() [2/2]

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

Definition at line 158 of file rcu.hpp.

◆ operator*() [1/2]

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

Definition at line 169 of file rcu.hpp.

◆ operator*() [2/2]

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

Definition at line 168 of file rcu.hpp.

◆ operator->() [1/2]

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

Definition at line 166 of file rcu.hpp.

◆ operator->() [2/2]

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

Definition at line 165 of file rcu.hpp.


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