Rsh API  SDK 2.1
Документация по программированию
 Указатель Классы Файлы Функции Переменные Определения типов Перечисления Элементы перечислений Друзья Макросы Страницы
RshDllClient.h
См. документацию.
1 
21 #ifndef RSH_DLL_CLIENT_H
22 #define RSH_DLL_CLIENT_H
23 
24 #include "RshDefChk.h"
25 #include "IRshFactory.h"
26 #include "RshDllInterfaceKey.h"
27 
28 #include <vector>
29 #include <string>
30 
31 #if defined(RSH_MSWINDOWS)
32  #include "REGKEY\RSH_RegistryPaths.ri"
33  #include <tchar.h>
34 #endif
35 
74 {
75 
76 public:
77 
99  {
136  };
137 
138 
139  RshDllClient();
140 
141  #if defined(RSH_LINUX)
142  RshDllClient(const char* path_Boards, const char* path_Libs);
143  #endif
144 
145  ~RshDllClient();
146 
199  static U32 GetRegisteredList(std::vector<std::string>& list, RshDllClient::LibraryType libType = libraryDriver);
200 
241  U32 Free();
242 
297  U32 GetLibraryInterface(IN OUT RshDllInterfaceKey& key, IN const std::string& interfaceName = std::string(""));
298 
349 
405 
406 private:
407  #if defined(RSH_MSWINDOWS)
408  struct IFDIC
409  {
410  HMODULE hLib; // Handle to opened dll
411  IRshFactory* factory; // Factory class
412  std::string libraryName; // Loaded interface name
413  };
414 
415  void* LoadByPath(const TCHAR* szPath, const char* szExportName);
416 
417  U32 LoadRegistered(const std::string& szRegistryBranchPath, const std::string& szModuleName,
418  const std::string& szExportName = std::string("StaticFactory"));
419 
420  U32 GetInterface(RshDllInterfaceKey& key, const std::string& registryBranch, const std::string& interfaceName);
421 
422  #elif defined(RSH_LINUX)
423  struct IFDIC
424  {
425  void* hLib; // Handle to opened dll
426  IRshFactory* factory; // Factory class
427  std::string libraryName; // Loaded interface name
428  };
429 
431  U32 LoadDriver(std::string libraryName, std::string fullLibraryPath, IFDIC** f);
432 
433  U32 GetInterface(std::string libraryName, std::string libraryInterfaceName, std::string libraryPath,
434  void** interface, void** factory = NULL, void* parameter = NULL);
435 
436  std::string path_RSHBoardLibs;
437  std::string path_RSHBaseLibs;
438  std::string path_RSHDPALibs;
439 
440  #endif
441 
442  std::vector<IFDIC*> m_libraries;
443 };
444 
445 
446 
447 #endif //RSH_DLL_CLIENT_H