pacemaker 3.0.3
COM automation for people with deadlines and a hatred of GUIs
 
Loading...
Searching...
No Matches
COMProxy.hpp
Go to the documentation of this file.
1#ifndef PACEMAKER_INCA_DETAIL_COMPROXY_HPP_
2#define PACEMAKER_INCA_DETAIL_COMPROXY_HPP_
3
7
9{
56 template<class T>
58 {
59 public:
67 COMProxy() = default;
68
83 explicit COMProxy(::IDispatch *subject) : COMProxy{unique_com_ptr<::IDispatch>{subject}} {}
84
100 : unique_com_ptr<T>{
102 std::move(subject))} {}
103
105 COMProxy(COMProxy &&) = default;
108 };
109} // namespace pacemaker::inca::detail
110
111#endif // PACEMAKER_INCA_DETAIL_COMPROXY_HPP_
Owning smart-pointer base class for COM dispatch proxy objects.
Definition COMProxy.hpp:58
COMProxy(unique_com_ptr<::IDispatch > subject)
Constructs the proxy by narrowing an owning IDispatch pointer to T.
Definition COMProxy.hpp:99
COMProxy(COMProxy &&)=default
Move ctor; transfers ownership of the COM pointer.
COMProxy(::IDispatch *subject)
Constrcuts the proxy from a raw IDispatch*, taking ownership.
Definition COMProxy.hpp:83
COMProxy()=default
Default ctor; leaves the internal pointer null.
COMProxy & operator=(COMProxy &&)=default
Move assignment; transfers ownership of the COM pointer.
auto query_interface(pacemaker::inca::detail::unique_com_ptr<::IDispatch > src) -> pacemaker::inca::detail::unique_com_ptr< T >
Narrows a generic IDispatch pointer to a typed DispatchWrapper.
Definition utils.hpp:40
std::unique_ptr< T, ComObjDeleter< T > > unique_com_ptr
RAII owning pointer for COM objects.