5#ifndef YAMICORE_AGENT_H_INCLUDED
6#define YAMICORE_AGENT_H_INCLUDED
9#include "channel_descriptor.h"
78 incoming_message_dispatch_function dispatch_callback,
80 closed_connection_function disconnection_hook = NULL,
81 void * disconnection_hook_hint = NULL,
92 incoming_message_dispatch_function dispatch_callback,
94 closed_connection_function disconnection_hook = NULL,
95 void * disconnection_hook_hint = NULL,
107 event_notification_function event_notification_callback,
108 void * event_notification_hint);
125 frame_acceptor_function frame_acceptor,
126 void * frame_acceptor_hint);
137 io_error_function io_error_callback,
138 void * io_error_callback_hint);
204 bool & created_new_channel);
213 bool & created_new_channel,
const parameters * overriding_options);
316 std::size_t priority = 0,
317 message_progress_function progress_callback = NULL,
318 void * progress_hint = NULL);
330 std::size_t priority = 0,
331 message_progress_function progress_callback = NULL,
332 void * progress_hint = NULL);
370 new_incoming_connection_function connection_hook = NULL,
371 void * connection_hook_hint = NULL,
372 const char * * resolved_target = NULL);
416 bool allow_outgoing_traffic =
true,
417 bool allow_incoming_traffic =
true);
428 result get_pending_outgoing_bytes(
429 const char * target, std::size_t & bytes);
434 void operator=(
const agent &);
437 core::incoming_message_dispatch_function dispatch_callback,
438 void * dispatch_hint,
439 core::closed_connection_function disconnection_hook,
440 void * disconnection_hook_hint,
448 details::channel_group * ch_group_;
450 std::size_t max_channels_allowed_;
451 std::size_t channels_used_;
Message broker.
Definition: agent.h:40
result open(const char *target, channel_descriptor &cd, bool &created_new_channel, const parameters *overriding_options)
Create new channel for the given target with a set of overriding options.
result post(const char *target, const serializable &message_header, const serializable &message_body, std::size_t priority=0, message_progress_function progress_callback=NULL, void *progress_hint=NULL)
Posts new message for sending.
result open(const char *target, channel_descriptor &cd, bool &created_new_channel)
Create new channel for the given target.
result add_listener(const char *target, new_incoming_connection_function connection_hook=NULL, void *connection_hook_hint=NULL, const char **resolved_target=NULL)
Adds new listener.
result interrupt_work_waiter()
Artificially interrupts the wait state of do_some_work.
result close(const char *target, std::size_t priority=0)
Closes the given channel.
result post(channel_descriptor cd, const serializable &message_header, const serializable &message_body, std::size_t priority=0, message_progress_function progress_callback=NULL, void *progress_hint=NULL)
Posts new message for sending.
result hard_close(const char *target)
Immediately closes the given channel.
void install_io_error_logger(io_error_function io_error_callback, void *io_error_callback_hint)
Installation of I/O error logging callback.
void get_channel_usage(std::size_t &max_allowed, std::size_t &used)
Returns the selector's channel usage counters.
void install_frame_acceptor(frame_acceptor_function frame_acceptor, void *frame_acceptor_hint)
Installation of frame acceptor callback.
result get_pending_outgoing_bytes(channel_descriptor cd, std::size_t &bytes)
Returns the size of outgoing queue for the given channel.
result remove_listener(const char *target)
Removes existing listener.
result hard_close(channel_descriptor cd)
Immediately closes the given channel.
result is_open(const char *target, channel_descriptor &existing_channel) const
Checks if the given channel is already open.
result open(const char *target)
Creates new channel for the given target.
result init(incoming_message_dispatch_function dispatch_callback, void *dispatch_hint, closed_connection_function disconnection_hook=NULL, void *disconnection_hook_hint=NULL, allocator *alloc=NULL)
Initialization.
result close(channel_descriptor cd, std::size_t priority=0)
Closes the given channel.
void install_event_notifications(event_notification_function event_notification_callback, void *event_notification_hint)
Installation of logging notifications callback.
result do_some_work(std::size_t timeout, bool allow_outgoing_traffic=true, bool allow_incoming_traffic=true)
Performs a portion of I/O or internal management work.
result init(const parameters &configuration_options, incoming_message_dispatch_function dispatch_callback, void *dispatch_hint, closed_connection_function disconnection_hook=NULL, void *disconnection_hook_hint=NULL, allocator *alloc=NULL)
Initialization.
Common interface for the custom memory allocator.
Definition: allocator.h:20
Descriptor handle for the physical channel.
Definition: channel_descriptor.h:27
Collection of message parameters.
Definition: parameters.h:83
Common interface for serializable data source.
Definition: serializable.h:24
Standard (malloc/free), default allocator.
Definition: allocator.h:29
result
General type for reporting success and error states.
Definition: core.h:21
Namespace devoted for everything related to YAMI4.
Definition: agent.h:14