Fawkes API Fawkes Development Version

module_dl.h

00001 
00002 /***************************************************************************
00003  *  module_dl.h - representation of a module (i.e. shared object) using
00004  *                dl of glibc, applicable for Linux systems
00005  *
00006  *  Generated: Wed Aug 23 15:48:23 2006
00007  *  Copyright  2006  Tim Niemueller [www.niemueller.de]
00008  *
00009  ****************************************************************************/
00010 
00011 /*  This program is free software; you can redistribute it and/or modify
00012  *  it under the terms of the GNU General Public License as published by
00013  *  the Free Software Foundation; either version 2 of the License, or
00014  *  (at your option) any later version. A runtime exception applies to
00015  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00016  *
00017  *  This program is distributed in the hope that it will be useful,
00018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *  GNU Library General Public License for more details.
00021  *
00022  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00023  */
00024 
00025 #ifndef __UTILS_SYSTEM_DYNAMIC_MODULE_MODULE_DL_H_
00026 #define __UTILS_SYSTEM_DYNAMIC_MODULE_MODULE_DL_H_
00027 
00028 #include <utils/system/dynamic_module/module.h>
00029 #include <string>
00030 
00031 namespace fawkes {
00032 
00033 class ModuleDL : public Module {
00034  public:
00035 
00036   ModuleDL(std::string filename, Module::ModuleFlags flags = Module::MODULE_FLAGS_DEFAULT);
00037 
00038   virtual ~ModuleDL();
00039 
00040   virtual void    open();
00041   virtual bool    close();
00042 
00043   virtual void    ref();
00044   virtual void    unref();
00045   virtual bool    notref();
00046   virtual unsigned int get_ref_count();
00047 
00048 
00049   virtual bool    has_symbol(const char *symbol_name);
00050   virtual void *  get_symbol(const char *symbol_name);
00051 
00052   virtual bool    operator==(ModuleDL &cmod);
00053 
00054   virtual std::string get_filename();
00055   virtual std::string get_base_filename();
00056 
00057   static const char * get_file_extension();
00058 
00059  private:
00060   static const char *FILE_EXTENSION;
00061 
00062   void *       handle;
00063   std::string  filename;
00064   ModuleFlags  flags;
00065   bool         file_found;
00066   bool         is_resident;
00067   unsigned int ref_count;
00068 };
00069 
00070 } // end namespace fawkes
00071 
00072 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends