#include <hxcpp.h>

#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_hxMath
#include <hxMath.h>
#endif
#ifndef INCLUDED_luxe_structural_BalancedBST
#include <luxe/structural/BalancedBST.h>
#endif
#ifndef INCLUDED_luxe_structural_BalancedBSTNode
#include <luxe/structural/BalancedBSTNode.h>
#endif
#ifndef INCLUDED_luxe_structural_BalancedBSTTraverseMethod
#include <luxe/structural/BalancedBSTTraverseMethod.h>
#endif
namespace luxe{
namespace structural{

Void BalancedBST_obj::__construct(Dynamic compare_function)
{
HX_STACK_FRAME("luxe.structural.BalancedBST","new",0x6f8d6d94,"luxe.structural.BalancedBST.new","luxe/structural/BalancedBST.hx",32,0xa0b365fc)

HX_STACK_ARG(compare_function,"compare_function")
{
	HX_STACK_LINE(32)
	this->compare = compare_function;
}
;
	return null();
}

//BalancedBST_obj::~BalancedBST_obj() { }

Dynamic BalancedBST_obj::__CreateEmpty() { return  new BalancedBST_obj; }
hx::ObjectPtr< BalancedBST_obj > BalancedBST_obj::__new(Dynamic compare_function)
{  hx::ObjectPtr< BalancedBST_obj > result = new BalancedBST_obj();
	result->__construct(compare_function);
	return result;}

Dynamic BalancedBST_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< BalancedBST_obj > result = new BalancedBST_obj();
	result->__construct(inArgs[0]);
	return result;}

int BalancedBST_obj::size( ){
	HX_STACK_FRAME("luxe.structural.BalancedBST","size",0x2f83910d,"luxe.structural.BalancedBST.size","luxe/structural/BalancedBST.hx",41,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_LINE(41)
	return this->node_count(this->root);
}


HX_DEFINE_DYNAMIC_FUNC0(BalancedBST_obj,size,return )

int BalancedBST_obj::depth( ){
	HX_STACK_FRAME("luxe.structural.BalancedBST","depth",0xbdec4337,"luxe.structural.BalancedBST.depth","luxe/structural/BalancedBST.hx",48,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_LINE(48)
	return this->node_depth(this->root);
}


HX_DEFINE_DYNAMIC_FUNC0(BalancedBST_obj,depth,return )

Void BalancedBST_obj::insert( Dynamic _key,Dynamic _value){
{
		HX_STACK_FRAME("luxe.structural.BalancedBST","insert",0xa122de85,"luxe.structural.BalancedBST.insert","luxe/structural/BalancedBST.hx",53,0xa0b365fc)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_key,"_key")
		HX_STACK_ARG(_value,"_value")
		HX_STACK_LINE(55)
		this->root = this->node_insert(this->root,_key,_value);
		HX_STACK_LINE(56)
		this->root->color = false;
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(BalancedBST_obj,insert,(void))

bool BalancedBST_obj::contains( Dynamic _key){
	HX_STACK_FRAME("luxe.structural.BalancedBST","contains",0xc0d7606b,"luxe.structural.BalancedBST.contains","luxe/structural/BalancedBST.hx",64,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_key,"_key")
	HX_STACK_LINE(64)
	return (this->find(_key) != null());
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,contains,return )

Dynamic BalancedBST_obj::find( Dynamic _key){
	HX_STACK_FRAME("luxe.structural.BalancedBST","find",0x26ebc085,"luxe.structural.BalancedBST.find","luxe/structural/BalancedBST.hx",71,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_key,"_key")
	HX_STACK_LINE(71)
	return this->node_find(this->root,_key);
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,find,return )

int BalancedBST_obj::rank( Dynamic _key){
	HX_STACK_FRAME("luxe.structural.BalancedBST","rank",0x2ed43df8,"luxe.structural.BalancedBST.rank","luxe/structural/BalancedBST.hx",79,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_key,"_key")
	HX_STACK_LINE(79)
	return this->node_rank(_key,this->root);
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,rank,return )

Dynamic BalancedBST_obj::select( int _rank){
	HX_STACK_FRAME("luxe.structural.BalancedBST","select",0x6d78b648,"luxe.structural.BalancedBST.select","luxe/structural/BalancedBST.hx",85,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_rank,"_rank")
	HX_STACK_LINE(87)
	::luxe::structural::BalancedBSTNode _node = this->node_select(this->root,_rank);		HX_STACK_VAR(_node,"_node");
	HX_STACK_LINE(89)
	if (((_node != null()))){
		HX_STACK_LINE(90)
		return _node->key;
	}
	else{
		HX_STACK_LINE(92)
		return null();
	}
	HX_STACK_LINE(89)
	return null();
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,select,return )

Dynamic BalancedBST_obj::smallest( ){
	HX_STACK_FRAME("luxe.structural.BalancedBST","smallest",0x3a3d942b,"luxe.structural.BalancedBST.smallest","luxe/structural/BalancedBST.hx",98,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_LINE(100)
	::luxe::structural::BalancedBSTNode _node = this->node_smallest(this->root);		HX_STACK_VAR(_node,"_node");
	HX_STACK_LINE(102)
	if (((_node != null()))){
		HX_STACK_LINE(103)
		return _node->key;
	}
	else{
		HX_STACK_LINE(105)
		return null();
	}
	HX_STACK_LINE(102)
	return null();
}


HX_DEFINE_DYNAMIC_FUNC0(BalancedBST_obj,smallest,return )

Dynamic BalancedBST_obj::largest( ){
	HX_STACK_FRAME("luxe.structural.BalancedBST","largest",0x155e8450,"luxe.structural.BalancedBST.largest","luxe/structural/BalancedBST.hx",111,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_LINE(113)
	::luxe::structural::BalancedBSTNode _node = this->node_largest(this->root);		HX_STACK_VAR(_node,"_node");
	HX_STACK_LINE(115)
	if (((_node != null()))){
		HX_STACK_LINE(116)
		return _node->key;
	}
	else{
		HX_STACK_LINE(118)
		return null();
	}
	HX_STACK_LINE(115)
	return null();
}


HX_DEFINE_DYNAMIC_FUNC0(BalancedBST_obj,largest,return )

bool BalancedBST_obj::remove( Dynamic _key){
	HX_STACK_FRAME("luxe.structural.BalancedBST","remove",0x07ce3790,"luxe.structural.BalancedBST.remove","luxe/structural/BalancedBST.hx",124,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_key,"_key")
	HX_STACK_LINE(126)
	if (((  ((!(this->is_red(this->root->left)))) ? bool(!(this->is_red(this->root->right))) : bool(false) ))){
		HX_STACK_LINE(127)
		this->root->color = true;
	}
	HX_STACK_LINE(130)
	if ((!(this->contains(_key)))){
		HX_STACK_LINE(131)
		return false;
	}
	HX_STACK_LINE(134)
	this->root = this->node_remove(this->root,_key);
	HX_STACK_LINE(136)
	if (((this->root != null()))){
		HX_STACK_LINE(137)
		this->root->color = false;
	}
	HX_STACK_LINE(140)
	return true;
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,remove,return )

Void BalancedBST_obj::remove_smallest( ){
{
		HX_STACK_FRAME("luxe.structural.BalancedBST","remove_smallest",0xa58ddbae,"luxe.structural.BalancedBST.remove_smallest","luxe/structural/BalancedBST.hx",145,0xa0b365fc)
		HX_STACK_THIS(this)
		HX_STACK_LINE(147)
		if (((  ((!(this->is_red(this->root->left)))) ? bool(!(this->is_red(this->root->right))) : bool(false) ))){
			HX_STACK_LINE(148)
			this->root->color = true;
		}
		HX_STACK_LINE(151)
		this->root = this->node_remove_smallest(this->root);
		HX_STACK_LINE(153)
		if (((this->root != null()))){
			HX_STACK_LINE(154)
			this->root->color = false;
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(BalancedBST_obj,remove_smallest,(void))

Void BalancedBST_obj::remove_largest( ){
{
		HX_STACK_FRAME("luxe.structural.BalancedBST","remove_largest",0x809cde2d,"luxe.structural.BalancedBST.remove_largest","luxe/structural/BalancedBST.hx",160,0xa0b365fc)
		HX_STACK_THIS(this)
		HX_STACK_LINE(163)
		if (((  ((!(this->is_red(this->root->left)))) ? bool(!(this->is_red(this->root->right))) : bool(false) ))){
			HX_STACK_LINE(164)
			this->root->color = true;
		}
		HX_STACK_LINE(167)
		this->root = this->node_remove_largest(this->root);
		HX_STACK_LINE(169)
		if (((this->root != null()))){
			HX_STACK_LINE(170)
			this->root->color = false;
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(BalancedBST_obj,remove_largest,(void))

Dynamic BalancedBST_obj::floor( Dynamic _key){
	HX_STACK_FRAME("luxe.structural.BalancedBST","floor",0xe9592400,"luxe.structural.BalancedBST.floor","luxe/structural/BalancedBST.hx",176,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_key,"_key")
	HX_STACK_LINE(178)
	::luxe::structural::BalancedBSTNode _node = this->node_floor(this->root,_key);		HX_STACK_VAR(_node,"_node");
	HX_STACK_LINE(180)
	if (((_node == null()))){
		HX_STACK_LINE(181)
		return null();
	}
	HX_STACK_LINE(184)
	return _node->key;
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,floor,return )

Dynamic BalancedBST_obj::ceil( Dynamic _key){
	HX_STACK_FRAME("luxe.structural.BalancedBST","ceil",0x24ed0f51,"luxe.structural.BalancedBST.ceil","luxe/structural/BalancedBST.hx",189,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_key,"_key")
	HX_STACK_LINE(191)
	::luxe::structural::BalancedBSTNode _node = this->node_ceil(this->root,_key);		HX_STACK_VAR(_node,"_node");
	HX_STACK_LINE(193)
	if (((_node == null()))){
		HX_STACK_LINE(194)
		return null();
	}
	HX_STACK_LINE(197)
	return _node->key;
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,ceil,return )

Dynamic BalancedBST_obj::toArray( ){
	HX_STACK_FRAME("luxe.structural.BalancedBST","toArray",0xcbb60152,"luxe.structural.BalancedBST.toArray","luxe/structural/BalancedBST.hx",202,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_LINE(204)
	Dynamic a = Dynamic( Array_obj<Dynamic>::__new().Add(Dynamic( Array_obj<Dynamic>::__new() )));		HX_STACK_VAR(a,"a");

	HX_BEGIN_LOCAL_FUNC_S1(hx::LocalFunc,_Function_1_1,Dynamic,a)
	Void run(::luxe::structural::BalancedBSTNode _node){
		HX_STACK_FRAME("*","_Function_1_1",0x5200ed37,"*._Function_1_1","luxe/structural/BalancedBST.hx",207,0xa0b365fc)
		HX_STACK_ARG(_node,"_node")
		{
			HX_STACK_LINE(207)
			a->__GetItem((int)0)->__Field(HX_CSTRING("push"),true)(_node->value);
		}
		return null();
	}
	HX_END_LOCAL_FUNC1((void))

	HX_STACK_LINE(206)
	this->traverse_node(this->root,::luxe::structural::BalancedBSTTraverseMethod_obj::order_retain, Dynamic(new _Function_1_1(a)));
	HX_STACK_LINE(210)
	return a->__GetItem((int)0);
}


HX_DEFINE_DYNAMIC_FUNC0(BalancedBST_obj,toArray,return )

Dynamic BalancedBST_obj::keys( ){
	HX_STACK_FRAME("luxe.structural.BalancedBST","keys",0x2a36d240,"luxe.structural.BalancedBST.keys","luxe/structural/BalancedBST.hx",215,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_LINE(217)
	Dynamic a = Dynamic( Array_obj<Dynamic>::__new().Add(Dynamic( Array_obj<Dynamic>::__new() )));		HX_STACK_VAR(a,"a");

	HX_BEGIN_LOCAL_FUNC_S1(hx::LocalFunc,_Function_1_1,Dynamic,a)
	Void run(::luxe::structural::BalancedBSTNode _node){
		HX_STACK_FRAME("*","_Function_1_1",0x5200ed37,"*._Function_1_1","luxe/structural/BalancedBST.hx",220,0xa0b365fc)
		HX_STACK_ARG(_node,"_node")
		{
			HX_STACK_LINE(220)
			a->__GetItem((int)0)->__Field(HX_CSTRING("push"),true)(_node->key);
		}
		return null();
	}
	HX_END_LOCAL_FUNC1((void))

	HX_STACK_LINE(219)
	this->traverse_node(this->root,::luxe::structural::BalancedBSTTraverseMethod_obj::order_retain, Dynamic(new _Function_1_1(a)));
	HX_STACK_LINE(223)
	return a->__GetItem((int)0);
}


HX_DEFINE_DYNAMIC_FUNC0(BalancedBST_obj,keys,return )

Dynamic BalancedBST_obj::iterator( ){
	HX_STACK_FRAME("luxe.structural.BalancedBST","iterator",0x27f6503a,"luxe.structural.BalancedBST.iterator","luxe/structural/BalancedBST.hx",231,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_LINE(231)
	return this->toArray()->__Field(HX_CSTRING("iterator"),true)();
}


HX_DEFINE_DYNAMIC_FUNC0(BalancedBST_obj,iterator,return )

Void BalancedBST_obj::traverse_node( ::luxe::structural::BalancedBSTNode _node,::luxe::structural::BalancedBSTTraverseMethod _method,Dynamic _on_traverse){
{
		HX_STACK_FRAME("luxe.structural.BalancedBST","traverse_node",0xbc7f6923,"luxe.structural.BalancedBST.traverse_node","luxe/structural/BalancedBST.hx",238,0xa0b365fc)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_node,"_node")
		HX_STACK_ARG(_method,"_method")
		HX_STACK_ARG(_on_traverse,"_on_traverse")
		HX_STACK_LINE(238)
		if (((_node != null()))){
			HX_STACK_LINE(240)
			switch( (int)(_method->__Index())){
				case (int)0: {
					HX_STACK_LINE(243)
					_on_traverse(_node).Cast< Void >();
					HX_STACK_LINE(244)
					this->traverse_node(_node->left,_method,_on_traverse);
					HX_STACK_LINE(245)
					this->traverse_node(_node->right,_method,_on_traverse);
				}
				;break;
				case (int)1: {
					HX_STACK_LINE(248)
					this->traverse_node(_node->left,_method,_on_traverse);
					HX_STACK_LINE(249)
					_on_traverse(_node).Cast< Void >();
					HX_STACK_LINE(250)
					this->traverse_node(_node->right,_method,_on_traverse);
				}
				;break;
				case (int)2: {
					HX_STACK_LINE(253)
					this->traverse_node(_node->left,_method,_on_traverse);
					HX_STACK_LINE(254)
					this->traverse_node(_node->right,_method,_on_traverse);
					HX_STACK_LINE(255)
					_on_traverse(_node).Cast< Void >();
				}
				;break;
			}
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC3(BalancedBST_obj,traverse_node,(void))

bool BalancedBST_obj::get_empty( ){
	HX_STACK_FRAME("luxe.structural.BalancedBST","get_empty",0xefad1318,"luxe.structural.BalancedBST.get_empty","luxe/structural/BalancedBST.hx",268,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_LINE(268)
	return (this->root == null());
}


HX_DEFINE_DYNAMIC_FUNC0(BalancedBST_obj,get_empty,return )

int BalancedBST_obj::node_depth( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_depth",0x118ce112,"luxe.structural.BalancedBST.node_depth","luxe/structural/BalancedBST.hx",273,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(275)
	if (((_node == null()))){
		HX_STACK_LINE(276)
		return (int)0;
	}
	HX_STACK_LINE(280)
	int _g = this->node_depth(_node->left);		HX_STACK_VAR(_g,"_g");
	HX_STACK_LINE(279)
	Float _n_depth = ::Math_obj::max(_g,this->node_depth(_node->right));		HX_STACK_VAR(_n_depth,"_n_depth");
	HX_STACK_LINE(284)
	return ((int)1 + ::Std_obj::_int(_n_depth));
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,node_depth,return )

int BalancedBST_obj::node_count( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_count",0x84c634de,"luxe.structural.BalancedBST.node_count","luxe/structural/BalancedBST.hx",291,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(291)
	if (((_node == null()))){
		HX_STACK_LINE(291)
		return (int)0;
	}
	else{
		HX_STACK_LINE(291)
		return _node->nodecount;
	}
	HX_STACK_LINE(291)
	return (int)0;
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,node_count,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::node_insert( ::luxe::structural::BalancedBSTNode _node,Dynamic _key,Dynamic _value){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_insert",0x7a0c604a,"luxe.structural.BalancedBST.node_insert","luxe/structural/BalancedBST.hx",296,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_ARG(_key,"_key")
	HX_STACK_ARG(_value,"_value")
	HX_STACK_LINE(298)
	if (((_node == null()))){
		HX_STACK_LINE(300)
		return ::luxe::structural::BalancedBSTNode_obj::__new(_key,_value,(int)1,true);
	}
	HX_STACK_LINE(305)
	int comparison = this->compare(_key,_node->key);		HX_STACK_VAR(comparison,"comparison");
	HX_STACK_LINE(307)
	if (((comparison < (int)0))){
		HX_STACK_LINE(309)
		_node->left = this->node_insert(_node->left,_key,_value);
	}
	else{
		HX_STACK_LINE(311)
		if (((comparison > (int)0))){
			HX_STACK_LINE(313)
			_node->right = this->node_insert(_node->right,_key,_value);
		}
		else{
			HX_STACK_LINE(317)
			_node->value = _value;
		}
	}
	HX_STACK_LINE(321)
	if (((  ((this->is_red(_node->right))) ? bool(!(this->is_red(_node->left))) : bool(false) ))){
		HX_STACK_LINE(322)
		_node = this->rotate_left(_node);
	}
	HX_STACK_LINE(325)
	if (((  ((this->is_red(_node->left))) ? bool(this->is_red(_node->left->left)) : bool(false) ))){
		HX_STACK_LINE(326)
		_node = this->rotate_right(_node);
	}
	HX_STACK_LINE(329)
	if (((  ((this->is_red(_node->left))) ? bool(this->is_red(_node->right)) : bool(false) ))){
		HX_STACK_LINE(330)
		this->swap_color(_node);
	}
	HX_STACK_LINE(333)
	this->node_update_count(_node);
	HX_STACK_LINE(335)
	return _node;
}


HX_DEFINE_DYNAMIC_FUNC3(BalancedBST_obj,node_insert,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::node_update_count( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_update_count",0x6c497eaa,"luxe.structural.BalancedBST.node_update_count","luxe/structural/BalancedBST.hx",340,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(342)
	int _g = this->node_count(_node->left);		HX_STACK_VAR(_g,"_g");
	HX_STACK_LINE(342)
	_node->nodecount = ((_g + this->node_count(_node->right)) + (int)1);
	HX_STACK_LINE(344)
	return _node;
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,node_update_count,return )

Dynamic BalancedBST_obj::node_find( ::luxe::structural::BalancedBSTNode _node,Dynamic _key){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_find",0x43fed70a,"luxe.structural.BalancedBST.node_find","luxe/structural/BalancedBST.hx",349,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_ARG(_key,"_key")
	HX_STACK_LINE(351)
	if (((_node == null()))){
		HX_STACK_LINE(352)
		return null();
	}
	HX_STACK_LINE(355)
	int comparison = this->compare(_key,_node->key);		HX_STACK_VAR(comparison,"comparison");
	HX_STACK_LINE(357)
	if (((comparison < (int)0))){
		HX_STACK_LINE(358)
		return this->node_find(_node->left,_key);
	}
	else{
		HX_STACK_LINE(359)
		if (((comparison > (int)0))){
			HX_STACK_LINE(360)
			return this->node_find(_node->right,_key);
		}
		else{
			HX_STACK_LINE(362)
			return _node->value;
		}
	}
	HX_STACK_LINE(357)
	return null();
}


HX_DEFINE_DYNAMIC_FUNC2(BalancedBST_obj,node_find,return )

int BalancedBST_obj::node_rank( Dynamic _key,::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_rank",0x4be7547d,"luxe.structural.BalancedBST.node_rank","luxe/structural/BalancedBST.hx",368,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_key,"_key")
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(370)
	if (((_node == null()))){
		HX_STACK_LINE(371)
		return (int)0;
	}
	HX_STACK_LINE(374)
	int comparison = this->compare(_key,_node->key);		HX_STACK_VAR(comparison,"comparison");
	HX_STACK_LINE(376)
	if (((comparison < (int)0))){
		HX_STACK_LINE(377)
		return this->node_rank(_key,_node->left);
	}
	else{
		HX_STACK_LINE(378)
		if (((comparison > (int)0))){
			HX_STACK_LINE(379)
			int _g = ((int)1 + this->node_count(_node->left));		HX_STACK_VAR(_g,"_g");
			HX_STACK_LINE(379)
			return (_g + this->node_rank(_key,_node->right));
		}
		else{
			HX_STACK_LINE(381)
			return this->node_count(_node->left);
		}
	}
	HX_STACK_LINE(376)
	return (int)0;
}


HX_DEFINE_DYNAMIC_FUNC2(BalancedBST_obj,node_rank,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::node_select( ::luxe::structural::BalancedBSTNode _node,int _rank){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_select",0x4662380d,"luxe.structural.BalancedBST.node_select","luxe/structural/BalancedBST.hx",387,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_ARG(_rank,"_rank")
	HX_STACK_LINE(389)
	if (((_node == null()))){
		HX_STACK_LINE(390)
		return null();
	}
	HX_STACK_LINE(393)
	int _r = this->node_count(_node->left);		HX_STACK_VAR(_r,"_r");
	HX_STACK_LINE(395)
	if (((_r > _rank))){
		HX_STACK_LINE(396)
		return this->node_select(_node->left,_rank);
	}
	else{
		HX_STACK_LINE(397)
		if (((_r < _rank))){
			HX_STACK_LINE(398)
			return this->node_select(_node->right,((_rank - _r) - (int)1));
		}
		else{
			HX_STACK_LINE(400)
			return _node;
		}
	}
	HX_STACK_LINE(395)
	return null();
}


HX_DEFINE_DYNAMIC_FUNC2(BalancedBST_obj,node_select,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::node_smallest( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_smallest",0x41ded130,"luxe.structural.BalancedBST.node_smallest","luxe/structural/BalancedBST.hx",406,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(408)
	if (((_node->left == null()))){
		HX_STACK_LINE(409)
		return _node;
	}
	HX_STACK_LINE(412)
	return this->node_smallest(_node->left);
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,node_smallest,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::node_largest( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_largest",0x08c68eeb,"luxe.structural.BalancedBST.node_largest","luxe/structural/BalancedBST.hx",419,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(419)
	if (((_node->right == null()))){
		HX_STACK_LINE(420)
		return _node;
	}
	else{
		HX_STACK_LINE(422)
		return this->node_largest(_node->right);
	}
	HX_STACK_LINE(419)
	return null();
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,node_largest,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::node_floor( ::luxe::structural::BalancedBSTNode _node,Dynamic _key){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_floor",0x3cf9c1db,"luxe.structural.BalancedBST.node_floor","luxe/structural/BalancedBST.hx",428,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_ARG(_key,"_key")
	HX_STACK_LINE(430)
	if (((_node == null()))){
		HX_STACK_LINE(431)
		return null();
	}
	HX_STACK_LINE(434)
	int comparison = this->compare(_key,_node->key);		HX_STACK_VAR(comparison,"comparison");
	HX_STACK_LINE(436)
	if (((comparison == (int)0))){
		HX_STACK_LINE(437)
		return _node;
	}
	else{
		HX_STACK_LINE(438)
		if (((comparison < (int)0))){
			HX_STACK_LINE(439)
			return this->node_floor(_node->left,_key);
		}
	}
	HX_STACK_LINE(442)
	::luxe::structural::BalancedBSTNode _n = this->node_floor(_node->right,_key);		HX_STACK_VAR(_n,"_n");
	HX_STACK_LINE(444)
	if (((_n != null()))){
		HX_STACK_LINE(445)
		return _n;
	}
	else{
		HX_STACK_LINE(447)
		return _node;
	}
	HX_STACK_LINE(444)
	return null();
}


HX_DEFINE_DYNAMIC_FUNC2(BalancedBST_obj,node_floor,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::node_ceil( ::luxe::structural::BalancedBSTNode _node,Dynamic _key){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_ceil",0x420025d6,"luxe.structural.BalancedBST.node_ceil","luxe/structural/BalancedBST.hx",453,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_ARG(_key,"_key")
	HX_STACK_LINE(455)
	if (((_node == null()))){
		HX_STACK_LINE(456)
		return null();
	}
	HX_STACK_LINE(459)
	int comparison = this->compare(_key,_node->key);		HX_STACK_VAR(comparison,"comparison");
	HX_STACK_LINE(461)
	if (((comparison == (int)0))){
		HX_STACK_LINE(463)
		return _node;
	}
	else{
		HX_STACK_LINE(465)
		if (((comparison < (int)0))){
			HX_STACK_LINE(467)
			::luxe::structural::BalancedBSTNode _n = this->node_ceil(_node->left,_key);		HX_STACK_VAR(_n,"_n");
			HX_STACK_LINE(469)
			if (((_n != null()))){
				HX_STACK_LINE(470)
				return _n;
			}
			else{
				HX_STACK_LINE(472)
				return _node;
			}
		}
	}
	HX_STACK_LINE(477)
	return this->node_ceil(_node->right,_key);
}


HX_DEFINE_DYNAMIC_FUNC2(BalancedBST_obj,node_ceil,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::node_remove_smallest( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_remove_smallest",0x673a7949,"luxe.structural.BalancedBST.node_remove_smallest","luxe/structural/BalancedBST.hx",482,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(484)
	if (((_node->left == null()))){
		HX_STACK_LINE(485)
		return null();
	}
	HX_STACK_LINE(488)
	if (((  ((!(this->is_red(_node->left)))) ? bool(!(this->is_red(_node->left->left))) : bool(false) ))){
		HX_STACK_LINE(489)
		_node = this->move_red_left(_node);
	}
	HX_STACK_LINE(492)
	_node->left = this->node_remove_smallest(_node->left);
	HX_STACK_LINE(493)
	this->node_update_count(_node);
	HX_STACK_LINE(495)
	return this->balance(_node);
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,node_remove_smallest,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::node_remove_largest( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_remove_largest",0xe4352cf2,"luxe.structural.BalancedBST.node_remove_largest","luxe/structural/BalancedBST.hx",500,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(502)
	if ((this->is_red(_node->left))){
		HX_STACK_LINE(503)
		_node = this->rotate_right(_node);
	}
	HX_STACK_LINE(506)
	if (((_node->right == null()))){
		HX_STACK_LINE(507)
		return null();
	}
	HX_STACK_LINE(510)
	if (((  ((!(this->is_red(_node->right)))) ? bool(!(this->is_red(_node->right->left))) : bool(false) ))){
		HX_STACK_LINE(511)
		_node = this->move_red_right(_node);
	}
	HX_STACK_LINE(514)
	_node->right = this->node_remove_largest(_node->right);
	HX_STACK_LINE(515)
	this->node_update_count(_node);
	HX_STACK_LINE(517)
	return this->balance(_node);
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,node_remove_largest,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::node_remove( ::luxe::structural::BalancedBSTNode _node,Dynamic _key){
	HX_STACK_FRAME("luxe.structural.BalancedBST","node_remove",0xe0b7b955,"luxe.structural.BalancedBST.node_remove","luxe/structural/BalancedBST.hx",522,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_ARG(_key,"_key")
	HX_STACK_LINE(524)
	int comparison = this->compare(_key,_node->key);		HX_STACK_VAR(comparison,"comparison");
	HX_STACK_LINE(526)
	if (((comparison < (int)0))){
		HX_STACK_LINE(528)
		if (((  ((!(this->is_red(_node->left)))) ? bool(!(this->is_red(_node->left->left))) : bool(false) ))){
			HX_STACK_LINE(529)
			_node = this->move_red_left(_node);
		}
		HX_STACK_LINE(532)
		_node->left = this->node_remove(_node->left,_key);
	}
	else{
		HX_STACK_LINE(536)
		if ((this->is_red(_node->left))){
			HX_STACK_LINE(537)
			_node = this->rotate_right(_node);
		}
		HX_STACK_LINE(540)
		int comparison1 = this->compare(_key,_node->key);		HX_STACK_VAR(comparison1,"comparison1");
		HX_STACK_LINE(542)
		if (((bool((comparison1 == (int)0)) && bool((_node->right == null()))))){
			HX_STACK_LINE(543)
			return null();
		}
		HX_STACK_LINE(546)
		if (((  ((!(this->is_red(_node->right)))) ? bool(!(this->is_red(_node->right->left))) : bool(false) ))){
			HX_STACK_LINE(547)
			_node = this->move_red_right(_node);
		}
		HX_STACK_LINE(550)
		int comparison2 = this->compare(_key,_node->key);		HX_STACK_VAR(comparison2,"comparison2");
		HX_STACK_LINE(551)
		if (((comparison2 == (int)0))){
			HX_STACK_LINE(553)
			::luxe::structural::BalancedBSTNode _n = this->node_smallest(_node->right);		HX_STACK_VAR(_n,"_n");
			HX_STACK_LINE(554)
			_node->key = _n->key;
			HX_STACK_LINE(555)
			_node->value = _n->value;
			HX_STACK_LINE(557)
			_node->right = this->node_remove_smallest(_node->right);
		}
		else{
			HX_STACK_LINE(560)
			_node->right = this->node_remove(_node->right,_key);
		}
	}
	HX_STACK_LINE(565)
	return this->balance(_node);
}


HX_DEFINE_DYNAMIC_FUNC2(BalancedBST_obj,node_remove,return )

bool BalancedBST_obj::is_red( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","is_red",0x74f55288,"luxe.structural.BalancedBST.is_red","luxe/structural/BalancedBST.hx",569,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(571)
	if (((_node == null()))){
		HX_STACK_LINE(572)
		return false;
	}
	HX_STACK_LINE(575)
	return (_node->color == true);
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,is_red,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::rotate_left( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","rotate_left",0xf004e4df,"luxe.structural.BalancedBST.rotate_left","luxe/structural/BalancedBST.hx",579,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(581)
	::luxe::structural::BalancedBSTNode _n = _node->right;		HX_STACK_VAR(_n,"_n");
	HX_STACK_LINE(584)
	_n->color = _node->color;
	HX_STACK_LINE(585)
	_node->color = true;
	HX_STACK_LINE(587)
	_node->right = _n->left;
	HX_STACK_LINE(588)
	_n->left = _node;
	HX_STACK_LINE(591)
	_n->nodecount = _node->nodecount;
	HX_STACK_LINE(592)
	this->node_update_count(_node);
	HX_STACK_LINE(594)
	return _n;
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,rotate_left,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::rotate_right( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","rotate_right",0x8b506c04,"luxe.structural.BalancedBST.rotate_right","luxe/structural/BalancedBST.hx",598,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(600)
	::luxe::structural::BalancedBSTNode _n = _node->left;		HX_STACK_VAR(_n,"_n");
	HX_STACK_LINE(603)
	_n->color = _node->color;
	HX_STACK_LINE(604)
	_node->color = true;
	HX_STACK_LINE(606)
	_node->left = _n->right;
	HX_STACK_LINE(607)
	_n->right = _node;
	HX_STACK_LINE(610)
	_n->nodecount = _node->nodecount;
	HX_STACK_LINE(611)
	this->node_update_count(_node);
	HX_STACK_LINE(613)
	return _n;
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,rotate_right,return )

Void BalancedBST_obj::swap_color( ::luxe::structural::BalancedBSTNode _node){
{
		HX_STACK_FRAME("luxe.structural.BalancedBST","swap_color",0xfb93c4c3,"luxe.structural.BalancedBST.swap_color","luxe/structural/BalancedBST.hx",617,0xa0b365fc)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_node,"_node")
		HX_STACK_LINE(619)
		_node->color = !(_node->color);
		HX_STACK_LINE(620)
		_node->left->color = !(_node->left->color);
		HX_STACK_LINE(621)
		_node->right->color = !(_node->right->color);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,swap_color,(void))

::luxe::structural::BalancedBSTNode BalancedBST_obj::move_red_left( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","move_red_left",0x3cc03557,"luxe.structural.BalancedBST.move_red_left","luxe/structural/BalancedBST.hx",625,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(627)
	this->swap_color(_node);
	HX_STACK_LINE(629)
	if ((this->is_red(_node->right->left))){
		HX_STACK_LINE(630)
		_node->right = this->rotate_right(_node->right);
		HX_STACK_LINE(631)
		_node = this->rotate_left(_node);
	}
	HX_STACK_LINE(634)
	return _node;
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,move_red_left,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::move_red_right( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","move_red_right",0x627b848c,"luxe.structural.BalancedBST.move_red_right","luxe/structural/BalancedBST.hx",637,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(639)
	this->swap_color(_node);
	HX_STACK_LINE(641)
	if ((this->is_red(_node->left->left))){
		HX_STACK_LINE(642)
		_node = this->rotate_right(_node);
	}
	HX_STACK_LINE(645)
	return _node;
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,move_red_right,return )

::luxe::structural::BalancedBSTNode BalancedBST_obj::balance( ::luxe::structural::BalancedBSTNode _node){
	HX_STACK_FRAME("luxe.structural.BalancedBST","balance",0xfd2fe450,"luxe.structural.BalancedBST.balance","luxe/structural/BalancedBST.hx",648,0xa0b365fc)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_node,"_node")
	HX_STACK_LINE(650)
	if ((this->is_red(_node->right))){
		HX_STACK_LINE(651)
		_node = this->rotate_left(_node);
	}
	HX_STACK_LINE(654)
	if (((  ((this->is_red(_node->left))) ? bool(this->is_red(_node->left->left)) : bool(false) ))){
		HX_STACK_LINE(655)
		_node = this->rotate_right(_node);
	}
	HX_STACK_LINE(658)
	if (((  ((this->is_red(_node->left))) ? bool(this->is_red(_node->right)) : bool(false) ))){
		HX_STACK_LINE(659)
		this->swap_color(_node);
	}
	HX_STACK_LINE(662)
	this->node_update_count(_node);
	HX_STACK_LINE(664)
	return _node;
}


HX_DEFINE_DYNAMIC_FUNC1(BalancedBST_obj,balance,return )

bool BalancedBST_obj::red;

bool BalancedBST_obj::black;


BalancedBST_obj::BalancedBST_obj()
{
}

void BalancedBST_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(BalancedBST);
	HX_MARK_MEMBER_NAME(root,"root");
	HX_MARK_MEMBER_NAME(compare,"compare");
	HX_MARK_MEMBER_NAME(empty,"empty");
	HX_MARK_END_CLASS();
}

void BalancedBST_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(root,"root");
	HX_VISIT_MEMBER_NAME(compare,"compare");
	HX_VISIT_MEMBER_NAME(empty,"empty");
}

Dynamic BalancedBST_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"root") ) { return root; }
		if (HX_FIELD_EQ(inName,"size") ) { return size_dyn(); }
		if (HX_FIELD_EQ(inName,"find") ) { return find_dyn(); }
		if (HX_FIELD_EQ(inName,"rank") ) { return rank_dyn(); }
		if (HX_FIELD_EQ(inName,"ceil") ) { return ceil_dyn(); }
		if (HX_FIELD_EQ(inName,"keys") ) { return keys_dyn(); }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"empty") ) { return inCallProp ? get_empty() : empty; }
		if (HX_FIELD_EQ(inName,"depth") ) { return depth_dyn(); }
		if (HX_FIELD_EQ(inName,"floor") ) { return floor_dyn(); }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"insert") ) { return insert_dyn(); }
		if (HX_FIELD_EQ(inName,"select") ) { return select_dyn(); }
		if (HX_FIELD_EQ(inName,"remove") ) { return remove_dyn(); }
		if (HX_FIELD_EQ(inName,"is_red") ) { return is_red_dyn(); }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"compare") ) { return compare; }
		if (HX_FIELD_EQ(inName,"largest") ) { return largest_dyn(); }
		if (HX_FIELD_EQ(inName,"toArray") ) { return toArray_dyn(); }
		if (HX_FIELD_EQ(inName,"balance") ) { return balance_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"contains") ) { return contains_dyn(); }
		if (HX_FIELD_EQ(inName,"smallest") ) { return smallest_dyn(); }
		if (HX_FIELD_EQ(inName,"iterator") ) { return iterator_dyn(); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"get_empty") ) { return get_empty_dyn(); }
		if (HX_FIELD_EQ(inName,"node_find") ) { return node_find_dyn(); }
		if (HX_FIELD_EQ(inName,"node_rank") ) { return node_rank_dyn(); }
		if (HX_FIELD_EQ(inName,"node_ceil") ) { return node_ceil_dyn(); }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"node_depth") ) { return node_depth_dyn(); }
		if (HX_FIELD_EQ(inName,"node_count") ) { return node_count_dyn(); }
		if (HX_FIELD_EQ(inName,"node_floor") ) { return node_floor_dyn(); }
		if (HX_FIELD_EQ(inName,"swap_color") ) { return swap_color_dyn(); }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"node_insert") ) { return node_insert_dyn(); }
		if (HX_FIELD_EQ(inName,"node_select") ) { return node_select_dyn(); }
		if (HX_FIELD_EQ(inName,"node_remove") ) { return node_remove_dyn(); }
		if (HX_FIELD_EQ(inName,"rotate_left") ) { return rotate_left_dyn(); }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"node_largest") ) { return node_largest_dyn(); }
		if (HX_FIELD_EQ(inName,"rotate_right") ) { return rotate_right_dyn(); }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"traverse_node") ) { return traverse_node_dyn(); }
		if (HX_FIELD_EQ(inName,"node_smallest") ) { return node_smallest_dyn(); }
		if (HX_FIELD_EQ(inName,"move_red_left") ) { return move_red_left_dyn(); }
		break;
	case 14:
		if (HX_FIELD_EQ(inName,"remove_largest") ) { return remove_largest_dyn(); }
		if (HX_FIELD_EQ(inName,"move_red_right") ) { return move_red_right_dyn(); }
		break;
	case 15:
		if (HX_FIELD_EQ(inName,"remove_smallest") ) { return remove_smallest_dyn(); }
		break;
	case 17:
		if (HX_FIELD_EQ(inName,"node_update_count") ) { return node_update_count_dyn(); }
		break;
	case 19:
		if (HX_FIELD_EQ(inName,"node_remove_largest") ) { return node_remove_largest_dyn(); }
		break;
	case 20:
		if (HX_FIELD_EQ(inName,"node_remove_smallest") ) { return node_remove_smallest_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic BalancedBST_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"root") ) { root=inValue.Cast< ::luxe::structural::BalancedBSTNode >(); return inValue; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"empty") ) { empty=inValue.Cast< bool >(); return inValue; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"compare") ) { compare=inValue.Cast< Dynamic >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void BalancedBST_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("root"));
	outFields->push(HX_CSTRING("empty"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	HX_CSTRING("red"),
	HX_CSTRING("black"),
	String(null()) };

#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
	{hx::fsObject /*::luxe::structural::BalancedBSTNode*/ ,(int)offsetof(BalancedBST_obj,root),HX_CSTRING("root")},
	{hx::fsObject /*Dynamic*/ ,(int)offsetof(BalancedBST_obj,compare),HX_CSTRING("compare")},
	{hx::fsBool,(int)offsetof(BalancedBST_obj,empty),HX_CSTRING("empty")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String sMemberFields[] = {
	HX_CSTRING("root"),
	HX_CSTRING("compare"),
	HX_CSTRING("empty"),
	HX_CSTRING("size"),
	HX_CSTRING("depth"),
	HX_CSTRING("insert"),
	HX_CSTRING("contains"),
	HX_CSTRING("find"),
	HX_CSTRING("rank"),
	HX_CSTRING("select"),
	HX_CSTRING("smallest"),
	HX_CSTRING("largest"),
	HX_CSTRING("remove"),
	HX_CSTRING("remove_smallest"),
	HX_CSTRING("remove_largest"),
	HX_CSTRING("floor"),
	HX_CSTRING("ceil"),
	HX_CSTRING("toArray"),
	HX_CSTRING("keys"),
	HX_CSTRING("iterator"),
	HX_CSTRING("traverse_node"),
	HX_CSTRING("get_empty"),
	HX_CSTRING("node_depth"),
	HX_CSTRING("node_count"),
	HX_CSTRING("node_insert"),
	HX_CSTRING("node_update_count"),
	HX_CSTRING("node_find"),
	HX_CSTRING("node_rank"),
	HX_CSTRING("node_select"),
	HX_CSTRING("node_smallest"),
	HX_CSTRING("node_largest"),
	HX_CSTRING("node_floor"),
	HX_CSTRING("node_ceil"),
	HX_CSTRING("node_remove_smallest"),
	HX_CSTRING("node_remove_largest"),
	HX_CSTRING("node_remove"),
	HX_CSTRING("is_red"),
	HX_CSTRING("rotate_left"),
	HX_CSTRING("rotate_right"),
	HX_CSTRING("swap_color"),
	HX_CSTRING("move_red_left"),
	HX_CSTRING("move_red_right"),
	HX_CSTRING("balance"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(BalancedBST_obj::__mClass,"__mClass");
	HX_MARK_MEMBER_NAME(BalancedBST_obj::red,"red");
	HX_MARK_MEMBER_NAME(BalancedBST_obj::black,"black");
};

#ifdef HXCPP_VISIT_ALLOCS
static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(BalancedBST_obj::__mClass,"__mClass");
	HX_VISIT_MEMBER_NAME(BalancedBST_obj::red,"red");
	HX_VISIT_MEMBER_NAME(BalancedBST_obj::black,"black");
};

#endif

Class BalancedBST_obj::__mClass;

void BalancedBST_obj::__register()
{
	hx::Static(__mClass) = hx::RegisterClass(HX_CSTRING("luxe.structural.BalancedBST"), hx::TCanCast< BalancedBST_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics
#ifdef HXCPP_VISIT_ALLOCS
    , sVisitStatics
#endif
#ifdef HXCPP_SCRIPTABLE
    , sMemberStorageInfo
#endif
);
}

void BalancedBST_obj::__boot()
{
	red= true;
	black= false;
}

} // end namespace luxe
} // end namespace structural
