ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/cfperl.h
(Generate patch)

Comparing deliantra/server/include/cfperl.h (file contents):
Revision 1.36 by root, Thu Dec 14 20:39:54 2006 UTC vs.
Revision 1.38 by root, Sat Dec 16 03:08:26 2006 UTC

64#define ARG_MAP(o) DT_MAP , (void *)static_cast<maptile *> (o) 64#define ARG_MAP(o) DT_MAP , (void *)static_cast<maptile *> (o)
65#define ARG_PLAYER(o) DT_PLAYER, (void *)static_cast<player *> (o) 65#define ARG_PLAYER(o) DT_PLAYER, (void *)static_cast<player *> (o)
66#define ARG_ARCH(o) DT_ARCH , (void *)static_cast<archetype *> (o) 66#define ARG_ARCH(o) DT_ARCH , (void *)static_cast<archetype *> (o)
67#define ARG_PARTY(o) DT_PARTY , (void *)static_cast<party *> (o) 67#define ARG_PARTY(o) DT_PARTY , (void *)static_cast<party *> (o)
68#define ARG_REGION(o) DT_REGION, (void *)static_cast<region *> (o) 68#define ARG_REGION(o) DT_REGION, (void *)static_cast<region *> (o)
69#define ARG_SOCKET(o) DT_SOCKET, (void *)static_cast<client_socket *> (o) 69#define ARG_SOCKET(o) DT_SOCKET, (void *)static_cast<client *> (o)
70 70
71// the ", ## __VA_ARGS" is, unfortunately, a gnu-cpp extension 71// the ", ## __VA_ARGS" is, unfortunately, a gnu-cpp extension
72 72
73// all these return true when the normal event processing should be skipped (if any) 73// all these return true when the normal event processing should be skipped (if any)
74#define INVOKE_(event, ...) cfperl_invoke (event, ## __VA_ARGS__, DT_END) 74#define INVOKE_(event, ...) cfperl_invoke (event, ## __VA_ARGS__, DT_END)
355 355
356private: 356private:
357 void cancel () { GEventAPI->cancel ((pe_watcher *)pe); } // private 357 void cancel () { GEventAPI->cancel ((pe_watcher *)pe); } // private
358}; 358};
359 359
360struct iw : watcher<pe_idle>, callback<void (iw &)>
361{
362 template<class O, class M>
363 iw (O object, M method)
364 : callback<void (iw &)> (object, method)
365 {
366 alloc ();
367 }
368
369private:
370 void alloc ();
371};
372
360struct iow : watcher<pe_io>, callback<void (iow &, int)> 373struct iow : watcher<pe_io>, callback<void (iow &, int)>
361{ 374{
362 template<class O, class M> 375 template<class O, class M>
363 iow (O object, M method) 376 iow (O object, M method)
364 : callback<void (iow &, int)> (object, method) 377 : callback<void (iow &, int)> (object, method)
365 { 378 {
366 alloc (); 379 alloc ();
367 } 380 }
368 381
369 iow &fd (int fd); 382 void fd (int fd);
370 int poll (); 383 int poll ();
371 iow &poll (int events); 384 void poll (int events);
372 385
373private: 386private:
374 void alloc (); 387 void alloc ();
375}; 388};
376 389

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines