Example #1
0
void OcPointer_reg() {
	class2oc("Pointer", cons, destruct, members, NULL, NULL, s_memb);
	// now make the val variable an actual double
	Symbol* sv = hoc_lookup("Pointer");
	Symbol* sx = hoc_table_lookup("val", sv->u.ctemplate->symtable);
	sx->type = VAR;
	sx->arayinfo = NULL;
	sv->u.ctemplate->steer = steer_val;
}
Example #2
0
void StateTransitionEvent_reg() {
	class2oc("StateTransitionEvent", ste_cons, ste_destruct,
		members, NULL, NULL, NULL);
}
Example #3
0
void Cvode_reg() {
	class2oc("CVode", cons, destruct, members, NULL, omembers, NULL);
	net_cvode_instance = new NetCvode(1);
	Daspk::dteps_ = 1e-9; // change with cvode.dae_init_dteps(newval)
}
Example #4
0
void Random_reg() {
        class2oc("Random", r_cons, r_destruct, r_members);
	random_play_list_ = new RandomPlayList();
}
Example #5
0
void LinearMechanism_reg() {
	class2oc("LinearMechanism", cons, destruct, members, NULL, NULL, NULL);
}
Example #6
0
void A_reg() {
	class2oc("A", A_constructor, A_destructor, A_member_func);
}
Example #7
0
// called from njvm.cpp when the first NrnJava hoc object is consstructed
void nrnjava_init () {	
//	printf("nrnjava_init\n"); 
	
	nrn_jclass_symlist = new NJSymList(20);
	class2oc("JavaObject", joconstruct, jodestruct, jo_members,
		nil, nil, jo_retstr_members);
	nrn_jobj_sym = hoc_lookup("JavaObject");
	nrn_vec_sym = hoc_lookup("Vector");

#if defined(_MSWIN) || (defined(MAC) && !defined(DARWIN))
	neuronCls = nrnjava_env->FindClass("neuron/Redirect");
	if (neuronCls == 0) {
		printf("ERROR in nrnjava_init : neuron/Redirect class not loaded\n");
printf("Look in the Redirect.out file of the current working directory for the reason for failure\n");
		return;
	}
	nrnjni_redirreg(neuronCls);
#endif

	nrnclsldr = nrnjava_env->FindClass("neuron/NrnClassLoader");
	if (nrnclsldr == 0) {
		printf("ERROR in nrnjava_init : neuron/NrnClassLoader not found\n");
	}
	nrnclsldID = nrnjava_env->GetStaticMethodID(nrnclsldr,
		"load", "(Ljava/lang/String;)Ljava/lang/Class;" );

	jstring js;
	js = nrnjava_env->NewStringUTF("neuron.Neuron");
	neuronCls  = (jclass)nrnjava_env->CallStaticObjectMethod(nrnclsldr, nrnclsldID,js);
	if (neuronCls == 0) {
		printf("ERROR in nrnjava_init : neuron.Neuron class not found\n");
		return;
	}
	js = nrnjava_env->NewStringUTF("neuron.HocObject");
	jclass hoCls = (jclass)nrnjava_env->CallStaticObjectMethod(nrnclsldr, nrnclsldID,js);
	if (hoCls == 0) {
		printf("ERROR in nrnjava_init : neuron.HocObject class not found\n");
		return;
	}

	p_java2nrn_cons = java2nrn_cons;
	p_java2nrn_destruct = java2nrn_destruct;
	p_java2nrn_dmeth = java2nrn_dmeth;
	p_java2nrn_smeth = java2nrn_smeth;
	p_java2nrn_ometh = java2nrn_ometh;
	p_java2nrn_classname = java2nrn_classname;
	p_java2nrn_identity = java2nrn_identity;

	nrnjava_pwm_setwin = pwm_setwin;

	nrnjni_registration(neuronCls);
	
	/*** Lookup method ids of Java Neuron class ***/
	constructNoArgID = nrnjava_env->GetStaticMethodID( neuronCls, 
		"constructNoArg", 
		"(I)Ljava/lang/Object;" );
	constructWithArgID = nrnjava_env->GetStaticMethodID( neuronCls, 
		"constructWithArg", 
		"(I)Ljava/lang/Object;" );
	makeHocClassID = nrnjava_env->GetStaticMethodID( neuronCls,
		"makeHocClass", 
		"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I" );
	invokeDoubleMethodID = nrnjava_env->GetStaticMethodID( neuronCls,
		"invokeDoubleMethod", 
		"(Ljava/lang/Object;III)D" );
	invokeCharsMethodID = nrnjava_env->GetStaticMethodID( neuronCls,
		"invokeCharsMethod", 
		"(Ljava/lang/Object;III)Ljava/lang/String;" );
	invokeObjectMethodID = nrnjava_env->GetStaticMethodID( neuronCls,
		"invokeObjectMethod", 
		"(Ljava/lang/Object;III)Ljava/lang/Object;" );
	encapsulateID = nrnjava_env->GetStaticMethodID( neuronCls,
		"encapsulateHocObject", 
		"(JI)Ljava/lang/Object;" );
	getObjectTypeID = nrnjava_env->GetStaticMethodID( neuronCls,
		"getObjectType", 
		"(Ljava/lang/Object;)I" );
	setwinID = nrnjava_env->GetStaticMethodID( neuronCls,
		"setwin",
		"(JIII)I");
	identityID = nrnjava_env->GetStaticMethodID( neuronCls,
		"identity",
		"(Ljava/lang/Object;Ljava/lang/Object;)I" );
	jclassnameID = nrnjava_env->GetStaticMethodID( neuronCls,
		"javaClassName",
		"(Ljava/lang/Object;)Ljava/lang/String;" );
	hocObjectCastID = nrnjava_env->GetFieldID( hoCls,
		"hocObjectCast", "J");

//	printf("neuronCls=%ld mids %ld %ld %ld\n", 
//	neuronCls, constructNoArgID,
//	makeHocClassID, invokeDoubleMethodID);

}
Example #8
0
void TQueue_reg() {
    class2oc("TQueue", cons, destruct, members);
}
Example #9
0
void SymChooser_reg() {
	class2oc("SymChooser", scons, sdestruct, members);
}
Example #10
0
void FInitializeHandler_reg() {
	class2oc("FInitializeHandler", finithnd_cons, finithnd_destruct,
		members, NULL, NULL, NULL);
}
Example #11
0
void NrnDAQ_reg() {
	class2oc("NrnDAQ", cons, destruct, members);
}