-
Notifications
You must be signed in to change notification settings - Fork 1
/
channel.h
52 lines (41 loc) · 838 Bytes
/
channel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// -*- mode:c++ -*-
#ifndef ICI_CHANNEL_H
#define ICI_CHANNEL_H
#include "object.h"
namespace ici
{
/*
* This --struct-- forms part of the --ici-api--.
*/
struct channel : object
{
array *c_q;
size_t c_capacity;
object *c_altobj;
};
inline channel *channelof(object *o)
{
return o->as<channel>();
}
inline bool ischannel(object *o)
{
return o->hastype(TC_CHANNEL);
}
constexpr int ICI_CHANNEL_CLOSED = 0x20;
class channel_type : public type
{
public:
channel_type() : type("channel", sizeof(struct channel))
{
}
size_t mark(object *o) override;
int forall(object *o) override;
int save(archiver *, object *) override;
object *restore(archiver *) override;
int64_t len(object *) override;
};
/*
* End of ici.h export. --ici.h-end--
*/
} // namespace ici
#endif