summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC
diff options
context:
space:
mode:
Diffstat (limited to 'CSharp/Ivy/IvyPPC')
-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
//