summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfcolin2007-02-01 09:57:03 +0000
committerfcolin2007-02-01 09:57:03 +0000
commit760130cd630a7bc2c2498f3ed3b38a8ed901a1dc (patch)
tree067dd18a7e028035d20a410fd75fc3163327d011
parent4900eac07b9c0fe11e9a66114b73063390ca6986 (diff)
downloadivy-csharp-760130cd630a7bc2c2498f3ed3b38a8ed901a1dc.zip
ivy-csharp-760130cd630a7bc2c2498f3ed3b38a8ed901a1dc.tar.gz
ivy-csharp-760130cd630a7bc2c2498f3ed3b38a8ed901a1dc.tar.bz2
ivy-csharp-760130cd630a7bc2c2498f3ed3b38a8ed901a1dc.tar.xz
Utilisateur : Fcolin Date : 23/06/06 Heure : 11:12 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 10)
-rw-r--r--CSharp/Ivy/IvyPPC/IvyBinding.cs33
1 files changed, 24 insertions, 9 deletions
diff --git a/CSharp/Ivy/IvyPPC/IvyBinding.cs b/CSharp/Ivy/IvyPPC/IvyBinding.cs
index 6dcd544..4e48054 100644
--- a/CSharp/Ivy/IvyPPC/IvyBinding.cs
+++ b/CSharp/Ivy/IvyPPC/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
//