1 #ifndef CONNECTION_ENGINE_HPP
2 #define CONNECTION_ENGINE_HPP
23 #include "proton/connection.hpp"
24 #include "proton/connection_options.hpp"
25 #include "proton/export.hpp"
26 #include "proton/id_generator.hpp"
27 #include "proton/pn_unique_ptr.hpp"
36 class connection_engine_context;
71 PN_CPP_EXTERN container(
const std::string &
id =
"");
74 PN_CPP_EXTERN std::string id()
const;
88 const std::string id_;
96 PN_CPP_EXTERN
virtual ~connection_engine();
99 PN_CPP_EXTERN
size_t can_read()
const;
118 PN_CPP_EXTERN
bool process(
int io_flags=READ|WRITE);
127 PN_CPP_EXTERN
bool closed()
const;
130 PN_CPP_EXTERN std::string
error_str()
const;
156 virtual size_t io_read(
char* buf,
size_t max) = 0;
163 virtual size_t io_write(
const char*,
size_t) = 0;
168 virtual void io_close() = 0;
174 connection_engine& operator=(
const connection_engine&);
181 connection_engine_context* ctx_;
186 #endif // CONNECTION_ENGINE_HPP
io_flag
Combine these flags with | to indicate read, write, both or neither.
Definition: connection_engine.hpp:105
An interface for connection-oriented IO integration.
Definition: connection_engine.hpp:64
bool process(int io_flags=READ|WRITE)
Read, write and dispatch events.
void disconnect()
Disconnect the engine.
Defines C++ types representing AMQP types.
A connection to a remote AMQP peer.
Definition: connection.hpp:42
Options for creating a connection.
Definition: connection_options.hpp:60
std::string error_str() const
If the engine was closed by an error, return a pointer.
bool closed() const
True if the engine is closed, meaning there are no further events to process and close_io has been ca...
connection_engine(handler &, const connection_options &=no_opts)
Create a connection engine that dispatches to handler.
size_t can_read() const
Return the number of bytes that the engine is currently ready to read.
Callback functions for handling proton events.
Definition: handler.hpp:40
bool process_nothrow(int io_flags=READ|WRITE)
Non-throwing version of process.
size_t can_write() const
Return the number of bytes that the engine is currently ready to write.
A network layer supporting an AMQP connection.
Definition: transport.hpp:38