nitc $ CPPCompilationUnit :: SELF
Type of this instance, automatically specialized in every classnitc :: CCompilationUnit :: _body_custom
custom code and generated for ffinitc :: CCompilationUnit :: _body_impl
implementation body of extern methodsnitc :: CCompilationUnit :: _header_c_types
types of extern classes and friendly typesnitc :: CCompilationUnit :: _header_custom
custom C header code or generated for other languagesnitc :: CCompilationUnit :: _header_decl
implementation declaration for extern methodsnitc :: CCompilationUnit :: add_exported_function
Add a publicc_function
accessible from outside this compilation unit
nitc :: CCompilationUnit :: add_local_function
Add astatic
c_function
to be strictly local to this unit
nitc :: CCompilationUnit :: add_non_static_local_function
Similar toadd_local_function
but not static
nitc :: CCompilationUnit :: body_custom=
custom code and generated for ffinitc :: CCompilationUnit :: body_impl=
implementation body of extern methodscore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: CCompilationUnit :: compile_body_core
Write the core of the body tostream
nitc :: CCompilationUnit :: compile_header_core
Write the core of the header tostream
core :: Object :: defaultinit
nitc :: CCompilationUnit :: defaultinit
nitc :: CCompilationUnit :: header_c_base=
headernitc :: CCompilationUnit :: header_c_types
types of extern classes and friendly typesnitc :: CCompilationUnit :: header_c_types=
types of extern classes and friendly typesnitc :: CCompilationUnit :: header_custom
custom C header code or generated for other languagesnitc :: CCompilationUnit :: header_custom=
custom C header code or generated for other languagesnitc :: CCompilationUnit :: header_decl
implementation declaration for extern methodsnitc :: CCompilationUnit :: header_decl=
implementation declaration for extern methodscore :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: CCompilationUnit :: write_as_foreign_lib_api
Write this compilation unit as the API of a foreign code librarynitc :: CCompilationUnit :: write_as_impl
Compile as_ffi
files which contains the implementation of extern methods
nitc :: CCompilationUnit :: write_as_nitni
Compile a_nitni
files, used to implement nitni features for the compiler
nitc :: CCompilationUnit :: write_body_to_file
Write the body part tofile
including all includes
nitc :: CCompilationUnit :: write_header_to_file
Write the header part tofile
including all includes
using the guard
class CPPCompilationUnit
super CCompilationUnit
fun write_to_files(mmodule: MModule, compdir: String): ExternCppFile
do
var base_name = "{mmodule.c_name}._ffi"
var h_file = "{base_name}.hpp"
var guard = "{mmodule.c_name.to_s.to_upper}_NIT_HPP"
write_header_to_file(mmodule, "{compdir}/{h_file}", new Array[String], guard)
var c_file = "{base_name}.cpp"
write_body_to_file(mmodule, "{compdir}/{c_file}", ["<string>", "<iostream>", "\"{h_file}\""])
files.add("{compdir}/{c_file}")
return new ExternCppFile(c_file, mmodule)
end
end
src/ffi/cpp.nit:157,1--176,3