CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::Channel< T, Lockable >::Writer Class Referencefinal

Awaitable writer for channel More...

#include <CeresEngine/Foundation/Channel.hpp>

Public Member Functions

 Writer (const Writer &)=delete
 Deleted copy constructor.
 
Writeroperator= (const Writer &)=delete
 Deleted copy assignment operator.
 
 Writer (Writer &&rhs) noexcept
 Creates a new writer by moving the contents of another.
 
Writeroperator= (Writer &&rhs) noexcept
 Assigns the writer by moving the contents of another.
 
 ~Writer () noexcept=default
 Destroys the writer.
 
bool await_ready () const &
 
void await_suspend (CoroutineHandle coro) &
 
bool await_resume () &
 

Private Member Functions

 Writer (Channel &channel, T &&value) noexcept
 Creates a new writer for the given channel with the given pv value.
 

Private Attributes

friend LinkedList< Writer >
 
friend Channel
 
Optional< Tvalue = std::nullopt
 The address of value.
 
Optional< CoroutineHandlehandle = nullptr
 The coroutine handle.
 
union { 
 
   Writer *   next = nullptr 
 Next writer in the queue. More...
 
   Channel *   channel 
 The channel to push this reader. More...
 
};  
 

Detailed Description

template<typename T, typename Lockable = NullLockable>
class CeresEngine::Channel< T, Lockable >::Writer

Awaitable writer for channel

Constructor & Destructor Documentation

◆ Writer() [1/3]

template<typename T , typename Lockable = NullLockable>
CeresEngine::Channel< T, Lockable >::Writer::Writer ( Channel channel,
T &&  value 
)
inlineexplicitprivatenoexcept

Creates a new writer for the given channel with the given pv value.

Parameters
channelThe channel to create a writer for
pvThe value pointer

◆ Writer() [2/3]

template<typename T , typename Lockable = NullLockable>
CeresEngine::Channel< T, Lockable >::Writer::Writer ( const Writer )
delete

Deleted copy constructor.

◆ Writer() [3/3]

template<typename T , typename Lockable = NullLockable>
CeresEngine::Channel< T, Lockable >::Writer::Writer ( Writer &&  rhs)
inlinenoexcept

Creates a new writer by moving the contents of another.

Parameters
rhsThe instance to move from

◆ ~Writer()

template<typename T , typename Lockable = NullLockable>
CeresEngine::Channel< T, Lockable >::Writer::~Writer ( )
defaultnoexcept

Destroys the writer.

Member Function Documentation

◆ await_ready()

template<typename T , typename Lockable >
bool CeresEngine::Channel< T, Lockable >::Writer::await_ready ( ) const &

◆ await_resume()

template<typename T , typename Lockable >
bool CeresEngine::Channel< T, Lockable >::Writer::await_resume ( ) &

◆ await_suspend()

template<typename T , typename Lockable >
void CeresEngine::Channel< T, Lockable >::Writer::await_suspend ( CoroutineHandle  coro) &

◆ operator=() [1/2]

template<typename T , typename Lockable = NullLockable>
Writer & CeresEngine::Channel< T, Lockable >::Writer::operator= ( const Writer )
delete

Deleted copy assignment operator.

◆ operator=() [2/2]

template<typename T , typename Lockable = NullLockable>
Writer & CeresEngine::Channel< T, Lockable >::Writer::operator= ( Writer &&  rhs)
inlinenoexcept

Assigns the writer by moving the contents of another.

Parameters
rhsThe instance to move from
Returns
*this

Member Data Documentation

◆ [union]

◆ Channel

template<typename T , typename Lockable = NullLockable>
friend CeresEngine::Channel< T, Lockable >::Writer::Channel
private

◆ channel

template<typename T , typename Lockable = NullLockable>
Channel* CeresEngine::Channel< T, Lockable >::Writer::channel

The channel to push this reader.

◆ handle

template<typename T , typename Lockable = NullLockable>
Optional<CoroutineHandle> CeresEngine::Channel< T, Lockable >::Writer::handle = nullptr
mutableprivate

The coroutine handle.

◆ LinkedList< Writer >

template<typename T , typename Lockable = NullLockable>
friend CeresEngine::Channel< T, Lockable >::Writer::LinkedList< Writer >
private

◆ next

template<typename T , typename Lockable = NullLockable>
Writer* CeresEngine::Channel< T, Lockable >::Writer::next = nullptr

Next writer in the queue.

◆ value

template<typename T , typename Lockable = NullLockable>
Optional<T> CeresEngine::Channel< T, Lockable >::Writer::value = std::nullopt
mutableprivate

The address of value.


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