///home/berryj/link/bin/genMethods "-g" "-t" "Vertex*" "-I" "LINK/graph/Vertex.h" "-d" "graph" "-y" "display_vertexptr" "-m" "mark_vertexptr" "-w" "free_vertexptr" 
#include <stk.h>
#include <LINK/stkWrapper/LINK_STk.h>

#include <LINK/graph/Vertex.h>

#include <LINK/stkWrapper/Wrapper.h>
#include <LINK/stkWrapper/Register.h>

void display_vertexptr(SCM, SCM, int);
void mark_vertexptr(SCM);
void free_vertexptr(SCM);

typedef Vertex* _Vertex_;

#define _Vertex_DATA(x) ((Vertex**) (EXTDATA(x)))
#define _Vertex_IS_DATA(x) (TYPEP(x, tc_CXXwrapper) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Vertex* >::type))
#define _Vertex_ISNT_DATA(x) (!_Vertex_IS_DATA(x))

#define _Vertex_CXX_DATA(x) (*(Vertex**) (EXTDATA(VAL(x))))
#define _Vertex_CXX_IS_DATA(x) (INSTANCEP(x) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Vertex* >::type))
#define _Vertex_CXX_ISNT_DATA(x) (!_Vertex_CXX_IS_DATA(x))


static SCM is_Vertex_(SCM i)
{
	if (_Vertex_CXX_IS_DATA(i))
		return Truth;
	return Ntruth;
}

PRIMITIVE STk_init__Vertex_()
{
	Wrapper<_Vertex_>::type = STk_new_CXXwrapper_id(
			Wrapper<_Vertex_>::name, 
			"",
			(void (*)(SCM x, SCM port, int mode))
			display_vertexptr,
			(void (*)(SCM x))mark_vertexptr,
			(void (*)(SCM x))free_vertexptr);
	Tcl_InitHashTable(&Register<_Vertex_>::objTable, TCL_ONE_WORD_KEYS);
	STk_add_new_cpp_primitive("Vertex?", tc_subr_1,
	(PRIMITIVE (*)(...))  is_Vertex_);
	return UNDEFINED;
}

void genExtra_Vertex_Methods(void);

PRIMITIVE STk_init_methods__Vertex_()
{
	genExtra_Vertex_Methods();
	return UNDEFINED;
}
