userver: rcu::ReadablePtr< T, RcuTraits > Class Template Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
rcu::ReadablePtr< T, RcuTraits > Class Template Reference

#include <userver/rcu/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* () &&
 

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

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

◆ ~ReadablePtr()

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

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

◆ Get() [2/2]

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

Definition at line 164 of file rcu.hpp.

◆ operator*() [1/2]

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

Definition at line 175 of file rcu.hpp.

◆ operator*() [2/2]

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

Definition at line 174 of file rcu.hpp.

◆ operator->() [1/2]

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

Definition at line 172 of file rcu.hpp.

◆ operator->() [2/2]

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

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


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