#include <mcllib/MCLibrary.h>
Inheritance diagram for MCLibrarySym:
Public Types | |
typedef void * | MCAnySym |
Generic type of a non-function symbol. | |
typedef void(* | MCFuncSym )() |
Generic type of a function symbol. | |
Public Member Functions | |
const MCString & | getName () const |
Get the name of the symbol. | |
bool | isFunction () const |
Test to see if the symbol refers to a function. | |
operator MCAnySym () const | |
Obtain the symbol as a pointer to a variable. | |
operator MCFuncSym () const | |
Obtain the symbol as a function pointer. | |
Friends | |
class | mclpriv::LibraryImpl |
Symbols maintain a reference to the library from which they were loaded so that the library does not get unloaded if symbols are still in use. For this to work, the MCLibrarySym objects must not go out of scope whilst the symbol reference they contain is still in use. Library symbols are obtained from a library (MCLibrary) using the find() member function.
|
Generic type of a non-function symbol. Cast to the appropriate type. |
|
Generic type of a function symbol. Cast to the appropriate type. |
|
Get the name of the symbol.
|
|
Test to see if the symbol refers to a function.
|
|
Obtain the symbol as a pointer to a variable. This must be recast to the appropriate type. The function will throw if the symbol does represent a function. The returned value is invalid once the MCLibrarySym has gone out of scope. Accessing the value after this point may cause the application to crash.
|
|
Obtain the symbol as a function pointer. This must be recast to the appropriate type. The function will throw if the symbol does not represent a function. The returned value is invalid once the MCLibrarySym has gone out of scope. Accessing the function after this point may cause the application to crash.
|