CACAO
Public Member Functions | Private Attributes
NativeLibrary Class Reference

Represents a native library. More...

Public Member Functions

 NativeLibrary (Utf8String filename, classloader_t *classloader=0, void *handle=0)
 
 NativeLibrary (void *handle)
 
classloader_tget_classloader () const
 
Utf8String get_filename () const
 
voidget_handle () const
 
voidopen ()
 Open this native library. More...
 
void close ()
 Close this native library. More...
 
bool load (JNIEnv *env)
 Load this native library and initialize it, if possible. More...
 
bool is_loaded ()
 Checks if this native library is loaded. More...
 
voidresolve_symbol (Utf8String symbolname) const
 Resolve the given symbol in this native library. More...
 

Private Attributes

Utf8String _filename
 Name of the native library. More...
 
classloader_t_classloader
 Defining classloader. More...
 
void_handle
 Filesystem handle. More...
 

Detailed Description

Represents a native library.

Definition at line 60 of file native.hpp.

Constructor & Destructor Documentation

NativeLibrary::NativeLibrary ( Utf8String  filename,
classloader_t classloader = 0,
void handle = 0 
)
inline

Definition at line 67 of file native.hpp.

NativeLibrary::NativeLibrary ( void handle)
inline

Definition at line 68 of file native.hpp.

Member Function Documentation

void NativeLibrary::close ( )

Close this native library.

Definition at line 434 of file native.cpp.

classloader_t* NativeLibrary::get_classloader ( ) const
inline

Definition at line 70 of file native.hpp.

Utf8String NativeLibrary::get_filename ( ) const
inline

Definition at line 71 of file native.hpp.

void* NativeLibrary::get_handle ( ) const
inline

Definition at line 72 of file native.hpp.

bool NativeLibrary::is_loaded ( )

Checks if this native library is loaded.

Returns
true if loaded, false otherwise.

Definition at line 530 of file native.cpp.

bool NativeLibrary::load ( JNIEnv env)

Load this native library and initialize it, if possible.

Parameters
envJNI environment.
Returns
true if library loaded successfully, false otherwise.

Definition at line 469 of file native.cpp.

void * NativeLibrary::open ( )

Open this native library.

Returns
File handle on success, NULL otherwise.

Definition at line 398 of file native.cpp.

void * NativeLibrary::resolve_symbol ( Utf8String  symbolname) const

Resolve the given symbol in this native library.

Parameters
symbolnameSymbol name.
Returns
Pointer to symbol if found, NULL otherwise.

Definition at line 545 of file native.cpp.

Field Documentation

classloader_t* NativeLibrary::_classloader
private

Defining classloader.

Definition at line 63 of file native.hpp.

Utf8String NativeLibrary::_filename
private

Name of the native library.

Definition at line 62 of file native.hpp.

void* NativeLibrary::_handle
private

Filesystem handle.

Definition at line 64 of file native.hpp.


The documentation for this class was generated from the following files: