TypeMatchExpression.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. "use strict"
  2. // Autogenerated by cport.py on 2013-09-17 14:37
  3. var TypeMatchExpression = module.exports = function (){
  4. }, klass = TypeMatchExpression, base = Object , proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
  5. // File: expression_leaf.h lines: 338-338
  6. // ElementPath _elementPath;
  7. proto._elementPath = undefined;
  8. // File: expression_leaf.h lines: 337-337
  9. // StringData _path;
  10. proto._path = undefined;
  11. // File: expression_leaf.h lines: 339-339
  12. // int _type;
  13. proto._type = undefined;
  14. // File: expression_leaf.h lines: 338-338
  15. // ElementPath _elementPath;
  16. proto._elementPath = undefined;
  17. // File: expression_leaf.h lines: 337-337
  18. // StringData _path;
  19. proto._path = undefined;
  20. // File: expression_leaf.h lines: 339-339
  21. // int _type;
  22. proto._type = undefined;
  23. /**
  24. *
  25. * This documentation was automatically generated. Please update when you touch this function.
  26. * @method TypeMatchExpression
  27. * @param
  28. *
  29. */
  30. proto.TypeMatchExpression = function TypeMatchExpression( /* TYPE_OPERATOR */ ){
  31. // File: expression_leaf.h lines: 307-306
  32. // TypeMatchExpression() : MatchExpression( TYPE_OPERATOR ){}
  33. }
  34. /**
  35. *
  36. * This documentation was automatically generated. Please update when you touch this function.
  37. * @method debugString
  38. * @param
  39. *
  40. */
  41. proto.debugString = function debugString( /* StringBuilder& debug, int level */ ){
  42. // File: expression_leaf.cpp lines: 335-343
  43. // void TypeMatchExpression::debugString( StringBuilder& debug, int level ) const {
  44. // _debugAddSpace( debug, level );
  45. // debug << _path << " type: " << _type;
  46. // MatchExpression::TagData* td = getTag();
  47. // if (NULL != td) {
  48. // debug << " ";
  49. // td->debugString(&debug);
  50. // }
  51. // debug << "\n";
  52. // }
  53. }
  54. /**
  55. *
  56. * This documentation was automatically generated. Please update when you touch this function.
  57. * @method equivalent
  58. * @param
  59. *
  60. */
  61. proto.equivalent = function equivalent( /* const MatchExpression* other */ ){
  62. // File: expression_leaf.cpp lines: 347-352
  63. // bool TypeMatchExpression::equivalent( const MatchExpression* other ) const {
  64. // if ( matchType() != other->matchType() )
  65. // return false;
  66. //
  67. // const TypeMatchExpression* realOther = static_cast<const TypeMatchExpression*>( other );
  68. // return _path == realOther->_path && _type == realOther->_type;
  69. // }
  70. }
  71. /**
  72. *
  73. * This documentation was automatically generated. Please update when you touch this function.
  74. * @method getData
  75. * @param
  76. *
  77. */
  78. proto.getData = function getData( /* */ ){
  79. // File: expression_leaf.h lines: 328-327
  80. // int getData() const { return _type; }
  81. }
  82. /**
  83. *
  84. * This documentation was automatically generated. Please update when you touch this function.
  85. * @method init
  86. * @param
  87. *
  88. */
  89. proto.init = function init( /* const StringData& path, int type */ ){
  90. // File: expression_leaf.cpp lines: 308-311
  91. // Status TypeMatchExpression::init( const StringData& path, int type ) {
  92. // _path = path;
  93. // _type = type;
  94. // return _elementPath.init( _path );
  95. // }
  96. }
  97. /**
  98. *
  99. * This documentation was automatically generated. Please update when you touch this function.
  100. * @method matches
  101. * @param
  102. *
  103. */
  104. proto.matches = function matches( /* const MatchableDocument* doc, MatchDetails* details */ ){
  105. // File: expression_leaf.cpp lines: 318-332
  106. // bool TypeMatchExpression::matches( const MatchableDocument* doc, MatchDetails* details ) const {
  107. // boost::scoped_ptr<ElementIterator> cursor( doc->getIterator( _elementPath ) );
  108. // while ( cursor->more() ) {
  109. // ElementIterator::Context e = cursor->next();
  110. // if ( e.outerArray() )
  111. // continue;
  112. //
  113. // if ( !matchesSingleElement( e.element() ) )
  114. // continue;
  115. // if ( details && details->needRecord() && !e.arrayOffset().eoo() ) {
  116. // details->setElemMatchKey( e.arrayOffset().fieldName() );
  117. // }
  118. // return true;
  119. // }
  120. // return false;
  121. // }
  122. }
  123. /**
  124. *
  125. * This documentation was automatically generated. Please update when you touch this function.
  126. * @method matchesSingleElement
  127. * @param
  128. *
  129. */
  130. proto.matchesSingleElement = function matchesSingleElement( /* const BSONElement& e */ ){
  131. // File: expression_leaf.cpp lines: 314-315
  132. // bool TypeMatchExpression::matchesSingleElement( const BSONElement& e ) const {
  133. // return e.type() == _type;
  134. // }
  135. }
  136. /**
  137. *
  138. * This documentation was automatically generated. Please update when you touch this function.
  139. * @method path
  140. * @param
  141. *
  142. */
  143. proto.path = function path( /* */ ){
  144. // File: expression_leaf.h lines: 330-329
  145. // virtual const StringData path() const { return _path; }
  146. }
  147. /**
  148. *
  149. * This documentation was automatically generated. Please update when you touch this function.
  150. * @method shallowClone
  151. * @param
  152. *
  153. */
  154. proto.shallowClone = function shallowClone( /* */ ){
  155. // File: expression_leaf.h lines: 311-314
  156. // virtual MatchExpression* shallowClone() const {
  157. // TypeMatchExpression* e = new TypeMatchExpression();
  158. // e->init(_path, _type);
  159. // return e;
  160. // }
  161. }