Commit fcccbfc6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 63acc55c
...@@ -58,21 +58,31 @@ static string h(uint64_t v); // v -> 016x hex representation ...@@ -58,21 +58,31 @@ static string h(uint64_t v); // v -> 016x hex representation
#define h_(v) (h(v).c_str()) #define h_(v) (h(v).c_str())
static error mmap_zero_into_ro(void *addr, size_t size); static error mmap_zero_into_ro(void *addr, size_t size);
// XXX ok? // XXX ok?
struct IContext { struct IContext {
virtual chan<structZ> done() = 0; virtual chan<structZ> done() = 0;
virtual error err() = 0; virtual error err() = 0;
}; };
#if 0
interface(Context) {
ifunc(chan<structZ> done());
ifunc(error err());
};
I<io::Reader>(f)
// XXX wrap T* as IContext // XXX wrap T* as IContext
template<typename T> template<typename T>
class Context { class Context : public IContext {
T *obj; T *obj;
public: public:
Context(T *obj) : obj(obj) {}
chan<structZ> done() { return obj->done(); } chan<structZ> done() { return obj->done(); }
error err() { return obj->err(); } error err() { return obj->err(); }
}; };
#endif
struct Conn; struct Conn;
struct _File; struct _File;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment