Class CInterfacePtr#

Class Documentation#

class CInterfacePtr#

Interface access wrapper class.

Template Parameters:

IInterfaceAccess – Interface type to wrap

Public Functions

inline CInterfacePtr(IInterfaceAccess *pInterface = nullptr)#

Construct a new CInterfacePtr object.

Parameters:

pInterface[in] Pointer to the interface to wrap or nullptr when no interface is to be wrapped yet.

inline CInterfacePtr(const CInterfacePtr &rptrInterface)#

Copy construct a new CInterfacePtr object.

Parameters:

rptrInterface[in] Reference to the CInterfacePtr object to copy from.

inline CInterfacePtr(CInterfacePtr &&rptrInterface) noexcept#

Move construct a new CInterfacePtr object.

Parameters:

rptrInterface[in] Reference to the CInterfacePtr object to move from.

virtual ~CInterfacePtr() = default#

Default destructor.

inline CInterfacePtr &operator=(IInterfaceAccess *pInterface)#

Assignment operator.

Parameters:

pInterface[in] Pointer to the interface to wrap or nullptr to clear the wrapping.

Returns:

Returns *this

inline CInterfacePtr &operator=(const CInterfacePtr &rptrInterface)#

Assignment operator.

Parameters:

rptrInterface[in] Reference to the CInterfacePtr object to copy from.

Returns:

Returns *this

inline CInterfacePtr &operator=(CInterfacePtr &&rptrInterface) noexcept#

Move operator.

Parameters:

rptrInterface[in] Reference to the CInterfacePtr object to move from.

Returns:

Returns *this

inline operator IInterfaceAccess*()#

Get a pointer to the interface.

inline operator const IInterfaceAccess*() const#

Get a pointer to the interface.

inline operator bool() const#

Is there a valid interface?

Returns:

Returns ‘true’ when an interface is wrapped; ‘false’ otherwise.

inline bool IsValid() const#

Return whether there is a valid interface.

Returns:

Returns ‘true’ when an interface is wrapped; ‘false’ otherwise.

template<typename TIfc>
inline TIfc *GetInterface() const#

Gets an interface by using the IInterfaceAccess::GetInterface function.

Template Parameters:

TIfc – The interface type to request.

Returns:

Returns a pointer to the requested interface if the object has itregistered, nullptr otherwise

template<>
inline IInterfaceAccess *GetInterface() const#

Specialization for sdv::IInterfaceAccess interface.

Template Parameters:

TIfc – The interface type to request.

Returns:

Returns a pointer to the requested interface if the object has itregistered, nullptr otherwise