'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class dylib

odtone::dylib

Synopsis

// In header: </home/carlos/Projectos/odtone/inc/odtone/dylib.hpp>


class dylib {
public:
  // types
  typedef void * native_type;

  // construct/copy/destruct
  dylib();
  dylib(const_string_ref);

  // private static functions
  static void * open(const_string_ref);
  static void close(void *);

  // public member functions
  template<typename Signature> 
    boost::decay< Signature >::type get_symbol(const_string_ref) const;
  native_type native() const;
  operator undefined_bool() const;
};

Description

Dynamic library loading and access

dylib public construct/copy/destruct

  1. dylib();
  2. dylib(const_string_ref filepath);

    Loads a dynamic library onto the process memory

    Parameters:

    filepath

    Path to the library file

dylib private static functions

  1. static void * open(const_string_ref filepath);
  2. static void close(void * mod);

dylib public member functions

  1. template<typename Signature> 
      boost::decay< Signature >::type get_symbol(const_string_ref name) const;

    Looks up a function exported by the dynamic library

    Parameters:

    name

    Name of the symbol function to look up

    Returns:

    A pointer to the specified symbol or null if not found.

  2. native_type native() const;

    Returns the underlying plataform native dynamic library module

  3. operator undefined_bool() const;

    Check if it contains a loaded library

    Returns:

    true if a dynamic library is loaded


PrevUpHomeNext