Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
coil::DynamicLib Class Reference

DynamicLib class. More...

#include <DynamicLib.h>

Public Member Functions

virtual int close (void)
 Unload of the Dynamic link library. More...
 
virtual int close (void)
 Unload of the Dynamic link library. More...
 
 DynamicLib (int close_handle_on_destruction=1)
 Constructor. More...
 
 DynamicLib (int close_handle_on_destruction=1)
 Constructor. More...
 
 DynamicLib (const char *dynlib_name, int open_mode=COIL_DEFAULT_DYNLIB_MODE, int close_handle_on_destruction=1)
 Constructor. More...
 
 DynamicLib (const char *dynlib_name, int open_mode=COIL_DEFAULT_DYNLIB_MODE, int close_handle_on_destruction=1)
 Constructor. More...
 
 DynamicLib (const DynamicLib &rhs)
 Copy Constructor. More...
 
 DynamicLib (const DynamicLib &rhs)
 Copy Constructor. More...
 
const char * error (void) const
 Return the explanation message about the error. More...
 
const char * error (void) const
 Return the explanation message about the error. More...
 
virtual int open (const char *dll_name, int open_mode=COIL_DEFAULT_DYNLIB_MODE, int close_handle_on_destruction=1)
 Load of the Dynamic link library. More...
 
virtual int open (const char *dll_name, int open_mode=COIL_DEFAULT_DYNLIB_MODE, int close_handle_on_destruction=1)
 Load of the Dynamic link library. More...
 
DynamicLiboperator= (const DynamicLib &rhs)
 Assignment operator. More...
 
DynamicLiboperator= (const DynamicLib &rhs)
 Assignment operator. More...
 
void * symbol (const char *symbol_name)
 Return an address of the memory where a symbol was loaded. More...
 
void * symbol (const char *symbol_name)
 Return an address of the memory where a symbol was loaded. More...
 
virtual ~DynamicLib ()
 Destructor. More...
 
virtual ~DynamicLib ()
 Destructor. More...
 

Static Public Member Functions

static int ForExternTest (void)
 Unit Test. More...
 
static int ForExternTest (void)
 Unit Test. More...
 

Private Attributes

int m_closeflag
 
int m_error
 
void * m_handle
 
HINSTANCE m_handle
 
int m_mode
 
std::string m_name
 

Detailed Description

DynamicLib class.

Definition at line 48 of file posix/coil/DynamicLib.h.

Constructor & Destructor Documentation

◆ DynamicLib() [1/6]

coil::DynamicLib::DynamicLib ( int  close_handle_on_destruction = 1)

Constructor.

Constructor

Parameters
close_handle_on_destructionClose flag.

Definition at line 30 of file posix/coil/DynamicLib.cpp.

◆ DynamicLib() [2/6]

coil::DynamicLib::DynamicLib ( const char *  dynlib_name,
int  open_mode = COIL_DEFAULT_DYNLIB_MODE,
int  close_handle_on_destruction = 1 
)

Constructor.

Constructor

Parameters
dynlib_nameDynamic link library name.
open_modeOpen mode.
close_handle_on_destructionClose flag.

Definition at line 42 of file posix/coil/DynamicLib.cpp.

◆ ~DynamicLib() [1/2]

coil::DynamicLib::~DynamicLib ( )
virtual

Destructor.

Destructor

Definition at line 61 of file posix/coil/DynamicLib.cpp.

◆ DynamicLib() [3/6]

coil::DynamicLib::DynamicLib ( const DynamicLib rhs)

Copy Constructor.

Copy Constructor

Parameters
rhsDynamic link library object of copy source.

Definition at line 73 of file posix/coil/DynamicLib.cpp.

◆ DynamicLib() [4/6]

coil::DynamicLib::DynamicLib ( int  close_handle_on_destruction = 1)

Constructor.

Constructor

Parameters
close_handle_on_destructionClose flag.

◆ DynamicLib() [5/6]

coil::DynamicLib::DynamicLib ( const char *  dynlib_name,
int  open_mode = COIL_DEFAULT_DYNLIB_MODE,
int  close_handle_on_destruction = 1 
)

Constructor.

Constructor

Parameters
dynlib_nameDynamic link library name.
open_modeOpen mode.
close_handle_on_destructionClose flag.

◆ ~DynamicLib() [2/2]

virtual coil::DynamicLib::~DynamicLib ( )
virtual

Destructor.

Destructor

◆ DynamicLib() [6/6]

coil::DynamicLib::DynamicLib ( const DynamicLib rhs)

Copy Constructor.

Copy Constructor

Parameters
rhsDynamic link library object of copy source.

Member Function Documentation

◆ close() [1/2]

int coil::DynamicLib::close ( void  )
virtual

Unload of the Dynamic link library.

Unload of the Dynamic link library.

Returns
0: successful, -1: failed

Definition at line 127 of file posix/coil/DynamicLib.cpp.

◆ close() [2/2]

virtual int coil::DynamicLib::close ( void  )
virtual

Unload of the Dynamic link library.

Unload of the Dynamic link library.

Returns
0: successful, -1: failed

◆ error() [1/2]

const char * coil::DynamicLib::error ( void  ) const

Return the explanation message about the error.

Return the explanation message about the error.

Returns
Error message.(NULL: not an error)

Definition at line 161 of file posix/coil/DynamicLib.cpp.

◆ error() [2/2]

const char* coil::DynamicLib::error ( void  ) const

Return the explanation message about the error.

Return the explanation message about the error.

Returns
Error message.(NULL: not an error)

◆ ForExternTest() [1/2]

static int coil::DynamicLib::ForExternTest ( void  )
inlinestatic

Unit Test.

Unit Test.

Returns
0xdeadbeef

Definition at line 280 of file posix/coil/DynamicLib.h.

◆ ForExternTest() [2/2]

static int coil::DynamicLib::ForExternTest ( void  )
inlinestatic

Unit Test.

Unit Test.

Returns
0xdeadbeef

Definition at line 291 of file win32/coil/DynamicLib.h.

◆ open() [1/2]

int coil::DynamicLib::open ( const char *  dll_name,
int  open_mode = COIL_DEFAULT_DYNLIB_MODE,
int  close_handle_on_destruction = 1 
)
virtual

Load of the Dynamic link library.

Load of the Dynamic link library.

Parameters
dll_nameDynamic link library name.
open_modeOpen mode.
close_handle_on_destructionClose flag.
Returns
0: successful, -1: failed

Definition at line 106 of file posix/coil/DynamicLib.cpp.

◆ open() [2/2]

virtual int coil::DynamicLib::open ( const char *  dll_name,
int  open_mode = COIL_DEFAULT_DYNLIB_MODE,
int  close_handle_on_destruction = 1 
)
virtual

Load of the Dynamic link library.

Load of the Dynamic link library.

Parameters
dll_nameDynamic link library name.
open_modeOpen mode.
close_handle_on_destructionClose flag.
Returns
0: successful, -1: failed

◆ operator=() [1/2]

DynamicLib & coil::DynamicLib::operator= ( const DynamicLib rhs)

Assignment operator.

Copy a Dynamic link library object.

Parameters
rhsDynamic link library object of assignment source.
Returns
Assignment result.

Definition at line 89 of file posix/coil/DynamicLib.cpp.

◆ operator=() [2/2]

DynamicLib& coil::DynamicLib::operator= ( const DynamicLib rhs)

Assignment operator.

Copy a Dynamic link library object.

Parameters
rhsDynamic link library object of assignment source.
Returns
Assignment result.

◆ symbol() [1/2]

void * coil::DynamicLib::symbol ( const char *  symbol_name)

Return an address of the memory where a symbol was loaded.

Return an address of the memory where a symbol was loaded.

Parameters
symbol_nameSymbol name.
Returns
Memory address.(NULL: failed)

Definition at line 148 of file posix/coil/DynamicLib.cpp.

◆ symbol() [2/2]

void* coil::DynamicLib::symbol ( const char *  symbol_name)

Return an address of the memory where a symbol was loaded.

Return an address of the memory where a symbol was loaded.

Parameters
symbol_nameSymbol name.
Returns
Memory address.(NULL: failed)

Member Data Documentation

◆ m_closeflag

int coil::DynamicLib::m_closeflag
private

Definition at line 285 of file posix/coil/DynamicLib.h.

◆ m_error

int coil::DynamicLib::m_error
private

Definition at line 287 of file posix/coil/DynamicLib.h.

◆ m_handle [1/2]

void* coil::DynamicLib::m_handle
private

Definition at line 286 of file posix/coil/DynamicLib.h.

◆ m_handle [2/2]

HINSTANCE coil::DynamicLib::m_handle
private

Definition at line 301 of file win32/coil/DynamicLib.h.

◆ m_mode

int coil::DynamicLib::m_mode
private

Definition at line 284 of file posix/coil/DynamicLib.h.

◆ m_name

std::string coil::DynamicLib::m_name
private

Definition at line 283 of file posix/coil/DynamicLib.h.


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


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Feb 28 2022 23:00:46