1 // Copyright Maciej Sobczak 2008-2019.
2 // This file is part of YAMI4.
3 //
4 // YAMI4 is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // YAMI4 is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with YAMI4.  If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef YAMICORE_OUTGOING_FRAME_H_INCLUDED
18 #define YAMICORE_OUTGOING_FRAME_H_INCLUDED
19 
20 #include "core.h"
21 #include <cstddef>
22 
23 namespace yami
24 {
25 
26 namespace details
27 {
28 
29 struct outgoing_frame
30 {
31     // primary information
32 
33     const char * data;
34     std::size_t size;
35 
36     // all following fields are internally managed by channel
37 
38     core::message_progress_function progress_callback;
39     void * progress_hint;
40 
41     std::size_t byte_count; // number of bytes from the beginning of message
42     std::size_t total_byte_count; // size of the whole message
43 
44     // used for proper queue management
45     std::size_t priority;
46     bool close_flag;
47     outgoing_frame * next;
48 };
49 
50 } // namespace details
51 
52 } // namespace yami
53 
54 #endif // YAMICORE_OUTGOING_FRAME_H_INCLUDED
55