Browse Source

EAGLESIX-3002: InMatchExpression v2.6.5 compliant

David Aebersold 11 years ago
parent
commit
d46790dfee
1 changed files with 63 additions and 60 deletions
  1. 63 60
      lib/pipeline/matcher/InMatchExpression.js

+ 63 - 60
lib/pipeline/matcher/InMatchExpression.js

@@ -1,7 +1,6 @@
 "use strict";
 var LeafMatchExpression = require('./LeafMatchExpression');
 
-// Autogenerated by cport.py on 2013-09-17 14:37
 var InMatchExpression = module.exports = function InMatchExpression(){
 	base.call(this);
 	this._matchType = 'MATCH_IN';
@@ -13,9 +12,19 @@ var errors = require("../../Errors.js"),
 	ErrorCodes = errors.ErrorCodes,
 	ArrayFilterEntries = require("./ArrayFilterEntries.js");
 
-// File: expression_leaf.h lines: 294-294
 proto._arrayEntries = null;
 
+/**
+ *
+ * Initialize the necessary items
+ * @method init
+ * @param path
+ *
+ */
+proto.init = function init(path) {
+	return this.initPath( path );
+};
+
 /**
  *
  * Check if the input element matches a real element
@@ -40,7 +49,7 @@ proto._matchesRealElement = function _matchesRealElement(e) {
 	}
 
 	if(typeof(e) == 'undefined') {
-		return true; // Every Set contains the Null Set, man.
+		return true; // Every Set contains the Null Set.
 	}
 
 	return false;
@@ -48,15 +57,27 @@ proto._matchesRealElement = function _matchesRealElement(e) {
 
 /**
  *
- * Copy our array to the input array
- * @method copyTo
- * @param toFillIn
+ * Check if the input element matches
+ * @method matchesSingleElement
+ * @param e
  *
  */
-proto.copyTo = function copyTo(toFillIn) {
-	// File: expression_leaf.cpp lines: 481-483
-	toFillIn.init(this.path());
-	this._arrayEntries.copyTo( toFillIn._arrayEntries );
+proto.matchesSingleElement = function matchesSingleElement(e) {
+	if( this._arrayEntries === null && typeof(e) == 'object' && Object.keys(e).length === 0) {
+		return true;
+	}
+	if (this._matchesRealElement( e )) {
+		return true;
+	}
+	/*if (e instanceof Array){
+		for (var i = 0; i < e.length; i++) {
+			if(this._matchesRealElement( e[i] )) {
+				return true;
+			}
+		}
+
+	}*/
+	return false;
 };
 
 /**
@@ -67,7 +88,14 @@ proto.copyTo = function copyTo(toFillIn) {
  *
  */
 proto.debugString = function debugString(level) {
-	// File: expression_leaf.cpp lines: 455-463
+	var debug = this.path() + " $in ";
+	debug = debug + _arrayEntries;
+	var td = this.getTag();
+	if ( null !== td) {
+		debug = debug + " ";
+		debug = debug + td;
+	}
+	debug = debug + "\n";
 	return this._debugAddSpace( level ) + this.path() + ";$in: TODO " + (this.getTag() ? this.getTag().debugString() : '') + "\n";
 };
 
@@ -79,7 +107,6 @@ proto.debugString = function debugString(level) {
  *
  */
 proto.equivalent = function equivalent(other) {
-	// File: expression_leaf.cpp lines: 466-472
 	if ( other._matchType != 'MATCH_IN' ) {
 		return false;
 	}
@@ -88,74 +115,50 @@ proto.equivalent = function equivalent(other) {
 
 /**
  *
- * Return the _arrayEntries property
- * @method getArrayFilterEntries
+ * clone this instance to a new one
+ * @method shallowClone
  *
  */
-proto.getArrayFilterEntries = function getArrayFilterEntries(){
-	// File: expression_leaf.h lines: 280-279
-	return this._arrayEntries;
+proto.shallowClone = function shallowClone(){
+	var e = new InMatchExpression();
+	this.copyTo( e );
+	if ( this.getTag() ){
+		e.setTag(this.getTag().this.Clone());
+	}
+	return e;
 };
 
 /**
  *
- * Return the _arrayEntries property
- * @method getData
+ * Copy our array to the input array
+ * @method copyTo
+ * @param toFillIn
  *
  */
-proto.getData = function getData(){
-	// File: expression_leaf.h lines: 290-289
-	return this._arrayEntries;
+proto.copyTo = function copyTo(toFillIn) {
+	toFillIn.init(this.path());
+	this._arrayEntries.copyTo( toFillIn._arrayEntries );
 };
 
-/**
- *
- * Initialize the necessary items
- * @method init
- * @param path
- *
- */
-proto.init = function init(path) {
-	// File: expression_leaf.cpp lines: 418-419
-	return this.initPath( path );
-};
 
 /**
  *
- * Check if the input element matches
- * @method matchesSingleElement
- * @param e
+ * Return the _arrayEntries property
+ * @method getArrayFilterEntries
  *
  */
-proto.matchesSingleElement = function matchesSingleElement(e) {
-	// File: expression_leaf.cpp lines: 434-452
-	if( this._arrayEntries === null && typeof(e) == 'object' && Object.keys(e).length === 0) {
-		return true;
-	}
-	if (this._matchesRealElement( e )) {
-		return true;
-	}
-	/*if (e instanceof Array){
-		for (var i = 0; i < e.length; i++) {
-			if(this._matchesRealElement( e[i] )) {
-				return true;
-			}
-		}
-
-	}*/
-	return false;
+proto.getArrayFilterEntries = function getArrayFilterEntries(){
+	return this._arrayEntries;
 };
 
 /**
  *
- * clone this instance to a new one
- * @method shallowClone
+ * Return the _arrayEntries property
+ * @method getData
  *
  */
-proto.shallowClone = function shallowClone(){
-	// File: expression_leaf.cpp lines: 475-478
-	var e = new InMatchExpression();
-	this.copyTo( e );
-	return e;
+proto.getData = function getData(){
+	return this._arrayEntries;
 };
 
+