Shiokaze Framework
A research-oriented fluid solver for computer graphics
dylibloader.h
Go to the documentation of this file.
1 /*
2 ** dylibloader.h
3 **
4 ** This is part of Shiokaze, a research-oriented fluid solver for computer graphics.
5 ** Created by Ryoichi Ando <rand@nii.ac.jp> on June 20, 2017.
6 **
7 ** Permission is hereby granted, free of charge, to any person obtaining a copy of
8 ** this software and associated documentation files (the "Software"), to deal in
9 ** the Software without restriction, including without limitation the rights to use,
10 ** copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 ** Software, and to permit persons to whom the Software is furnished to do so,
12 ** subject to the following conditions:
13 **
14 ** The above copyright notice and this permission notice shall be included in all copies
15 ** or substantial portions of the Software.
16 **
17 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 ** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 ** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 ** HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21 ** CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22 ** OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24 //
25 #ifndef SHKZ_DYLIBLOADER_H
26 #define SHKZ_DYLIBLOADER_H
27 //
29 #include <string>
30 //
32 //
34 class dylibloader : public configurable {
37 public:
42  dylibloader();
47  virtual ~dylibloader();
54  bool open_library( std::string path );
59  void close_library();
66  const void *get_handle() const { return m_handle; }
73  void* load_symbol( std::string name ) const;
80  void load( configuration &config ) override;
87  void configure( configuration &config ) override;
94  void overwrite( configuration &config ) const;
95  //
96 private:
97  void *m_handle;
98  std::string m_path;
99 };
100 //
102 //
103 #endif
dylibloader::dylibloader
dylibloader()
Default constructor for dylibloader.
dylibloader::overwrite
void overwrite(configuration &config) const
Call the function symbol "overwrite", expecting that some configuration will be overwritten.
dylibloader::close_library
void close_library()
Unload dynamic library.
dylibloader::~dylibloader
virtual ~dylibloader()
Default destructor for dylibloader. close_library() will be also called if necessary.
dylibloader::configure
void configure(configuration &config) override
Call the function symbol "configure".
dylibloader::load
void load(configuration &config) override
Call the function symbol "load".
configurable
Class for managing the workflow of load - configure - initialize.
Definition: configurable.h:40
dylibloader::open_library
bool open_library(std::string path)
Load dynamic libraries.
SHKZ_BEGIN_NAMESPACE
#define SHKZ_BEGIN_NAMESPACE
Name space beggining definition for shiokaze.
Definition: common.h:39
dylibloader
Class that takes in charge of loading dynamic libraries.
Definition: dylibloader.h:36
configurable.h
configuration
Class that controls the settings of the program.
Definition: configuration.h:39
SHKZ_END_NAMESPACE
#define SHKZ_END_NAMESPACE
Name space end definition for shiokaze.
Definition: common.h:44
dylibloader::load_symbol
void * load_symbol(std::string name) const
Load function of global variable.
dylibloader::get_handle
const void * get_handle() const
Get the native pointer to the loaded dynamic library.
Definition: dylibloader.h:66