#include <DynObjLib.h>
Public Types | |
enum | { LibMayLoadModules = 1, LibMayOverrideTypes = 2, LibIsMain = 4 } |
Public Member Functions | |
virtual DynObjType *docall | doGetType (const DynI **pself=0) const |
DynObjLib (const char *lib, bool do_call_init, DynI *pdi_init=NULL, int mod_flags=0, int so_load_flags=-1) | |
virtual int docall | GetState () |
virtual const char *docall | GetLibName () |
virtual const char *docall | GetLibFileName () |
virtual DynObj *docall | Create (const char *type, int type_id, const DynI *pdi_init=NULL) |
virtual bool docall | Destroy (VObj *pvo) |
virtual void docall | OnObjectCreate (DynObj *pdo, DynObjType *pdt) |
virtual void docall | OnObjectDestroy (DynObj *pdo, DynObjType *pdt) |
virtual bool docall | MayUnload () |
bool | ExitDynLib (bool is_query) |
bool | EnableObjectTracking (bool enable) |
bool | IsOk () |
const char * | GetCallStr () |
const int | GetPlatform () |
const int | GetDoTraits () |
void * | FindSymbol (const char *symb_name) |
void * | GetBase () |
int | Implements (const char *type) |
int | Implements (int type_id) |
const char * | GetCallConv () |
bool | operator== (const char *name) |
DynI * | InitDynLib (DynI *pdi_init) |
DynI * | GetInitDynLibRetVal () |
Static Public Member Functions | |
static bool | AddLibPath (const char *path) |
Protected Member Functions | |
void | Ctor (const char *lib, bool do_call_init, DynI *pdi_init) |
bool | InitFromModuleData (doModuleData *impl) |
Static Protected Member Functions | |
static void | TrimLibName (CharBuf &name) |
static DynLib * | LoadDynLib (const char *lib, int so_load_flags=-1, DynObjLib *plib=NULL) |
Protected Attributes | |
DortInternalI * | m_pdorti |
DynLib * | m_pdlib |
CharBuf | m_name |
int | m_state |
int | m_lib_flags |
CreateDynObjFn | m_pcfn |
InitDynLibFn | m_pidlfn |
ExitDynLibFn | m_pedlfn |
DestroyDynObjFn | m_pdofn |
doModuleData * | m_pdol_impl |
DynObjPtr< DynI > | m_idl_ret_val |
const char * | m_instantiates |
const char * | m_callstr |
int | m_platform |
int | m_do_traits |
CharBuf | m_last_err |
bool | m_ot_has_unregistered |
bool | m_ot_enable |
HashTable< DynObj *, void > | m_objs |
Friends | |
class | DoRunTimeC |
DynObjLib::DynObjLib | ( | const char * | lib, | |
bool | do_call_init, | |||
DynI * | pdi_init = NULL , |
|||
int | mod_flags = 0 , |
|||
int | so_load_flags = -1 | |||
) |
Constructor that takes library name/path as arg
lib | the non-suffixed name of library ( name without .so or .dll ). | |
do_call_init | Initialize the library (true by default) If false some more checks can be made on the library before initialized. |
virtual DynObjType* docall DynObjLib::doGetType | ( | const DynI ** | pself = 0 |
) | const [virtual] |
Returns type of this object. Each type that wants to make itself known should override this method. DynI knows its own type so we get the type without any lookup. It is faster and works without registration.
pself | allows fetching the actual 'this' used inside doGetType (from a side base, this will be different to the 'this' of the caller). |
Reimplemented from DynObjLibI.
virtual int docall DynObjLib::GetState | ( | ) | [inline, virtual] |
Returns library state
Implements DynObjLibI.
virtual const char* docall DynObjLib::GetLibName | ( | ) | [virtual] |
Returns error from library loader Get library name.
Implements DynObjLibI.
virtual const char* docall DynObjLib::GetLibFileName | ( | ) | [virtual] |
Get library file-name.
Implements DynObjLibI.
virtual DynObj* docall DynObjLib::Create | ( | const char * | type, | |
int | type_id, | |||
const DynI * | pdi_init = NULL | |||
) | [virtual] |
Create a DynObj from the library.
type | is the name of the string. | |
type_id | is the integer type ID of the type. | |
pdi_init | is the argument to the object constructor. | |
object_size | is currently not used, use 0. |
Implements DynObjLibI.
virtual bool docall DynObjLib::Destroy | ( | VObj * | pvo | ) | [virtual] |
Destroy a VObj or DynObj. If the object was created by this library it is destroyed.
pvo | is the object to destroy. |
Implements DynObjLibI.
virtual void docall DynObjLib::OnObjectCreate | ( | DynObj * | pdo, | |
DynObjType * | pdt | |||
) | [virtual] |
Used by DynObj.cpp when a DynOb jis destroyed. It's used for internal object tracking.
Implements DynObjLibI.
bool DynObjLib::ExitDynLib | ( | bool | is_query | ) |
Call to close and unload the library.
is_query | If set, it is like a signal to the library that shutdown is approaching. If clear, it is shutdown |
bool DynObjLib::EnableObjectTracking | ( | bool | enable | ) |
Turn on/off support for tracking object lifetime in this library.
bool DynObjLib::IsOk | ( | ) | [inline] |
Check that library has loaded OK.
const char* DynObjLib::GetCallStr | ( | ) | [inline] |
Read calling convention used by the library.
const int DynObjLib::GetPlatform | ( | ) | [inline] |
Read platform of source library.
const int DynObjLib::GetDoTraits | ( | ) | [inline] |
Read VTable properties from source compiler.
void* DynObjLib::FindSymbol | ( | const char * | symb_name | ) |
Loookup arbitrary symbol from the library.
void* DynObjLib::GetBase | ( | ) |
Get library base address.
int DynObjLib::Implements | ( | const char * | type | ) |
Query if library implements type specified by string. Can be called before the library is initialized.
type | type string |
int DynObjLib::Implements | ( | int | type_id | ) |
Query if library implements type specified by type ID. Can be called before the library is initialized.
type | type ID |
const char* DynObjLib::GetCallConv | ( | ) |
Read the function calling convention used by the library. It is best to use one of __cdecl or __stdcall. Can be called before the library is initialized.
static bool DynObjLib::AddLibPath | ( | const char * | path | ) | [static] |
Adds a directory to be searched when loading DynObjLib libraries.