OpendTect  6.6
sharedlibs.h
Go to the documentation of this file.
1 #pragma once
2 /*+
3 ________________________________________________________________________
4 
5  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
6  Author: A.H.Bril
7  Date: Jun 2006
8  RCS: $Id$
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "basicmod.h"
14 #include "bufstring.h"
15 #include "gendefs.h"
16 
17 #ifdef __win__
18 # include "windows.h"
19  typedef HMODULE Handletype;
20 #else
21  typedef void* Handletype;
22 #endif
23 
24 
31 {
32 public:
33 
34  SharedLibAccess(const char* file_name);
36  bool isOK() const { return handle_; }
37  const char* errMsg() const { return errmsg_.buf(); }
38 
39  void close();
40 
41  void* getFunction(const char* function_name) const;
43 
44  Handletype handle() { return handle_; }
45 
46  mDeprecated("Provide the size of the write buffer")
47  static void getLibName(const char* modnm,char*);
48 
49  static void getLibName(const char* modnm,char*,int sz);
51 
52 protected:
53 
54  Handletype handle_;
56 
57 };
58 
59 
68 {
69 public:
70  RuntimeLibLoader(const char* libfilenm);
71  RuntimeLibLoader(const char* libfilenm,
72  const char* subdir);
74 
75  bool isOK() const;
76 
77 private:
78 
79  SharedLibAccess* sha_ = nullptr;
80 
81 };
SharedLibAccess::close
void close()
RuntimeLibLoader::~RuntimeLibLoader
~RuntimeLibLoader()
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
RuntimeLibLoader::isOK
bool isOK() const
SharedLibAccess::SharedLibAccess
SharedLibAccess(const char *file_name)
handle is only closed if you do it explicitly.
bufstring.h
SharedLibAccess::getFunction
void * getFunction(const char *function_name) const
Difficult for C++ functions as the names are mangled.
mDeprecated
#define mDeprecated(msg)
Definition: plfdefs.h:215
gendefs.h
OD::String::buf
const char * buf() const
Definition: odstring.h:46
SharedLibAccess
Gives access to shared libs on runtime. Plugins should be loaded via the Plugin Manager (see plugins....
Definition: sharedlibs.h:31
RuntimeLibLoader
Gives access to any runtime library (DLL/so), from a full filepath. The library does thus no need to ...
Definition: sharedlibs.h:68
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
SharedLibAccess::handle
Handletype handle()
Definition: sharedlibs.h:44
MPE::errmsg_
BufferString errmsg_
Definition: horizontracker.h:118
RuntimeLibLoader::RuntimeLibLoader
RuntimeLibLoader(const char *libfilenm, const char *subdir)
Handletype
void * Handletype
Definition: sharedlibs.h:21
SharedLibAccess::isOK
bool isOK() const
Definition: sharedlibs.h:36
RuntimeLibLoader::RuntimeLibLoader
RuntimeLibLoader(const char *libfilenm)
SharedLibAccess::errMsg
const char * errMsg() const
Definition: sharedlibs.h:37

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2021