Loading...
Searching...
No Matches
container.hpp
Go to the documentation of this file.
#ifndef PROTON_CONTAINER_HPP
#define PROTON_CONTAINER_HPP
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
#include "./fwd.hpp"
#include "./returned.hpp"
#include "./types_fwd.hpp"
#include "./internal/export.hpp"
#include <memory>
#include <string>
namespace proton {
class PN_CPP_CLASS_EXTERN container {
public:
PN_CPP_EXTERN container(messaging_handler& handler, const std::string& id);
PN_CPP_EXTERN container(messaging_handler& handler);
PN_CPP_EXTERN container(const std::string& id);
PN_CPP_EXTERN container();
PN_CPP_EXTERN ~container();
PN_CPP_EXTERN returned<connection> connect(const std::string& conn_url,
const connection_options& conn_opts);
PN_CPP_EXTERN returned<connection> connect(const std::string& conn_url);
PN_CPP_EXTERN returned<connection> connect();
PN_CPP_EXTERN listener listen(const std::string& listen_url,
listen_handler& handler);
PN_CPP_EXTERN listener listen(const std::string& listen_url,
const connection_options& conn_opts);
PN_CPP_EXTERN listener listen(const std::string& listen_url);
PN_CPP_EXTERN void run();
PN_CPP_EXTERN void run(int count);
PN_CPP_EXTERN void auto_stop(bool enabled);
PN_CPP_EXTERN void stop(const error_condition& err);
PN_CPP_EXTERN void stop();
PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url);
PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
const proton::sender_options& snd_opts);
PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
const connection_options& conn_opts);
PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
const proton::sender_options& snd_opts,
const connection_options& conn_opts);
PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url);
PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
const proton::receiver_options& rcv_opts);
PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
const connection_options& conn_opts);
PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
const proton::receiver_options& rcv_opts,
const connection_options& conn_opts);
PN_CPP_EXTERN std::string id() const;
PN_CPP_EXTERN void client_connection_options(const connection_options& conn_opts);
PN_CPP_EXTERN connection_options client_connection_options() const;
PN_CPP_EXTERN void server_connection_options(const connection_options& conn_opts);
PN_CPP_EXTERN connection_options server_connection_options() const;
PN_CPP_EXTERN void sender_options(const class sender_options& snd_opts);
PN_CPP_EXTERN class sender_options sender_options() const;
PN_CPP_EXTERN void receiver_options(const class receiver_options& rcv_opts);
PN_CPP_EXTERN class receiver_options receiver_options() const;
PN_CPP_EXTERN void schedule(duration dur, work fn);
PN_CPP_EXTERN PN_CPP_DEPRECATED("Use 'container::schedule(duration, work)'") void schedule(duration dur, void_function0& fn);
private:
PN_CPP_EXTERN void schedule(duration dur, internal::v03::work fn);
class impl;
std::unique_ptr<impl> impl_;
friend class connection_options;
friend class session_options;
friend class receiver_options;
friend class sender_options;
friend class work_queue;
};
} // proton
#endif // PROTON_CONTAINER_HPP
proton::connection_options
Options for creating a connection.
Definition connection_options.hpp:67
proton::container
A top-level container of connections, sessions, and links.
Definition container.hpp:49
proton::container::server_connection_options
connection_options server_connection_options() const
Connection options applied to incoming connections.
proton::container::run
void run()
Run the container in the current thread.
proton::container::auto_stop
void auto_stop(bool enabled)
Enable or disable automatic container stop.
proton::container::open_receiver
returned< receiver > open_receiver(const std::string &addr_url, const connection_options &conn_opts)
Open a connection and receiver for addr_url.
proton::container::open_sender
returned< sender > open_sender(const std::string &addr_url, const connection_options &conn_opts)
Open a connection and sender for addr_url.
proton::container::receiver_options
void receiver_options(const class receiver_options &rcv_opts)
Receiver options applied to receivers created by this container.
proton::container::container
container(messaging_handler &handler)
Create a container with a global handler for messaging events.
proton::container::id
std::string id() const
A unique identifier for the container.
proton::container::sender_options
void sender_options(const class sender_options &snd_opts)
Sender options applied to senders created by this container.
proton::container::connect
returned< connection > connect()
Connect using the default Connection Configuration file.
proton::container::~container
~container()
Destroy a container.
proton::container::server_connection_options
void server_connection_options(const connection_options &conn_opts)
Connection options applied to incoming connections.
proton::container::open_sender
returned< sender > open_sender(const std::string &addr_url)
Open a connection and sender for addr_url.
proton::container::container
container(const std::string &id)
Create a container.
proton::container::stop
void stop()
Stop the container with an empty error condition.
proton::container::client_connection_options
connection_options client_connection_options() const
Connection options applied to outgoing connections.
proton::container::open_sender
returned< sender > open_sender(const std::string &addr_url, const proton::sender_options &snd_opts, const connection_options &conn_opts)
Open a connection and sender for addr_url.
proton::container::client_connection_options
void client_connection_options(const connection_options &conn_opts)
Connection options applied to outgoing connections.
proton::container::container
container(messaging_handler &handler, const std::string &id)
Create a container with a global handler for messaging events.
proton::container::listen
listener listen(const std::string &listen_url, listen_handler &handler)
Listen for new connections on listen_url.
proton::container::schedule
void schedule(duration dur, work fn)
Schedule fn for execution after a duration.
proton::container::open_receiver
returned< receiver > open_receiver(const std::string &addr_url, const proton::receiver_options &rcv_opts)
Open a connection and receiver for addr_url.
proton::container::run
void run(int count)
Run the container with a pool of count threads, including the current thread.
proton::container::listen
listener listen(const std::string &listen_url)
Listen for new connections on listen_url.
proton::container::connect
returned< connection > connect(const std::string &conn_url)
Connect using the default Connection Configuration file.
proton::container::open_receiver
returned< receiver > open_receiver(const std::string &addr_url)
Open a connection and receiver for addr_url.
proton::container::stop
void stop(const error_condition &err)
Stop the container with error condition err.
proton::container::listen
listener listen(const std::string &listen_url, const connection_options &conn_opts)
Listen for new connections on listen_url.
proton::container::open_receiver
returned< receiver > open_receiver(const std::string &addr_url, const proton::receiver_options &rcv_opts, const connection_options &conn_opts)
Open a connection and receiver for addr_url.
proton::container::container
container()
Create a container.
proton::container::connect
returned< connection > connect(const std::string &conn_url, const connection_options &conn_opts)
Connect to conn_url and send an open request to the remote peer.
proton::container::open_sender
returned< sender > open_sender(const std::string &addr_url, const proton::sender_options &snd_opts)
Open a connection and sender for addr_url.
proton::duration
A span of time in milliseconds.
Definition duration.hpp:39
proton::error_condition
Describes an endpoint error state.
Definition error_condition.hpp:39
proton::listen_handler
Unsettled API - A handler for incoming connections.
Definition listen_handler.hpp:39
proton::listener
A listener for incoming connections.
Definition listener.hpp:33
proton::map
A collection of key-value pairs.
Definition map.hpp:69
proton::map::map
map()
Construct an empty map.
proton::messaging_handler
Handler for Proton messaging events.
Definition messaging_handler.hpp:69
proton::receiver_options
Options for creating a receiver.
Definition receiver_options.hpp:59
proton::sender_options
Options for creating a sender.
Definition sender_options.hpp:60
proton::session_options
Options for creating a session.
Definition session_options.hpp:41
proton::work_queue
Unsettled API - A context for thread-safe execution of work.
Definition work_queue.hpp:327
fwd.hpp
Forward declarations.
proton
The main Proton namespace.
Definition annotation_key.hpp:33
returned.hpp
A return type for container methods.
types_fwd.hpp
Forward declarations for Proton types used to represent AMQP types.