O2
2.0
A communication protocol for interactive music and media applications.
src
msgsend.h
1
//
2
// msgsend.h - send messages
3
//
4
// Roger B. Dannenberg
5
// April 2020
6
7
#ifndef MSGSEND_H
8
#define MSGSEND_H
9
10
// if MSG_NOSIGNAL is an option for send(), then use it;
11
// otherwise, give it a legal innocuous value as a flag:
12
#ifndef MSG_NOSIGNAL
13
#define MSG_NOSIGNAL 0
14
#endif
15
16
class
Pending_msgs_queue
{
17
O2message_ptr
head;
18
O2message_ptr
tail;
19
public
:
20
Pending_msgs_queue
();
21
void
enqueue(
O2message_ptr
msg);
22
O2message_ptr
dequeue();
23
bool
empty();
24
};
25
26
extern
Pending_msgs_queue
o2_pending_local;
27
extern
Pending_msgs_queue
o2_pending_anywhere;
28
29
30
void
o2_drop_msg_data(
const
char
*warn,
o2_msg_data_ptr
data);
31
32
void
o2_prepare_to_deliver(
O2message_ptr
msg);
33
34
extern
int
o2_do_not_reenter;
// counter to allow nesting
35
36
void
o2_deliver_pending(
void
);
37
38
// free any remaining messages after O2 has been shut down
39
void
o2_free_pending_msgs(
void
);
40
51
void
o2_msg_deliver(
O2node
*service,
Services_entry
*services);
52
53
60
void
o2_send_to_taps(
O2message_ptr
msg,
Services_entry
*ss);
61
62
63
O2err
o2_msg_send_now();
64
65
void
o2_call_handler(
Handler_entry
*handler,
o2_msg_data_ptr
msg,
66
const
char
*types);
67
68
O2node
*o2_msg_service(
o2_msg_data_ptr
msg,
Services_entry
**services);
69
70
// int o2_send_message(Fds_info *proc, int blocking);
71
72
void
o2_send_local(
O2node
*service,
Services_entry
*ss);
73
74
// void o2_queue_message(O2message_ptr msg, Fds_info *proc);
75
76
#endif
/* o2_send_h */
Handler_entry
Definition:
o2node.h:246
O2node
Definition:
o2node.h:132
Pending_msgs_queue
Definition:
msgsend.h:16
Services_entry
Definition:
services.h:24
O2err
O2err
return values used generally by O2 functions
Definition:
o2.h:329
O2message
an O2 message container
Definition:
o2.h:690
O2msg_data
data part of an O2 message
Definition:
o2.h:638
Generated by
1.9.2