diff options
author | fcolin | 2007-02-01 09:45:37 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 09:45:37 +0000 |
commit | 54b0e5a30327525700dfba07de77aef5d78d08dd (patch) | |
tree | 5c5cce3fc3ec5c418c7c07463980cc0ff0109410 /CSharp | |
parent | 4f5b326b95178b48b5eff8cfaa7974d8ae5b7c57 (diff) | |
download | ivy-csharp-54b0e5a30327525700dfba07de77aef5d78d08dd.zip ivy-csharp-54b0e5a30327525700dfba07de77aef5d78d08dd.tar.gz ivy-csharp-54b0e5a30327525700dfba07de77aef5d78d08dd.tar.bz2 ivy-csharp-54b0e5a30327525700dfba07de77aef5d78d08dd.tar.xz |
Utilisateur : Fcolin Date : 23/06/06 Heure : 11:12 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 10)
Diffstat (limited to 'CSharp')
-rw-r--r-- | CSharp/Ivy/Ivy/IvyBinding.cs | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/CSharp/Ivy/Ivy/IvyBinding.cs b/CSharp/Ivy/Ivy/IvyBinding.cs index 6dcd544..4e48054 100644 --- a/CSharp/Ivy/Ivy/IvyBinding.cs +++ b/CSharp/Ivy/Ivy/IvyBinding.cs @@ -6,21 +6,35 @@ using System.Diagnostics; namespace IvyBus
{
+ /* This is the Client side of binding storage */
+ /* association of a generated Key and the expression and a compiled Expression matching */
+ /* this is RECEIVED from other client */
+
/// <summary>
/// Description résumée de IvyBinding.
/// </summary>
internal abstract class IvyBindingBase
{
- internal ushort key;
- internal string expression;
+ private ushort key;
+
+ internal ushort Key
+ {
+ get { return key; }
+ }
+ protected string expression;
+
+ internal string Expression
+ {
+ get { return expression; }
+ }
- public IvyBindingBase(ushort id, string exp)
+ internal IvyBindingBase(ushort id, string exp)
{
key = id;
expression = exp;
}
- public abstract string[] Match(string message);
+ internal abstract string[] Match(string message);
}
internal class IvyBindingRegexp : IvyBindingBase
@@ -30,9 +44,10 @@ namespace IvyBus public IvyBindingRegexp(ushort id, string exp)
: base(id, exp)
{
- regexp = new Regex(expression,RegexOptions.Compiled|RegexOptions.IgnoreCase);
+ regexp = new Regex(expression, /* RegexOptions.Compiled | */RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
+ //regexp.Match("###"); // for really compile the expression really slow on 3000 expression
}
- public override string[] Match(string message)
+ internal override string[] Match(string message)
{
string[] args = null;
// use of regexp to extract info
@@ -56,7 +71,7 @@ namespace IvyBus static string msgtag; // send message name
static StringDictionary args_values; // send message args[name]=value
- public IvyBindingSimple(ushort id, string exp)
+ internal IvyBindingSimple(ushort id, string exp)
: base(id, exp)
{
string[] expr = expression.Split( ' ' );
@@ -65,7 +80,7 @@ namespace IvyBus for ( int i = 1; i < expr.Length; i++ )
msgargs[i-1] = expr[i];
}
- static public void Prepare( string message )
+ static internal void Prepare(string message)
{
string[] msg = message.Split(' ');
msgtag = msg[0];
@@ -82,7 +97,7 @@ namespace IvyBus }
}
- public override string[] Match(string message)
+ internal override string[] Match(string message)
{
// the message is already parsed by prepare
//
|