ReactOS 0.4.15-dev-7711-g5627da4
ATL::IConnectionPointImpl< T, piid, CDV > Class Template Reference

#include <atlcom.h>

Inheritance diagram for ATL::IConnectionPointImpl< T, piid, CDV >:
Collaboration diagram for ATL::IConnectionPointImpl< T, piid, CDV >:

Public Member Functions

 ~IConnectionPointImpl ()
 
STDMETHOD() _LocCPQueryInterface (REFIID riid, void **ppvObject)
 
STDMETHOD() GetConnectionInterface (IID *piid2)
 
STDMETHOD() GetConnectionPointContainer (IConnectionPointContainer **ppCPC)
 
STDMETHOD() Advise (IUnknown *pUnkSink, DWORD *pdwCookie)
 
STDMETHOD() Unadvise (DWORD dwCookie)
 
STDMETHOD() EnumConnections (IEnumConnections **ppEnum)
 
- Public Member Functions inherited from ATL::_ICPLocator< piid >
STDMETHOD() _LocCPQueryInterface (REFIID riid, void **ppvObject)=0
 
virtual ULONG STDMETHODCALLTYPE AddRef ()=0
 
virtual ULONG STDMETHODCALLTYPE Release ()=0
 

Public Attributes

CDV m_vec
 

Private Types

typedef CComEnum< IEnumConnections, &IID_IEnumConnections, CONNECTDATA, _Copy< CONNECTDATA > > CComEnumConnections
 

Detailed Description

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
class ATL::IConnectionPointImpl< T, piid, CDV >

Definition at line 1250 of file atlcom.h.

Member Typedef Documentation

◆ CComEnumConnections

template<class T , const IID * piid, class CDV = CComDynamicUnkArray>
typedef CComEnum<IEnumConnections, &IID_IEnumConnections, CONNECTDATA, _Copy<CONNECTDATA> > ATL::IConnectionPointImpl< T, piid, CDV >::CComEnumConnections
private

Definition at line 1252 of file atlcom.h.

Constructor & Destructor Documentation

◆ ~IConnectionPointImpl()

template<class T , const IID * piid, class CDV = CComDynamicUnkArray>
ATL::IConnectionPointImpl< T, piid, CDV >::~IConnectionPointImpl ( )
inline

Definition at line 1256 of file atlcom.h.

1257 {
1258 IUnknown **x;
1259
1260 for (x = m_vec.begin(); x < m_vec.end(); x++)
1261 if (*x != NULL)
1262 (*x)->Release();
1263 }
#define NULL
Definition: types.h:112
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

Member Function Documentation

◆ _LocCPQueryInterface()

template<class T , const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::_LocCPQueryInterface ( REFIID  riid,
void **  ppvObject 
)
inlinevirtual

Implements ATL::_ICPLocator< piid >.

Definition at line 1265 of file atlcom.h.

1266 {
1267 IConnectionPointImpl<T, piid, CDV> *pThis;
1268
1269 pThis = reinterpret_cast<IConnectionPointImpl<T, piid, CDV>*>(this);
1270
1272 if (ppvObject == NULL)
1273 return E_POINTER;
1274
1276 {
1277 *ppvObject = this;
1278 pThis->AddRef();
1279 return S_OK;
1280 }
1281 else
1282 {
1283 *ppvObject = NULL;
1284 return E_NOINTERFACE;
1285 }
1286 }
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
REFIID riid
Definition: atlbase.h:39
nsrefcnt AddRef()
#define S_OK
Definition: intsafe.h:52
BOOL WINAPI InlineIsEqualUnknown(REFGUID rguid1)
Definition: atlbase.h:374
const GUID IID_IConnectionPoint
#define InlineIsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:142
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_POINTER
Definition: winerror.h:2365

◆ Advise()

template<class T , const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::Advise ( IUnknown pUnkSink,
DWORD pdwCookie 
)
inline

Definition at line 1304 of file atlcom.h.

1305 {
1306 IUnknown *adviseTarget;
1307 IID interfaceID;
1308 HRESULT hResult;
1309
1310 if (pdwCookie != NULL)
1311 *pdwCookie = 0;
1312 if (pUnkSink == NULL || pdwCookie == NULL)
1313 return E_POINTER;
1314 GetConnectionInterface(&interfaceID); // can't fail
1315 hResult = pUnkSink->QueryInterface(interfaceID, reinterpret_cast<void **>(&adviseTarget));
1316 if (SUCCEEDED(hResult))
1317 {
1318 *pdwCookie = m_vec.Add(adviseTarget);
1319 if (*pdwCookie != 0)
1320 hResult = S_OK;
1321 else
1322 {
1323 adviseTarget->Release();
1324 hResult = CONNECT_E_ADVISELIMIT;
1325 }
1326 }
1327 else if (hResult == E_NOINTERFACE)
1328 hResult = CONNECT_E_CANNOTCONNECT;
1329 return hResult;
1330 }
STDMETHOD() GetConnectionInterface(IID *piid2)
Definition: atlcom.h:1288
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define CONNECT_E_CANNOTCONNECT
Definition: olectl.h:253
#define CONNECT_E_ADVISELIMIT
Definition: olectl.h:252

◆ EnumConnections()

template<class T , const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::EnumConnections ( IEnumConnections **  ppEnum)
inline

Definition at line 1349 of file atlcom.h.

1350 {
1351 CComObject<CComEnumConnections> *newEnumerator;
1352 CONNECTDATA *itemBuffer;
1353 CONNECTDATA *itemBufferEnd;
1354 IUnknown **x;
1355 HRESULT hResult;
1356
1357 ATLASSERT(ppEnum != NULL);
1358 if (ppEnum == NULL)
1359 return E_POINTER;
1360 *ppEnum = NULL;
1361
1362 ATLTRY(itemBuffer = new CONNECTDATA[m_vec.end() - m_vec.begin()])
1363 if (itemBuffer == NULL)
1365 itemBufferEnd = itemBuffer;
1366 for (x = m_vec.begin(); x < m_vec.end(); x++)
1367 {
1368 if (*x != NULL)
1369 {
1370 (*x)->AddRef();
1371 itemBufferEnd->pUnk = *x;
1372 itemBufferEnd->dwCookie = m_vec.GetCookie(x);
1373 itemBufferEnd++;
1374 }
1375 }
1376 ATLTRY(newEnumerator = new CComObject<CComEnumConnections>)
1377 if (newEnumerator == NULL)
1378 return E_OUTOFMEMORY;
1379 newEnumerator->Init(itemBuffer, itemBufferEnd, NULL, AtlFlagTakeOwnership); // can't fail
1380 hResult = newEnumerator->_InternalQueryInterface(IID_IEnumConnections, (void **)ppEnum);
1381 if (FAILED(hResult))
1382 delete newEnumerator;
1383 return hResult;
1384 }
#define ATLTRY(x)
Definition: atlcomcli.h:44
return
Definition: dirsup.c:529
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
GLuint GLuint end
Definition: gl.h:1545
#define FAILED(hr)
Definition: intsafe.h:51
if(dx< 0)
Definition: linetemp.h:194
#define for
Definition: utility.h:88
@ AtlFlagTakeOwnership
Definition: atlcom.h:908
const GUID IID_IEnumConnections
static clock_t begin
Definition: xmllint.c:458

◆ GetConnectionInterface()

template<class T , const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::GetConnectionInterface ( IID piid2)
inline

Definition at line 1288 of file atlcom.h.

1289 {
1290 if (piid2 == NULL)
1291 return E_POINTER;
1292 *piid2 = *piid;
1293 return S_OK;
1294 }

Referenced by ATL::IConnectionPointImpl< T, piid, CDV >::Advise().

◆ GetConnectionPointContainer()

template<class T , const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::GetConnectionPointContainer ( IConnectionPointContainer **  ppCPC)
inline

Definition at line 1296 of file atlcom.h.

1297 {
1298 T *pThis;
1299
1300 pThis = static_cast<T *>(this);
1301 return pThis->QueryInterface(IID_IConnectionPointContainer, reinterpret_cast<void **>(ppCPC));
1302 }
#define T
Definition: mbstring.h:31
const GUID IID_IConnectionPointContainer

◆ Unadvise()

template<class T , const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::Unadvise ( DWORD  dwCookie)
inline

Definition at line 1332 of file atlcom.h.

1333 {
1334 IUnknown *adviseTarget;
1335 HRESULT hResult;
1336
1337 adviseTarget = m_vec.GetUnknown(dwCookie);
1338 if (m_vec.Remove(dwCookie))
1339 {
1340 if (adviseTarget != NULL)
1341 adviseTarget->Release();
1342 hResult = S_OK;
1343 }
1344 else
1345 hResult = CONNECT_E_NOCONNECTION;
1346 return hResult;
1347 }
#define CONNECT_E_NOCONNECTION
Definition: olectl.h:251

Member Data Documentation

◆ m_vec


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