Introduced properties

Redefined properties

redef fun ==(o: nullable Object): Bool

nitc $ MExplicitSuper :: ==

Have self and other the same value?
redef type SELF: MExplicitSuper

nitc $ MExplicitSuper :: SELF

Type of this instance, automatically specialized in every class
redef fun hash: Int

nitc $ MExplicitSuper :: hash

The hash code of the object.

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _from: MPropDef

nitc :: MExplicitSuper :: _from

protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun compile_callback_to_java(mmodule: MModule, mainmodule: MModule, ccu: CCompilationUnit)

nitc :: NitniCallback :: compile_callback_to_java

Compile C and Java code to implement this callback
fun compile_callback_to_objc(mmodule: MModule, mainmodule: MModule)

nitc :: NitniCallback :: compile_callback_to_objc

Compile this callback to be callable from Objective-C
protected fun from=(from: MPropDef)

nitc :: MExplicitSuper :: from=

fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun jni_methods_declaration(from_module: MModule): Array[String]

nitc :: NitniCallback :: jni_methods_declaration

Returns the list of C functions to link with extern Java methods, as required
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
package_diagram nitc::MExplicitSuper MExplicitSuper nitc::NitniCallback NitniCallback nitc::MExplicitSuper->nitc::NitniCallback core::Object Object nitc::NitniCallback->core::Object ...core::Object ... ...core::Object->core::Object

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

interface NitniCallback

nitc :: NitniCallback

Classification for all nitni callbacks

Class definitions

nitc $ MExplicitSuper
class MExplicitSuper
	super NitniCallback

	var from: MPropDef

	redef fun hash do return from.hash
	redef fun ==(o) do return o isa MExplicitSuper and from == o.from
end
src/nitni/nitni_callbacks.nit:251,1--258,3

nitc :: compiler_ffi $ MExplicitSuper
redef class MExplicitSuper
	private fun compile_extern_callback(v: AbstractCompilerVisitor, ccu: CCompilationUnit, compile_implementation_too: Bool)
	do
		var mproperty = from.mproperty
		assert mproperty isa MMethod
		var mclass_type = from.mclassdef.mclass.mclass_type

		# In nitni files, declare internal function as extern
		var internal_csignature = mproperty.build_csignature(mclass_type, v.compiler.mainmodule, "___super", long_signature, internal_call_context)
		ccu.header_decl.add("extern {internal_csignature};\n")

		# In nitni files, #define friendly as extern
		var friendly_cname = mproperty.build_cname(mclass_type, v.compiler.mainmodule, "___super", short_signature)
		var internal_cname = mproperty.build_cname(mclass_type, v.compiler.mainmodule, "___super", long_signature)
		ccu.header_decl.add("#define {friendly_cname} {internal_cname}\n")

		if not compile_implementation_too then return

		# Internally, implement internal function
		var nitni_visitor = v.compiler.new_visitor
		nitni_visitor.frame = v.frame
		var msignature = mproperty.lookup_first_definition(v.compiler.mainmodule, mclass_type).msignature

		var csignature_blind = mproperty.build_csignature(mclass_type, v.compiler.mainmodule, "___super", long_signature, internal_call_context)

		nitni_visitor.add_decl("/* nitni callback to super for {mproperty.full_name} */")
		nitni_visitor.add_decl("{csignature_blind} \{")

		var vars = new Array[RuntimeVariable]

		var recv_var = nitni_visitor.var_from_c("self", mclass_type)
		recv_var = nitni_visitor.box_extern(recv_var, mclass_type)
		vars.add(recv_var)

		for p in msignature.mparameters do
			var arg_mtype = v.anchor(p.mtype)
			var arg = nitni_visitor.var_from_c(p.name, arg_mtype)
			arg = nitni_visitor.box_extern(arg, arg_mtype)
			vars.add(arg)
		end

		var ret_var = nitni_visitor.supercall(from.as(MMethodDef), mclass_type, vars)

		var return_mtype = msignature.return_mtype
		if return_mtype != null then
			assert ret_var != null
			return_mtype = v.anchor(return_mtype)
			ret_var = nitni_visitor.autobox(ret_var, return_mtype)
			ret_var = nitni_visitor.unbox_extern(ret_var, return_mtype)
			nitni_visitor.ret_to_c(ret_var, return_mtype)
		end
		nitni_visitor.add("\}")
	end
end
src/compiler/compiler_ffi/compiler_ffi.nit:199,1--252,3