|
SockIt
|
#include <Event.h>
Public Member Functions | |
| Event () | |
| virtual | ~Event () |
| virtual void | send (const string &data)=0 |
| virtual void | send_bytes (const vector< byte > &bytes)=0 |
| virtual string | read () const =0 |
| virtual FB::VariantList | read_bytes () const =0 |
| virtual string | get_host ()=0 |
| virtual unsigned short | get_port ()=0 |
| FB_JSAPI_EVENT (error, 1,(const string &)) | |
Generic interface used to reply to data on some connection from Javascript.
| Event::Event | ( | ) |
Constructor that register the Javascript API for event objects
Definition at line 10 of file Event.cpp.
References get_host(), get_port(), read(), read_bytes(), send(), and send_bytes().
{
// Expose these methods to the Javascript
registerMethod("send", make_method(this, &Event::send));
registerMethod("sendBytes", make_method(this, &Event::send_bytes));
registerMethod("read", make_method(this, &Event::read));
registerMethod("readBytes", make_method(this, &Event::read_bytes));
registerMethod("getHost", make_method(this, &Event::get_host));
registerMethod("getPort", make_method(this, &Event::get_port));
}
| Event::~Event | ( | ) | [virtual] |
| Event::FB_JSAPI_EVENT | ( | error | , |
| 1 | , | ||
| (const string &) | |||
| ) |
The javascript event fired when an error occurs, which sends the error message when fired.
| virtual string Event::get_host | ( | ) | [pure virtual] |
| virtual unsigned short Event::get_port | ( | ) | [pure virtual] |
| virtual string Event::read | ( | ) | const [pure virtual] |
| virtual FB::VariantList Event::read_bytes | ( | ) | const [pure virtual] |
| virtual void Event::send | ( | const string & | data | ) | [pure virtual] |
| virtual void Event::send_bytes | ( | const vector< byte > & | bytes | ) | [pure virtual] |
1.7.3