Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

53 righe
1.8 KiB

  1. #pragma once
  2. #include <memory>
  3. #include <cppamqp/enums.h>
  4. #include <cppamqp/types.h>
  5. #include <cppamqp/config.h>
  6. #include <cppamqp/connection.fwd.h>
  7. #include <cppamqp/publish_options.h>
  8. namespace cppamqp
  9. {
  10. struct channel
  11. {
  12. private:
  13. using connection_t = ::cppamqp::connection;
  14. struct internal
  15. {
  16. const connection_t& connection;
  17. channel_number handle;
  18. internal(const connection_t& p_connection, channel_number p_handle);
  19. ~internal();
  20. };
  21. private:
  22. friend struct connection;
  23. std::shared_ptr<internal> _internal;
  24. inline channel(const connection_t& p_connection, channel_number p_handle);
  25. public:
  26. inline channel();
  27. inline channel(channel&& other);
  28. inline ~channel();
  29. inline operator bool () const;
  30. inline void operator = (channel&& other);
  31. inline channel_number handle () const;
  32. inline const connection_t& connection () const;
  33. queue_declaration declare_queue (const std::string& name, const queue_flags& flags);
  34. void bind_queue (const std::string& queue, const std::string& exchange, const std::string& routing_key);
  35. void publish (const std::string& exchange, const std::string& routing_key, const publish_flags& flags, const std::string& message, const publish_options* options = nullptr);
  36. std::string consume (const std::string& queue, const std::string& consumer_tag, const consume_flags& flags);
  37. void qos (uint32_t prefetch_size, uint16_t prefetch_count, bool global);
  38. void close (int status = AMQP_REPLY_SUCCESS);
  39. };
  40. }