struct ov::SoPtr

Overview

This class instantiate object using shared library. More…

#include <so_ptr.hpp>

template <class T>
struct SoPtr
{
    // fields

    std::shared_ptr<T> _ptr;
    std::shared_ptr<void> _so;

    // construction

    SoPtr();
    SoPtr(const std::shared_ptr<T>& ptr, const std::shared_ptr<void>& so);

    template <typename U>
    SoPtr(const SoPtr<U>& that);

    // methods

    T \* operator -> () const;
    operator bool () const;
};

Detailed Documentation

This class instantiate object using shared library.

Parameters:

T

An type of object SoPtr can hold

Fields

std::shared_ptr<T> _ptr

Gets a smart pointer to the custom object.

std::shared_ptr<void> _so

The shared object or dynamic loaded library.

Construction

SoPtr()

Default constructor.

SoPtr(const std::shared_ptr<T>& ptr, const std::shared_ptr<void>& so)

Constructs an object with existing shared object reference and loaded pointer.

Parameters:

ptr

pointer to the loaded object

so

Existing reference to library

template <typename U>
SoPtr(const SoPtr<U>& that)

The copy-like constructor, can create So Pointer that dereferenced into child type if T is derived of U.

Parameters:

that

copied SoPtr object

Methods

T \* operator -> () const

Standard pointer operator.

Returns:

underlined interface with disabled Release method