YAMI4 C++ Library 2.0.0
Messaging Solution for Distributed Systems
Loading...
Searching...
No Matches
outgoing_message.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 YAMICPP_OUTGOING_MESSAGE_H_INCLUDED
6#define YAMICPP_OUTGOING_MESSAGE_H_INCLUDED
7
8#include "message_state.h"
9#include <yami4-core/dll.h>
10#include <cstddef>
11#include <string>
12#include <vector>
13
14namespace yami
15{
16
17namespace details
18{
19struct outgoing_message_info;
20class outgoing_message_manager;
21} // namespace details
22
23class parameters;
24
33{
34public:
35
37 typedef long long outgoing_message_id;
38
43
45
46 void reset(details::outgoing_message_manager & manager,
47 details::outgoing_message_info & info);
48
49 void disown_info_object();
50
53
66 message_state get_state(std::size_t & sent_bytes,
67 std::size_t & total_byte_count) const;
68
77
88 bool wait_for_transmission(std::size_t relative_timeout) const;
89
103
114 bool wait_for_completion(std::size_t relative_timeout) const;
115
117 const parameters & get_header() const;
118
120 const parameters & get_reply() const;
121
126 const std::vector<char> & get_raw_reply() const;
127
136
140 const std::string & get_exception_msg() const;
141
147
148private:
150 void operator=(const outgoing_message &);
151
152 void clean();
153
154 details::outgoing_message_manager * manager_;
155 details::outgoing_message_info * info_;
156 bool owner_of_info_;
157};
158
159} // namespace yami
160
161#endif // YAMICPP_OUTGOING_MESSAGE_H_INCLUDED
Outgoing message.
Definition: outgoing_message.h:33
bool wait_for_completion(std::size_t relative_timeout) const
Waits for the message roundtrip or until timeout expires.
outgoing_message_id get_message_id() const
Returns the internal message id.
long long outgoing_message_id
Outgoing message identifier type.
Definition: outgoing_message.h:37
const std::vector< char > & get_raw_reply() const
Provides access to the reply content.
void wait_for_completion() const
Waits for the full message roundtrip.
void wait_for_transmission() const
Waits for the transmission to finish.
bool wait_for_transmission(std::size_t relative_timeout) const
Waits for the transmission to finish or until timeout expires.
outgoing_message()
Constructor.
const parameters & get_reply() const
Provides access to the reply content.
parameters * extract_reply()
Extracts the reply content.
const parameters & get_header() const
Provides access to the reply header.
message_state get_state() const
Returns the state of this message.
message_state get_state(std::size_t &sent_bytes, std::size_t &total_byte_count) const
Returns the state of this message.
const std::string & get_exception_msg() const
Returns the exception message.
Collection of message parameters.
Definition: parameters.h:62
Namespace devoted to everything related to YAMI4.
Definition: agent.h:21
message_state
Outgoing message state.
Definition: message_state.h:13