diff options
author | fcolin | 2007-02-01 13:00:33 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 13:00:33 +0000 |
commit | c7734bf97cb2c4df14edd238257b95a6136c614a (patch) | |
tree | 97ddf045314bf4e4fc571135f997000246cf87bb /Ivy | |
parent | ea91919a2278f4894f11b47d1397e99f4a28f85f (diff) | |
download | ivy-cplusplus-c7734bf97cb2c4df14edd238257b95a6136c614a.zip ivy-cplusplus-c7734bf97cb2c4df14edd238257b95a6136c614a.tar.gz ivy-cplusplus-c7734bf97cb2c4df14edd238257b95a6136c614a.tar.bz2 ivy-cplusplus-c7734bf97cb2c4df14edd238257b95a6136c614a.tar.xz |
Utilisateur : Fcolin Date : 1/06/06 Heure : 16:40 Archivé dans $/Bus/Ivy Commentaire: correction bug du a la separation du module regexp transformation des tables de regexp en table de Hash (vss 33)
Diffstat (limited to 'Ivy')
-rw-r--r-- | Ivy/IvyApplication.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Ivy/IvyApplication.cxx b/Ivy/IvyApplication.cxx index 53341bc..bad4910 100644 --- a/Ivy/IvyApplication.cxx +++ b/Ivy/IvyApplication.cxx @@ -51,8 +51,8 @@ IvyApplication::IvyApplication(Ivy * bus) IvyApplication::~IvyApplication()
{
// bus->RemoveApplication( this );
- for ( unsigned int i = 0; i < regexp_in.size(); i++)
- delete regexp_in[i];
+ for ( Bindings::iterator iter = regexp_in.begin( ); iter != regexp_in.end( ); iter++ )
+ delete iter->second;
regexp_in.clear();
if ( m_hSocket != INVALID_SOCKET )
Close();
@@ -164,11 +164,11 @@ void IvyApplication::OnReceive(char * line) return;
}
- if ( regexp_in.size() < (id + 1) )
+ /*if ( regexp_in.size() < (id + 1) )
{
regexp_in.resize( id + 1 );
regexp_str_in.resize( id + 1 );
- }
+ }*/
regexp_in[ id ] = exp;
regexp_str_in[ id ] = arg;
#ifdef IVY_DEBUG
@@ -300,8 +300,8 @@ void IvyApplication::OnClose(int nErrorCode) if ( AppConnectedCallbackCalled )
bus->CallApplicationDisconnectedCallback( this );
- for ( unsigned int i = 0; i < regexp_in.size(); i++)
- delete regexp_in[i];
+ for ( Bindings::iterator iter = regexp_in.begin( ); iter != regexp_in.end( ); iter++)
+ delete iter->second;
regexp_in.clear();
Close();
//bus->RemoveApplication( this );
@@ -313,9 +313,11 @@ int IvyApplication::SendMsg(const char *message) IvyBinding *exp;
/* send to already connected */
- for ( unsigned int i = 0; i < regexp_in.size(); i++ )
+ for ( Bindings::iterator iter = regexp_in.begin( ); iter != regexp_in.end( ); iter++ )
{
- exp = regexp_in[i];
+ exp = iter->second;
+ if ( !exp )
+ continue;
int match_count = exp->Exec( message );
if ( match_count > 0 )
{
@@ -326,10 +328,10 @@ int IvyApplication::SendMsg(const char *message) for ( int j = 1; j < match_count; j++ )
{
exp->Match(message, j, &arglen, &arg);
- buffer += arg;
+ buffer += ivy::string(arg,arglen );
buffer += ARG_END;
}
- SendMsg( Msg, i, buffer.c_str() );
+ SendMsg( Msg, iter->first, buffer.c_str() );
count++;
}
|