YAMI4 Core Library 2.0.0
Messaging Solution for Distributed Systems
Loading...
Searching...
No Matches
core.h
1// Copyright Maciej Sobczak 2008-2022.
2// This file is part of YAMI4.
3// See the package-level LICENSE.txt file.
4
5#ifndef YAMICORE_CORE_H_INCLUDED
6#define YAMICORE_CORE_H_INCLUDED
7
8#include "channel_descriptor.h"
9#include <cstddef>
10
12namespace yami
13{
14
16namespace core
17{
18
21{
36};
37
60extern "C" typedef void (*incoming_message_dispatch_function)(
61 void * hint,
62 const char * source,
63 const char * header_buffers[],
64 std::size_t header_buffer_sizes[],
65 std::size_t num_of_header_buffers,
66 const char * body_buffers[],
67 std::size_t body_buffer_sizes[],
68 std::size_t num_of_body_buffers);
69
80extern "C" typedef void (*new_incoming_connection_function)(
81 void * hint,
82 const char * source,
83 std::size_t index, std::size_t sequence_number);
84
93extern "C" typedef void (*closed_connection_function)(
94 void * hint,
95 const char * name, result reason);
96
111extern "C" typedef void (*message_progress_function)(
112 void * hint,
113 std::size_t sent_bytes,
114 std::size_t total_byte_count);
115
118{
119 agent_closed, // (NULL, 0)
120 listener_added, // (target, 0)
121 listener_removed, // (target, 0)
122 incoming_connection_open, // (target, 0)
123 outgoing_connection_open, // (target, 0)
124 connection_closed, // (target, 0)
125 connection_error, // (target, 0)
126 message_sent, // (target, bytes)
127 message_received // (target, bytes)
128};
129
132extern "C" typedef void (*event_notification_function)(
133 void * hint,
135 const char * str,
136 std::size_t size);
137
140{
141 accept_this_frame,
142 drop_collected_message_frames
143};
144
147 void * hint,
148 const char * channel_name,
149 int message_id,
150 std::size_t frame_size);
151
153extern "C" typedef void (*io_error_function)(
154 void * hint,
155 int error_code,
156 const char * description);
157
158} // namespace core
159
160} // namespace yami
161
162#endif // YAMICORE_CORE_H_INCLUDED
void(* closed_connection_function)(void *hint, const char *name, result reason)
Definition: core.h:93
result
General type for reporting success and error states.
Definition: core.h:21
@ no_such_name
The given name was not found.
Definition: core.h:23
@ nesting_too_deep
The nesting of parameters is too deep.
Definition: core.h:27
@ timed_out
The requested operation timed out.
Definition: core.h:33
@ io_error
Unable to perform the I/O operation.
Definition: core.h:32
@ no_such_index
Index out of range.
Definition: core.h:25
@ bad_protocol
The connection protocol is incorrect.
Definition: core.h:31
@ unexpected_value
The given value was not recognized.
Definition: core.h:30
@ not_enough_space
There is not enough space in the buffer.
Definition: core.h:28
@ bad_state
The given object is in the wrong state.
Definition: core.h:35
@ channel_closed
The operation was not possible due to EOF.
Definition: core.h:34
@ ok
Operation completed successfully.
Definition: core.h:22
@ no_memory
Not enough memory.
Definition: core.h:26
@ bad_type
The expected type is different than the actual.
Definition: core.h:24
@ no_entries
There are no entries.
Definition: core.h:29
frame_decision
Type of frame acceptor decisions.
Definition: core.h:140
void(* message_progress_function)(void *hint, std::size_t sent_bytes, std::size_t total_byte_count)
Definition: core.h:111
void(* incoming_message_dispatch_function)(void *hint, const char *source, const char *header_buffers[], std::size_t header_buffer_sizes[], std::size_t num_of_header_buffers, const char *body_buffers[], std::size_t body_buffer_sizes[], std::size_t num_of_body_buffers)
Definition: core.h:60
void(* io_error_function)(void *hint, int error_code, const char *description)
Type of function callback for internal I/O error logging.
Definition: core.h:153
void(* event_notification_function)(void *hint, event_notification e, const char *str, std::size_t size)
Definition: core.h:132
frame_decision(* frame_acceptor_function)(void *hint, const char *channel_name, int message_id, std::size_t frame_size)
Type of function callback for frame acceptor facility.
Definition: core.h:146
void(* new_incoming_connection_function)(void *hint, const char *source, std::size_t index, std::size_t sequence_number)
Definition: core.h:80
event_notification
Type of internal event notification.
Definition: core.h:118
Namespace devoted for everything related to YAMI4.
Definition: agent.h:14