NGen
Loading...
Searching...
No Matches
multithreading::cache_slot< T > Struct Template Reference

#include <multithreading.hpp>

+ Collaboration diagram for multithreading::cache_slot< T >:

Public Member Functions

 cache_slot ()=default
 
 cache_slot (cache_slot const &)=delete
 
 cache_slot (cache_slot &&)=delete
 
std::variant< std::shared_ptr< T >, failed_fill > get ()
 
void fill (std::shared_ptr< T > buffer_ptr, bool immediate_use)
 
void fail ()
 

Private Types

enum  STATE : char {
  EMPTY =0 ,
  FILLED =1 ,
  HOT =2 ,
  ERROR =3
}
 

Private Attributes

std::shared_ptr< T > ptr_ = nullptr
 
std::atomic< int > state_ = STATE::EMPTY
 

Member Enumeration Documentation

◆ STATE

template<typename T >
enum multithreading::cache_slot::STATE : char
private
Enumerator
EMPTY 
FILLED 
HOT 
ERROR 

Constructor & Destructor Documentation

◆ cache_slot() [1/3]

template<typename T >
multithreading::cache_slot< T >::cache_slot ( )
default

◆ cache_slot() [2/3]

template<typename T >
multithreading::cache_slot< T >::cache_slot ( cache_slot< T > const & )
delete

◆ cache_slot() [3/3]

template<typename T >
multithreading::cache_slot< T >::cache_slot ( cache_slot< T > && )
delete

Member Function Documentation

◆ fail()

template<typename T >
void multithreading::cache_slot< T >::fail ( )

◆ fill()

template<typename T >
void multithreading::cache_slot< T >::fill ( std::shared_ptr< T > buffer_ptr,
bool immediate_use )

◆ get()

template<typename T >
auto multithreading::cache_slot< T >::get ( )

Member Data Documentation

◆ ptr_

template<typename T >
std::shared_ptr<T> multithreading::cache_slot< T >::ptr_ = nullptr
private

◆ state_

template<typename T >
std::atomic<int> multithreading::cache_slot< T >::state_ = STATE::EMPTY
private

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