MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
channels.hpp File Reference
#include "mtcore/colls/queue.hpp"
#include "mtcore_thread/core.hpp"
#include "mtcore_thread/traits.hpp"
#include <array>
#include <condition_variable>
#include <mutex>
#include <thread>
Include dependency graph for channels.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mtcore::thread::Channel< T, Size >
 Channel is a message-passing primitive between two threads A channel has blocking and non-blocking (or auto timed out for a size of 0) methods Timeout methods are also present A channel will have a buffer size for how many messages can be queued up If there is a buffer size of 0, then a reader and writer must both be accessing the channel simultaneously for messages to be transmitted. More...
 

Namespaces

namespace  mtcore
 Core library for C++ with Zig-related functionality.
 
namespace  mtcore::thread
 Thread-related namespace The methods and classes provided by this class are thread-safe Classes and methods provided outside of this class are not thread-safe (with the exception of malloc_alloc) This requires linking mtcore_thread to your application.
 

Macros

#define MTCORE_THREAD_CHANNELS_HPP
 

Enumerations

enum class  mtcore::thread::ChannelSendBlockErrors { mtcore::thread::ChannelSendBlockErrors::CHANNEL_CLOSED }
 Errors for when blocking sends fail. More...
 
enum class  mtcore::thread::ChannelTrySendErrors { mtcore::thread::ChannelTrySendErrors::CHANNEL_CLOSED , mtcore::thread::ChannelTrySendErrors::COULD_NOT_LOCK , mtcore::thread::ChannelTrySendErrors::NO_ROOM }
 Errors for when non-blocking sends fail. More...
 
enum class  mtcore::thread::ChannelSendBeforeErrors { mtcore::thread::ChannelSendBeforeErrors::CHANNEL_CLOSED , mtcore::thread::ChannelSendBeforeErrors::TIMEOUT }
 Errors for when timed blocking sends fail. More...
 
enum class  mtcore::thread::ChannelTryReceiveErrors { mtcore::thread::ChannelTryReceiveErrors::COULD_NOT_LOCK , mtcore::thread::ChannelTryReceiveErrors::MESSAGE_NOT_READY }
 Errors for when non-blocking receives fail Note: If the channel is closed, a nullopt will be returned instead of an error. More...
 
enum class  mtcore::thread::ChannelReceiveBeforeErrors { mtcore::thread::ChannelReceiveBeforeErrors::TIMEOUT }
 Errors for when timed receives fail Note: If the channel is closed, a nullopt will be returned instead of an error. More...
 

Macro Definition Documentation

◆ MTCORE_THREAD_CHANNELS_HPP

#define MTCORE_THREAD_CHANNELS_HPP

Definition at line 22 of file channels.hpp.