switch_stream_handle_t *stream_p;
int mine;
public:
- Stream(void);
- Stream(switch_stream_handle_t *);
- virtual ~Stream();
- void write(const char *data);
- const char *get_data(void);
+ SWITCH_DECLARE_CONSTRUCTOR Stream(void);
+ SWITCH_DECLARE_CONSTRUCTOR Stream(switch_stream_handle_t *);
+ virtual SWITCH_DECLARE_CONSTRUCTOR ~Stream();
+ SWITCH_DECLARE(void) write(const char *data);
+ SWITCH_DECLARE(const char *)get_data(void);
};
class Event {
char *serialized_string;
int mine;
- Event(const char *type, const char *subclass_name = NULL);
- Event(switch_event_t *wrap_me, int free_me=0);
- virtual ~Event();
- const char *serialize(const char *format=NULL);
- bool set_priority(switch_priority_t priority = SWITCH_PRIORITY_NORMAL);
- char *get_header(char *header_name);
- char *get_body(void);
- bool add_body(const char *value);
- bool add_header(const char *header_name, const char *value);
- bool del_header(const char *header_name);
- bool fire(void);
+ SWITCH_DECLARE_CONSTRUCTOR Event(const char *type, const char *subclass_name = NULL);
+ SWITCH_DECLARE_CONSTRUCTOR Event(switch_event_t *wrap_me, int free_me=0);
+ virtual SWITCH_DECLARE_CONSTRUCTOR ~Event();
+ SWITCH_DECLARE(const char *)serialize(const char *format=NULL);
+ SWITCH_DECLARE(bool) set_priority(switch_priority_t priority = SWITCH_PRIORITY_NORMAL);
+ SWITCH_DECLARE(char *)get_header(char *header_name);
+ SWITCH_DECLARE(char *)get_body(void);
+ SWITCH_DECLARE(bool) add_body(const char *value);
+ SWITCH_DECLARE(bool) add_header(const char *header_name, const char *value);
+ SWITCH_DECLARE(bool) del_header(const char *header_name);
+ SWITCH_DECLARE(bool) fire(void);
};
#endif
-Event::Event(const char *type, const char *subclass_name)
+SWITCH_DECLARE_CONSTRUCTOR Event::Event(const char *type, const char *subclass_name)
{
switch_event_types_t event_id;
mine = 1;
}
-Event::Event(switch_event_t *wrap_me, int free_me)
+SWITCH_DECLARE_CONSTRUCTOR Event::Event(switch_event_t *wrap_me, int free_me)
{
event = wrap_me;
mine = free_me;
serialized_string = NULL;
}
-Event::~Event()
+SWITCH_DECLARE_CONSTRUCTOR Event::~Event()
{
if (serialized_string) {
}
-const char *Event::serialize(const char *format)
+SWITCH_DECLARE(const char *)Event::serialize(const char *format)
{
int isxml = 0;
}
-bool Event::fire(void)
+SWITCH_DECLARE(bool) Event::fire(void)
{
if (!mine) {
switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "Not My event!\n");
return false;
}
-bool Event::set_priority(switch_priority_t priority)
+SWITCH_DECLARE(bool) Event::set_priority(switch_priority_t priority)
{
if (event) {
switch_event_set_priority(event, priority);
return false;
}
-char *Event::get_header(char *header_name)
+SWITCH_DECLARE(char *)Event::get_header(char *header_name)
{
if (event) {
return switch_event_get_header(event, header_name);
return NULL;
}
-bool Event::add_header(const char *header_name, const char *value)
+SWITCH_DECLARE(bool) Event::add_header(const char *header_name, const char *value)
{
if (event) {
return switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, value) == SWITCH_STATUS_SUCCESS ? true : false;
return false;
}
-bool Event::del_header(const char *header_name)
+SWITCH_DECLARE(bool) Event::del_header(const char *header_name)
{
if (event) {
return switch_event_del_header(event, header_name) == SWITCH_STATUS_SUCCESS ? true : false;
}
-bool Event::add_body(const char *value)
+SWITCH_DECLARE(bool) Event::add_body(const char *value)
{
if (event) {
return switch_event_add_body(event, "%s", value) == SWITCH_STATUS_SUCCESS ? true : false;
return false;
}
-char *Event::get_body(void)
+SWITCH_DECLARE(char *)Event::get_body(void)
{
if (event) {
return switch_event_get_body(event);
return NULL;
}
-Stream::Stream()
+SWITCH_DECLARE_CONSTRUCTOR Stream::Stream()
{
SWITCH_STANDARD_STREAM(mystream);
stream_p = &mystream;
mine = 1;
}
-Stream::Stream(switch_stream_handle_t *sp)
+SWITCH_DECLARE_CONSTRUCTOR Stream::Stream(switch_stream_handle_t *sp)
{
stream_p = sp;
mine = 0;
}
-Stream::~Stream()
+SWITCH_DECLARE_CONSTRUCTOR Stream::~Stream()
{
if (mine) {
switch_safe_free(mystream.data);
}
}
-void Stream::write(const char *data)
+SWITCH_DECLARE(void) Stream::write(const char *data)
{
stream_p->write_function(stream_p, "%s", data);
}
-const char *Stream::get_data()
+SWITCH_DECLARE(const char *)Stream::get_data()
{
return stream_p ? (const char *)stream_p->data : NULL;
}