aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/windows/msofficecomm/WeakReference.h
blob: a00c5d78b89aa764b86602ab65f776597508c7b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
#ifndef _JMSOFFICECOMM_WEAKREFERENCE_H_
#define _JMSOFFICECOMM_WEAKREFERENCE_H_

#include "UnknownImpl.h"

class WeakReference
    : public UnknownImpl<IWeakReference, IID_IWeakReference>
{
public:
    WeakReference(LPUNKNOWN iUnknown) : _iUnknown(iUnknown) {}

    // IUnknown
    STDMETHODIMP QueryInterface(REFIID, PVOID *);

    // IWeakReference
    STDMETHODIMP Resolve(REFIID, PVOID *);

    void invalidate() { _iUnknown = NULL; }

protected:
    virtual ~WeakReference() {}

private:
    LPUNKNOWN _iUnknown;
};

#endif /* #ifndef _JMSOFFICECOMM_WEAKREFERENCE_H_ */