| Home | Libraries | People | FAQ | More

## 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;

      // 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...);
      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...);

      // 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();
      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;
      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 = unspecified>
        unspecified call(const std::string &);
      template<typename Tin, typename T2> unspecified operator->*(unspecified);
      template<class ... Args> unspecified import(const std::string &);
      template<typename ... Args>
        unspecified make_data(const smart_library &, Args ...);
    };

## Description

This class represents an imported class.

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

### `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);

3.     template<typename ... Args>
         imported_class(unspecified, const smart_library & lib, Args... args);

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

5.     template<typename ... Args>
         imported_class(unspecified, smart_library && lib, Args... args);

6.     template<typename ... Args>
         imported_class(unspecified, 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.     imported_class() = delete;

3.     imported_class(imported_class &) = delete;

4.     imported_class(imported_class &&) = default;

   Move constructor.

5.     imported_class & operator=(imported_class &) = delete;

6.     imported_class & operator=(imported_class &&) = default;

   Move assignmend.

7.     bool is_move_constructible();

   Check if the imported class is move-constructible.

8.     bool is_move_assignable();

   Check if the imported class is move-assignable.

9.     bool is_copy_constructible();

   Check if the imported class is copy-constructible.

10.     bool is_copy_assignable();

    Check if the imported class is copy-assignable.

11.     imported_class< T > copy() const;

    Invoke the copy constructor.

    | Important
    Undefined behaviour if the imported object is not copy constructible.

12.     imported_class< T > move();

    Invoke the move constructor.

    | Important
    Undefined behaviour if the imported object is not move constructible.

13.     void copy_assign(const imported_class< T > & lhs) const;

    Invoke the copy assignment.

    | Important
    Undefined behaviour if the imported object is not copy assignable.

14.     void move_assign(imported_class< T > & lhs);

    Invoke the move assignment.

    | Important
    Undefined behaviour if the imported object is not move assignable.

15.     explicit operator bool() const;

    Check if the class is loaded.

16.     const std::type_info & get_type_info();

    Get a const reference to the std::type_info.

17.     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");

18.     template<typename Tin, typename Signature, typename = unspecified>
          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");

19.     template<typename Tin, typename T2> unspecified operator->*(unspecified mn);

    Overload of ->* for an imported method.

20.     template<class ... Args> unspecified import(const std::string & name);

    Import a method of the class.

21.     template<typename ... Args>
          unspecified make_data(const smart_library & lib, Args ... args);