#include <library.h>

Public Member Functions | |
| const std::string & | getClassName () const | 
| Returns name of class of our object.   | |
| const std::string & | getObjectName () const | 
| Returns name of our object.   | |
| void | getSpecificParameter (const std::string &ParameterName, void *ParameterValue) | 
| Method for obtaining some specific parameters, such as texture specific params, and so on.   | |
| LIBRARY_HANDLE | getSymbol (const std::string &SymbolName) const | 
| Get symbol from this library.   | |
| bool | isLoaded () const | 
| bool | isLocked () const | 
| returns state of object.   | |
| Library (const std::string &LibraryName) | |
| Default constructor.   | |
| void | load () | 
| Loads library.   | |
| void | unload () | 
| Unloads library.   | |
| ~Library () | |
Protected Member Functions | |
| void | addSpecificParameter (const std::string &ParameterName, void *ParameterValue, size_t Size) | 
| void | lock () | 
| void | unlock () | 
Private Member Functions | |
| std::string | libraryError () const | 
Private Attributes | |
| LIBRARY_HANDLE | mhInst | 
| bool | mIsLoaded | 
This class can only load and unload DLL, also can get symbols from this library.
Definition at line 78 of file library.h.
| gpucalc::Library::Library | ( | const std::string & | LibraryName | ) |  [inline] | 
        
| gpucalc::Library::~Library | ( | ) |  [inline] | 
        
| void gpucalc::Object::addSpecificParameter | ( | const std::string & | ParameterName, | |
| void * | ParameterValue, | |||
| size_t | Size | |||
| ) |  [inline, protected, inherited] | 
        
Definition at line 254 of file object.h.
00255 { 00256 SpecificParametersMap::iterator i = mSpecificParameters.find(ParameterName); 00257 if (i != mSpecificParameters.end()) 00258 { 00259 mSpecificParameters.erase(i); 00260 } 00261 mSpecificParameters[ParameterName] = Any(ParameterValue, Size); 00262 }
| const std::string& gpucalc::Object::getClassName | ( | ) |  const [inline, inherited] | 
        
Returns name of class of our object.
Definition at line 92 of file object.h.
00093 { 00094 return mClassName; 00095 }
| const std::string& gpucalc::Object::getObjectName | ( | ) |  const [inline, inherited] | 
        
Returns name of our object.
Definition at line 101 of file object.h.
00102 { 00103 return mObjectName; 00104 }
| void gpucalc::Object::getSpecificParameter | ( | const std::string & | ParameterName, | |
| void * | ParameterValue | |||
| ) |  [inline, inherited] | 
        
Method for obtaining some specific parameters, such as texture specific params, and so on.
| ParameterName | - name of parameter, usually it similar to specific method of some object (for example, GLTextureID) | |
| ParameterValue | - contain value of named parameter, it must be allocated and have sufficient size. | 
Definition at line 128 of file object.h.
00129 { 00130 SpecificParametersMap::iterator i = mSpecificParameters.find(ParameterName); 00131 if (i != mSpecificParameters.end()) 00132 { 00133 i->second.copyValue(ParameterValue); 00134 } 00135 else 00136 { 00137 Except<ERR_ITEM_NOT_FOUND>(this, "Parameter \"" + ParameterName + "\" does not exists.", "Object::getSpecificParameter()", __FILE__, __LINE__); 00138 } 00139 }
| LIBRARY_HANDLE gpucalc::Library::getSymbol | ( | const std::string & | SymbolName | ) | const | 
Get symbol from this library.
| SymbolName | - name of returned symbol in Library. | 
Definition at line 88 of file library.cpp.
00089 { 00090 LogManager::getSingleton().logMessage(this, "Exporting symbol \"" + SymbolName + "\"...", LML_Trivial); 00091 return (LIBRARY_HANDLE)LIBRARY_GETSYM(mhInst, SymbolName.c_str()); 00092 }
| bool gpucalc::Library::isLoaded | ( | ) |  const [inline] | 
        
| bool gpucalc::Object::isLocked | ( | ) |  const [inline, inherited] | 
        
| std::string gpucalc::Library::libraryError | ( | ) |  const [private] | 
        
Definition at line 95 of file library.cpp.
00096 { 00097 #if PLATFORM == PLATFORM_WIN32 00098 LPVOID lpMsgBuf; 00099 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 00100 0, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, 0); 00101 std::string ret = (char*)lpMsgBuf; 00102 // Free the buffer. 00103 LocalFree( lpMsgBuf ); 00104 return ret; 00105 #elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX 00106 return std::string(dlerror()); 00107 #elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE 00108 return std::string(mac_errorBundle()); 00109 #else 00110 return std::string(""); 00111 #endif 00112 }
| void gpucalc::Library::load | ( | ) | 
Loads library.
Path to this library sets in constructor Library::Library()
Definition at line 57 of file library.cpp.
00058 { 00059 std::string name = this->getObjectName(); 00060 # if PLATFORM == PLATFORM_LINUX 00061 if (name.substr(name.length() - 3, 3) != ".so") 00062 name += ".so"; 00063 # endif 00064 00065 mhInst = (LIBRARY_HANDLE)LIBRARY_LOAD(name.c_str()); 00066 if (!mhInst) 00067 { 00068 Except<ERR_INTERNAL_ERROR>(this, "Could not load dynamic library \"" + name + "\". System Error: " + libraryError(), 00069 "DynLib::load", __FILE__, __LINE__); 00070 } 00071 00072 LogManager::getSingleton().logMessage(this, "Library loaded.", LML_Trivial); 00073 mIsLoaded = true; 00074 }
| void gpucalc::Object::lock | ( | ) |  [inline, protected, inherited] | 
        
| void gpucalc::Library::unload | ( | ) | 
Unloads library.
Path to this library sets in constructor Library::Library()
Definition at line 77 of file library.cpp.
00078 { 00079 if (LIBRARY_UNLOAD(mhInst)) 00080 { 00081 Except<ERR_INTERNAL_ERROR>(this, "Could not unload dynamic library \"" + this->getObjectName() + "\". System Error: " + libraryError(), 00082 "DynLib::unload", __FILE__, __LINE__); 00083 } 00084 LogManager::getSingleton().logMessage(this, "Library unloaded.", LML_Trivial); 00085 mIsLoaded = false; 00086 }
| void gpucalc::Object::unlock | ( | ) |  [inline, protected, inherited] | 
        
LIBRARY_HANDLE gpucalc::Library::mhInst [private]           | 
        
bool gpucalc::Library::mIsLoaded [private]           | 
        
 1.5.6