summaryrefslogtreecommitdiff
path: root/XMPCommon/Interfaces/BaseInterfaces/ISharedObject_I.h
blob: 94f6d951674890657352e99dcffc46c4a5121d99 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __ISharedObject_I_h__
#define __ISharedObject_I_h__ 1

// =================================================================================================
// Copyright Adobe
// Copyright 2014 Adobe
// All Rights Reserved
//
// NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the terms
// of the Adobe license agreement accompanying it. If you have received this file from a source other 
// than Adobe, then your use, modification, or distribution of it requires the prior written permission
// of Adobe.
// =================================================================================================

#include "XMPCommon/XMPCommonDefines_I.h"
#include "XMPCommon/XMPCommonFwdDeclarations_I.h"
#include "XMPCommon/Interfaces/BaseInterfaces/ISharedObject.h"

namespace AdobeXMPCommon_Int {

	//!
	//! Internal interface that serves as the base interface of all the internal interfaces inherited from
	//! externally exposed interfaces.
	//! This allows all interfaces to be returned as raw pointers through wrapper functions so that internal
	//! object is not deleted as soon as the internal smart pointer goes out of scope.
	//! \note Any class/interface which inherits from this class needs to provide implementation for
	//! AcquireInternal pure virtual function.
	//!
	class ISharedObject_I
		: public virtual ISharedObject
	{
	public:

		//!
		//! It indicates that the pointer owned by the internal smart pointer is required to extend beyond the life span
		//! of smart pointer. This is generally the case where we are returning raw pointer from an internal shared pointer.
		//! Called internally by the library to pass raw pointers across shared libraries from shared pointers.
		//!
		virtual void APICALL AcquireInternal() const __NOTHROW__ = 0;

		virtual pISharedObject_I APICALL GetISharedObject_I() __NOTHROW__ { return this; }

	protected:

	#ifdef FRIEND_CLASS_DECLARATION
		FRIEND_CLASS_DECLARATION();
	#endif
		REQ_FRIEND_CLASS_DECLARATION();
	};
}

#endif  // __ISharedObject_I_h__