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 88 of file rcu.hpp.

Public Member Functions

 ReadablePtr (const Variable< T, RcuTraits > &ptr)
 
 ReadablePtr (ReadablePtr< T, RcuTraits > &&other) noexcept
 
ReadablePtroperator= (ReadablePtr< T, RcuTraits > &&other) noexcept
 
 ReadablePtr (const ReadablePtr< T, RcuTraits > &other)
 
ReadablePtroperator= (const ReadablePtr< T, RcuTraits > &other)
 
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() [1/3]

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

Definition at line 90 of file rcu.hpp.

◆ ReadablePtr() [2/3]

template<typename T , typename RcuTraits >
rcu::ReadablePtr< T, RcuTraits >::ReadablePtr ( ReadablePtr< T, RcuTraits > && other)
inlinenoexcept

Definition at line 104 of file rcu.hpp.

◆ ReadablePtr() [3/3]

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

Definition at line 152 of file rcu.hpp.

◆ ~ReadablePtr()

template<typename T , typename RcuTraits >
rcu::ReadablePtr< T, RcuTraits >::~ReadablePtr ( )
inline

Definition at line 160 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 171 of file rcu.hpp.

◆ Get() [2/2]

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

Definition at line 166 of file rcu.hpp.

◆ operator*() [1/2]

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

Definition at line 177 of file rcu.hpp.

◆ operator*() [2/2]

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

Definition at line 176 of file rcu.hpp.

◆ operator->() [1/2]

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

Definition at line 174 of file rcu.hpp.

◆ operator->() [2/2]

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

Definition at line 173 of file rcu.hpp.

◆ operator=() [1/2]

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

Definition at line 155 of file rcu.hpp.

◆ operator=() [2/2]

template<typename T , typename RcuTraits >
ReadablePtr & rcu::ReadablePtr< T, RcuTraits >::operator= ( ReadablePtr< T, RcuTraits > && other)
inlinenoexcept

Definition at line 109 of file rcu.hpp.


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