StormByte C++ Library: Network module 0.0.9999
StormByte-Network is a StormByte library module for handling and create network connections
All Classes Namespaces Functions Variables Typedefs Pages
typedefs.hxx
1#pragma once
2
3#include <StormByte/buffer/consumer.hxx>
4#include <StormByte/buffer/producer.hxx>
5#include <StormByte/buffer/simple.hxx>
6#include <StormByte/expected.hxx>
7#include <StormByte/network/connection/protocol.hxx>
8#include <StormByte/network/connection/rw.hxx>
9#include <StormByte/network/connection/status.hxx>
10#include <StormByte/network/exception.hxx>
11
12#include <functional>
13#include <future>
14
19namespace StormByte::Network {
20 namespace Connection {
21 class Handler;
22 }
23 class Packet;
24 namespace Socket {
25 class Socket;
26 class Client;
27 }
28 using FutureBuffer = std::future<Buffer::Simple>;
29 using PromisedBuffer = std::promise<Buffer::Simple>;
30 using ExpectedBuffer = StormByte::Expected<Buffer::Simple, ConnectionError>;
31 using ExpectedFutureBuffer = StormByte::Expected<FutureBuffer, ConnectionError>;
32 using ExpectedVoid = StormByte::Expected<void, ConnectionError>;
33 using ExpectedClient = StormByte::Expected<Socket::Client, ConnectionError>;
34 using ExpectedReadResult = StormByte::Expected<Connection::Read::Result, ConnectionClosed>;
35 using FutureBufferProcessor = std::function<StormByte::Expected<FutureBuffer, ConnectionError>(Socket::Client&, FutureBuffer&)>;
36 using SharedConsumerBuffer = std::shared_ptr<Buffer::Consumer>;
37 using SharedProducerBuffer = std::shared_ptr<Buffer::Producer>;
38 using ExpectedPacket = StormByte::Expected<std::shared_ptr<Packet>, PacketError>;
39 using PacketInstanceFunction = std::function<std::shared_ptr<Packet>(const unsigned short&)>;
40 using PacketReaderFunction = std::function<ExpectedBuffer(const size_t&)>;
41}
The class representing a client.
Definition client.hxx:15
The class representing an error in the packet.
Definition exception.hxx:51
The namespace containing connection items.
Contains all the network-related classes and utilities.
Definition client.hxx:10
StormByte::Expected< std::shared_ptr< Packet >, PacketError > ExpectedPacket
The expected packet type.
Definition typedefs.hxx:38
std::function< ExpectedBuffer(const size_t &)> PacketReaderFunction
The packet reader function type.
Definition typedefs.hxx:40
StormByte::Expected< Buffer::Simple, ConnectionError > ExpectedBuffer
The expected buffer type.
Definition typedefs.hxx:30
StormByte::Expected< Socket::Client, ConnectionError > ExpectedClient
The expected client type.
Definition typedefs.hxx:33
std::future< Buffer::Simple > FutureBuffer
The future data type.
Definition typedefs.hxx:28
std::function< StormByte::Expected< FutureBuffer, ConnectionError >(Socket::Client &, FutureBuffer &)> FutureBufferProcessor
The future data function type.
Definition typedefs.hxx:35
std::shared_ptr< Buffer::Producer > SharedProducerBuffer
The shared producer buffer type.
Definition typedefs.hxx:37
std::promise< Buffer::Simple > PromisedBuffer
The promised data type.
Definition typedefs.hxx:29
StormByte::Expected< Connection::Read::Result, ConnectionClosed > ExpectedReadResult
The expected read result type. ///< The expected handler type.
Definition typedefs.hxx:34
StormByte::Expected< FutureBuffer, ConnectionError > ExpectedFutureBuffer
The expected future type.
Definition typedefs.hxx:31
std::shared_ptr< Buffer::Consumer > SharedConsumerBuffer
The shared consumer buffer type.
Definition typedefs.hxx:36
std::function< std::shared_ptr< Packet >(const unsigned short &)> PacketInstanceFunction
The packet instance function type.
Definition typedefs.hxx:39
StormByte::Expected< void, ConnectionError > ExpectedVoid
The expected void type.
Definition typedefs.hxx:32