Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 25d613dfbc.
PrevUpHomeNext

Class template imported_class

boost::dll::experimental::imported_class

Synopsis

// In header: <boost/dll/import_class.hpp>

template<typename T> 
class imported_class {
public:
  // types
  typedef imported_class< T > base_t;

  // construct/copy/destruct
  template<typename ... Args> 
    imported_class(unspecified, const smart_library &, Args...);
  template<typename ... Args> 
    imported_class(unspecified, const smart_library &, std::size_t, Args...);
  template<typename ... Args> 
    imported_class(unspecified, smart_library &&, Args...);
  template<typename ... Args> 
    imported_class(unspecified, smart_library &&, std::size_t, Args...);
  imported_class() = delete;
  imported_class(imported_class &) = delete;
  imported_class(imported_class &&) = default;
  imported_class & operator=(imported_class &) = delete;
  imported_class & operator=(imported_class &&) = default;

  // private member functions
  template<typename ... Args> 
    unspecified make_data(const smart_library &, Args ...);
  template<typename ... Args> 
    unspecified make_data(const smart_library &, std::size_t, Args...);

  // public static functions
  template<typename ... Args> 
    static imported_class< T > make(smart_library &&, Args...);
  template<typename ... Args> 
    static imported_class< T > make(smart_library &&, std::size_t, Args...);
  template<typename ... Args> 
    static imported_class< T > make(const smart_library &, Args...);
  template<typename ... Args> 
    static imported_class< T > 
    make(const smart_library &, std::size_t, Args...);

  // public member functions
  T * get();
  bool is_move_constructible();
  bool is_move_assignable();
  bool is_copy_constructible();
  bool is_copy_assignable();
  imported_class< T > copy() const;
  imported_class< T > move();
  void copy_assign(const imported_class< T > &) const;
  void move_assign(imported_class< T > &);
  explicit operator bool() const;
  const std::type_info & get_type_info();
  template<typename Signature> unspecified call(const std::string &);
  template<typename Tin, typename Signature, 
           typename  = boost::enable_if<detail::unqalified_is_same<T, Tin>> > 
    unspecified call(const std::string &);
  template<typename Tin, typename T2> unspecified operator->*(unspecified);
  template<class ... Args> unspecified import(const std::string &);
};

Description

This class represents an imported class.

[Note] Note

It must be constructed via boost::dll::import_class(const smart_library& lib, std::size_t, Args...)

imported_class public construct/copy/destruct

  1. template<typename ... Args> 
      imported_class(unspecified, const smart_library & lib, Args... args);
  2. template<typename ... Args> 
      imported_class(unspecified, const smart_library & lib, std::size_t size, 
                     Args... args);
  3. template<typename ... Args> 
      imported_class(unspecified, smart_library && lib, Args... args);
  4. template<typename ... Args> 
      imported_class(unspecified, smart_library && lib, std::size_t size, 
                     Args... args);
  5. imported_class() = delete;
  6. imported_class(imported_class &) = delete;
  7. imported_class(imported_class &&) = default;
    Move constructor.
  8. imported_class & operator=(imported_class &) = delete;
  9. imported_class & operator=(imported_class &&) = default;
    Move assignmend.

imported_class private member functions

  1. template<typename ... Args> 
      unspecified make_data(const smart_library & lib, Args ... args);
  2. template<typename ... Args> 
      unspecified make_data(const smart_library & lib, std::size_t size, 
                            Args... args);

imported_class public static functions

  1. template<typename ... Args> 
      static imported_class< T > make(smart_library && lib, Args... args);
  2. template<typename ... Args> 
      static imported_class< T > 
      make(smart_library && lib, std::size_t size, Args... args);
  3. template<typename ... Args> 
      static imported_class< T > make(const smart_library & lib, Args... args);
  4. template<typename ... Args> 
      static imported_class< T > 
      make(const smart_library & lib, std::size_t size, Args... args);

imported_class public member functions

  1. T * get();
    Returns a pointer to the underlying class.
  2. bool is_move_constructible();
    Check if the imported class is move-constructible.
  3. bool is_move_assignable();
    Check if the imported class is move-assignable.
  4. bool is_copy_constructible();
    Check if the imported class is copy-constructible.
  5. bool is_copy_assignable();
    Check if the imported class is copy-assignable.
  6. imported_class< T > copy() const;
    Invoke the copy constructor.
    [Note] Note

    Undefined behaviour if the imported object is not copy constructible.

  7. imported_class< T > move();
    Invoke the move constructor.
    [Note] Note

    Undefined behaviour if the imported object is not move constructible.

  8. void copy_assign(const imported_class< T > & lhs) const;
    Invoke the copy assignment.
    [Note] Note

    Undefined behaviour if the imported object is not copy assignable.

  9. void move_assign(imported_class< T > & lhs);
    Invoke the move assignment.
    [Note] Note

    Undefined behaviour if the imported object is not move assignable.

  10. explicit operator bool() const;
    Check if the class is loaded.
  11. const std::type_info & get_type_info();
    Get a const reference to the std::type_info.
  12. template<typename Signature> unspecified call(const std::string & name);

    Call a member function. This returns a proxy to the function. The proxy mechanic mechanic is necessary, so the signaute can be passed.

    Example

    im_class.call<void(const char*)>("function_name")("MyString");
    

  13. template<typename Tin, typename Signature, 
             typename  = boost::enable_if<detail::unqalified_is_same<T, Tin>> > 
      unspecified call(const std::string & name);

    Call a qualified member function, i.e. const and or volatile.

    Example

    im_class.call<const type_alias, void(const char*)>("function_name")("MyString");
    

  14. template<typename Tin, typename T2> unspecified operator->*(unspecified mn);
    Overload of ->* for an imported method.
  15. template<class ... Args> unspecified import(const std::string & name);
    Import a method of the class.

PrevUpHomeNext