pacemaker 1.0.1
COM automation for people with deadlines and a hatred of GUIs
 
Loading...
Searching...
No Matches
COMProxy< T > Class Template Reference

Non-copyable CRTP base class for COM dispatch proxy objects. More...

#include <COMProxy.hpp>

Inheritance diagram for COMProxy< T >:

Protected Member Functions

 COMProxy (pacemaker::inca::detail::unique_com_ptr< T > subject) noexcept
 Constructs the proxy, taking ownership of subject.
 
 COMProxy (COMProxy &&)=default
 Move constructor transfers ownership of the underlying COM pointer.
 
COMProxyoperator= (COMProxy &&)=default
 Move assignment transfers ownership of the underlying COM pointer.
 

Protected Attributes

pacemaker::inca::detail::unique_com_ptr< T > p_subject {nullptr}
 Owning pointer to the underlying COM dispatch object.
 

Detailed Description

template<class T>
class pacemaker::inca::detail::COMProxy< T >

Non-copyable CRTP base class for COM dispatch proxy objects.

COMProxy<T> stores a unique_com_ptr<T> and enforces move-only ownership semantics so that concrete proxy classes do not need to repeat this boilerplate.

Concrete proxy classes inherit privately from this base and gain access to the protected member p_subject through which they invoke the underlying COM methods.

Typical usage

class MyProxy : private pacemaker::inca::detail::COMProxy<MyDispatch_Dispatch>
{
public:
void DoSomething() { this->p_subject->DoSomething(); }
};
Non-copyable CRTP base class for COM dispatch proxy objects.
Definition COMProxy.hpp:35
pacemaker::inca::detail::unique_com_ptr< T > p_subject
Owning pointer to the underlying COM dispatch object.
Definition COMProxy.hpp:60
std::unique_ptr< T, ComObjDeleter< T > > unique_com_ptr
RAII owning pointer for COM objects.
Template Parameters
Tthe concrete COM dispatch type managed by this proxy.
See also
pacemaker::inca::detail::unique_com_ptr

Definition at line 34 of file COMProxy.hpp.

Constructor & Destructor Documentation

◆ COMProxy() [1/2]

template<class T >
COMProxy ( pacemaker::inca::detail::unique_com_ptr< T > subject)
inlineexplicitprotectednoexcept

Constructs the proxy, taking ownership of subject.

Parameters
subjectOwning pointer to the COM object. Moved into the internal p_subject member; the callers' pointer is left null after construction.

Definition at line 44 of file COMProxy.hpp.

◆ COMProxy() [2/2]

template<class T >
COMProxy ( COMProxy< T > && )
protecteddefault

Move constructor transfers ownership of the underlying COM pointer.

Member Function Documentation

◆ operator=()

template<class T >
COMProxy & operator= ( COMProxy< T > && )
protecteddefault

Move assignment transfers ownership of the underlying COM pointer.

Member Data Documentation

◆ p_subject

template<class T >
pacemaker::inca::detail::unique_com_ptr<T> p_subject {nullptr}
protected

Owning pointer to the underlying COM dispatch object.

Derived classes use this member to invoke methods on the wrapped COM interface. Its lifetime is tied to the proxy: the COM object is released when p_subject is destroyed.

Definition at line 60 of file COMProxy.hpp.


The documentation for this class was generated from the following file: