From 1a6db4ddfa3ab1868b8e76bec6c62a6528de2832 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 12:56:26 +0000 Subject: Utilisateur : Fcolin Date : 1/06/06 Heure : 10:14 Archivé dans $/Bus/Ivy Commentaire: ajout Binding Callback et SetFilter (vss 25) --- Bus/Ivy/Ivy.cxx | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'Bus') diff --git a/Bus/Ivy/Ivy.cxx b/Bus/Ivy/Ivy.cxx index 66c1715..2da3766 100644 --- a/Bus/Ivy/Ivy.cxx +++ b/Bus/Ivy/Ivy.cxx @@ -64,6 +64,7 @@ Ivy::Ivy(const char* name, const char * ready, IvyApplicationCallback *callback, ApplicationName = name; messages_classes_count = 0; messages_classes = NULL; + binding_callback = NULL; application_callback = synchronous ? new IvySynchronousApplicationCallback(callback) : callback; direct_callback = NULL; die_callback = NULL; @@ -337,6 +338,27 @@ void Ivy::CallApplicationDisconnectedCallback(IvyApplication * app) application_callback->OnApplicationDisconnected( app ); } } +void Ivy::CallBindingAddCallback(IvyApplication * app, int id, const char * regexp) +{ + if ( binding_callback ) + { + binding_callback->OnAddBind( app, id, regexp ); + } +} +void Ivy::CallBindingRemoveCallback(IvyApplication * app, int id, const char * regexp) +{ + if ( binding_callback ) + { + binding_callback->OnRemoveBind( app, id, regexp ); + } +} +void Ivy::CallBindingFilterCallback(IvyApplication * app, int id, const char * regexp) +{ + if ( binding_callback ) + { + binding_callback->OnFilterBind( app, id, regexp ); + } +} void Ivy::SendDirectMsg(IvyApplication * app, int id, const char *message) { app->SendMsg( IvyApplication::DirectMsg, id, message ); @@ -358,8 +380,12 @@ bool Ivy::CheckRegexp(const char * exp) } return regexp_ok; } - -void Ivy::Classes(int argc, const char **argv ) +void Ivy::SetBindCallback( IvyBindingCallback* bind_callback ) +{ + binding_callback = synchronous ? new IvySynchronousBindingCallback(bind_callback) : bind_callback; +} + +void Ivy::SetFilter(int argc, const char **argv ) { messages_classes_count = argc; messages_classes = argv; -- cgit v1.1