|
- #pragma once
-
- #include <memory>
- #include <cppamqp/enums.h>
- #include <cppamqp/types.h>
- #include <cppamqp/config.h>
- #include <cppamqp/channel.h>
- #include <cppamqp/exception.inl>
- #include <cppamqp/connection.fwd.h>
-
- namespace cppamqp
- {
-
- channel::channel(const cppamqp::connection& p_connection, channel_number p_handle)
- : _internal(new internal(p_connection, p_handle))
- { }
-
- channel::channel()
- { }
-
- channel::channel(channel&& other)
- : _internal(std::move(other._internal))
- { }
-
- channel::~channel()
- { }
-
- channel::operator bool() const
- { return static_cast<bool>(_internal); }
-
- void channel::operator =(channel&& other)
- { _internal = std::move(other._internal); }
-
- channel_number channel::handle() const
- {
- if (!_internal)
- throw exception("channel is closed!");
- return _internal->handle;
- }
-
- const connection& channel::connection() const
- {
- if (!_internal)
- throw exception("channel is closed!");
- return _internal->connection;
- }
-
- }
|