CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
objstdif.cxh
1// Standard interfaces that have special meaning within the framework
2
3interface Sortable {
4 intptr cmp(object other, uint32 flags);
5}
6
7interface Hashable {
8 uint32 hash(uint32 flags);
9}
10
11interface Convertible {
12 // NOTE: While this is used by stConvert, the object interface is a higher level interface.
13 // The normal convention of blindly overwriting the destination does not apply here. For
14 // example, when called to convert to a string, the destination should be properly reused
15 // or destroyed first.
16 // The layer between stConvert and Convertible takes care of making sure the destination is
17 // always initialized.
18 bool convert(stype st, stgeneric *dest, uint32 flags);
19}
20
21interface Serializable {
22 bool serialize(SerWriter *w);
23 bool deserialize(SerReader *r);
24}
25
26interface IteratorIf {
27 bool valid();
28 bool next();
29 bool get(stvar *out);
30}
31
32abstract class Iterator implements IteratorIf {
33}
34
35interface Iterable {
36 Iterator *iter(); // Caller owns the iterator and must release it with objRelease
37}