XMP Toolkit SDK  6.0.0
XMPCommonFwdDeclarations.h
Go to the documentation of this file.
1 #ifndef __XMPCommonFwdDeclarations_h__
2 #define __XMPCommonFwdDeclarations_h__ 1
3 
4 // =================================================================================================
5 // Copyright Adobe
6 // Copyright 2014 Adobe
7 // All Rights Reserved
8 //
9 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
10 // of the Adobe license agreement accompanying it. If you have received this file from a source other
11 // than Adobe, then your use, modification, or distribution of it requires the prior written permission
12 // of Adobe.
13 // =================================================================================================
14 
17 #include <vector>
18 
19 #if SUPPORT_SHARED_POINTERS_IN_STD
20  #include <memory>
21  #include <functional>
22 #elif SUPPORT_SHARED_POINTERS_IN_TR1
23  #if XMP_WinBuild
24  #include <memory>
25  #else
26  #include <tr1/memory>
27  #include <tr1/functional>
28  #endif
29 #else
30  #error "location of shared pointer stuff is unknown"
31 #endif
32 
33 namespace AdobeXMPCommon {
34 
35  #if SUPPORT_SHARED_POINTERS_IN_STD
36  using std::shared_ptr;
37  using std::enable_shared_from_this;
38  using std::mem_fn;
39  #elif SUPPORT_SHARED_POINTERS_IN_TR1
40  using std::tr1::shared_ptr;
41  using std::tr1::enable_shared_from_this;
42  using std::tr1::mem_fn;
43  #endif
44 
45  // void
46  typedef void * pvoid;
47  typedef const void * pcvoid;
48  typedef shared_ptr< void > spvoid;
49  typedef shared_ptr< const void * > spcvoid;
50 
51  // IObjectFactory
56  typedef BASE_CLASS( IObjectFactory, IOBJECTFACTORY_VERSION ) IObjectFactory;
57  typedef IObjectFactory * pIObjectFactory;
58  typedef const IObjectFactory * pcIObjectFactory;
59 
60  // IError
61  class IError_v1;
62  typedef IError_v1 IError_base;
64  typedef const IError_v1 * pcIError_base;
65  typedef BASE_CLASS( IError, IERROR_VERSION ) IError;
66  typedef IError * pIError;
67  typedef const IError * pcIError;
68  typedef shared_ptr< IError > spIError;
69  typedef shared_ptr< const IError > spcIError;
70 
71  // IUTF8String
76  typedef BASE_CLASS( IUTF8String, IUTF8STRING_VERSION ) IUTF8String;
77  typedef IUTF8String * pIUTF8String;
78  typedef const IUTF8String * pcIUTF8String;
79  typedef shared_ptr< IUTF8String > spIUTF8String;
80  typedef shared_ptr< const IUTF8String > spcIUTF8String;
81 
82  // IMemoryAllocator
87  typedef BASE_CLASS( IMemoryAllocator, IMEMORYALLOCATOR_VERSION ) IMemoryAllocator;
88  typedef IMemoryAllocator * pIMemoryAllocator;
89  typedef const IMemoryAllocator * pcIMemoryAllocator;
90  typedef shared_ptr< IMemoryAllocator > spIMemoryAllocator;
91  typedef shared_ptr< const IMemoryAllocator > spcIMemoryAllocator;
92 
93  // IErrorNotifier
98  typedef BASE_CLASS( IErrorNotifier, IERRORNOTIFIER_VERSION ) IErrorNotifier;
99  typedef IErrorNotifier * pIErrorNotifier;
100  typedef const IErrorNotifier * pcIErrorNotifier;
101  typedef shared_ptr< IErrorNotifier > spIErrorNotifier;
102  typedef shared_ptr< const IErrorNotifier > spcIErrorNotifier;
103 
104  // IConfigurationManager
109  typedef BASE_CLASS( IConfigurationManager, ICONFIGURATIONMANAGER_VERSION ) IConfigurationManager;
110  typedef IConfigurationManager * pIConfigurationManager;
111  typedef const IConfigurationManager * pcIConfigurationManager;
112  typedef shared_ptr< IConfigurationManager > spIConfigurationManager;
113  typedef shared_ptr< const IConfigurationManager > spcIConfigurationManager;
114 
115  // IConfigurable
117  typedef IConfigurable * pIConfigurable;
119 
120  // typedefs for vectors and their corresponding shared pointers.
121  typedef std::vector< spIUTF8String > IUTF8Strings;
122  typedef std::vector< spcIUTF8String > cIUTF8Strings;
123  typedef shared_ptr< IUTF8Strings > spIUTF8Strings;
124  typedef shared_ptr< cIUTF8Strings > spcIUTF8Strings;
125  typedef shared_ptr< const IUTF8Strings > spIUTF8Strings_const;
126  typedef shared_ptr< const cIUTF8Strings > spcIUTF8Strings_const;
127 
134  typedef void * ( *MemAllocateProc )( sizet size );
135  void * MemAllocate( sizet size ) __NOTHROW__;
136 
141  typedef void( *MemReleaseProc )( void * ptr );
142  void MemRelease( void * ptr ) __NOTHROW__;
143 
144 } // namespace AdobeXMPCommon
145 
147 
148  // ISharedObject_I
149  class ISharedObject_I;
150  typedef ISharedObject_I * pISharedObject_I;
151  typedef const ISharedObject_I * pcISharedObject_I;
152 
153  // IThreadSafe_I
154  class IThreadSafe_I;
155  typedef IThreadSafe_I * pIThreadSafe_I;
156  typedef const IThreadSafe_I * pcIThreadSafe_I;
157 
158 }
159 
160 #endif // __XMPCommonFwdDeclarations_h__
AdobeXMPCommon::spcIUTF8Strings_const
shared_ptr< const cIUTF8Strings > spcIUTF8Strings_const
Definition: XMPCommonFwdDeclarations.h:126
XMPCommonLatestInterfaceVersions.h
AdobeXMPCommon::IMemoryAllocator_v1
Version1 of the interface that represents an interface to be implemented by client in case he is inte...
Definition: IMemoryAllocator.h:29
AdobeXMPCommon::pIMemoryAllocator_base
IMemoryAllocator_v1 * pIMemoryAllocator_base
Definition: XMPCommonFwdDeclarations.h:85
AdobeXMPCommon::spIError
shared_ptr< IError > spIError
Definition: XMPCommonFwdDeclarations.h:68
AdobeXMPCommon_Int::pISharedObject_I
ISharedObject_I * pISharedObject_I
Definition: XMPCommonFwdDeclarations.h:149
AdobeXMPCommon::spvoid
shared_ptr< void > spvoid
Definition: XMPCommonFwdDeclarations.h:48
AdobeXMPCommon::pcIMemoryAllocator_base
const typedef IMemoryAllocator_v1 * pcIMemoryAllocator_base
Definition: XMPCommonFwdDeclarations.h:86
AdobeXMPCommon::pIConfigurationManager_base
IConfigurationManager_v1 * pIConfigurationManager_base
Definition: XMPCommonFwdDeclarations.h:107
AdobeXMPCommon::pcvoid
const typedef void * pcvoid
Definition: XMPCommonFwdDeclarations.h:47
AdobeXMPCommon::IConfigurationManager_base
IConfigurationManager_v1 IConfigurationManager_base
Definition: XMPCommonFwdDeclarations.h:105
AdobeXMPCommon::pcIErrorNotifier_base
const typedef IErrorNotifier_v1 * pcIErrorNotifier_base
Definition: XMPCommonFwdDeclarations.h:97
AdobeXMPCommon::IConfigurable
Interface that allows to attach various key-value parameters to the underlying object.
Definition: IConfigurable.h:32
AdobeXMPCommon::pIConfigurationManager
IConfigurationManager * pIConfigurationManager
Definition: XMPCommonFwdDeclarations.h:110
__NOTHROW__
#define __NOTHROW__
Definition: XMPCommonDefines.h:147
AdobeXMPCommon::spcvoid
shared_ptr< const void * > spcvoid
Definition: XMPCommonFwdDeclarations.h:49
AdobeXMPCommon::IError_v1
Version1 of the interface that represents an error/warning encountered during processing.
Definition: IError.h:28
AdobeXMPCommon::pIConfigurable
IConfigurable * pIConfigurable
Definition: XMPCommonFwdDeclarations.h:116
AdobeXMPCommon::pcIConfigurationManager
const typedef IConfigurationManager * pcIConfigurationManager
Definition: XMPCommonFwdDeclarations.h:111
AdobeXMPCommon_Int
Definition: XMPCommonFwdDeclarations.h:146
AdobeXMPCommon::MemReleaseProc
void(* MemReleaseProc)(void *ptr)
A function pointer to get the memory freed from the library.
Definition: XMPCommonFwdDeclarations.h:141
AdobeXMPCommon::pcIUTF8String_base
const typedef IUTF8String_v1 * pcIUTF8String_base
Definition: XMPCommonFwdDeclarations.h:75
AdobeXMPCommon::pIErrorNotifier
IErrorNotifier * pIErrorNotifier
Definition: XMPCommonFwdDeclarations.h:99
IUTF8STRING_VERSION
#define IUTF8STRING_VERSION
Definition: XMPCommonLatestInterfaceVersions.h:34
IMEMORYALLOCATOR_VERSION
#define IMEMORYALLOCATOR_VERSION
Definition: XMPCommonLatestInterfaceVersions.h:38
AdobeXMPCommon::pIUTF8String
IUTF8String * pIUTF8String
Definition: XMPCommonFwdDeclarations.h:77
AdobeXMPCommon::spcIUTF8Strings
shared_ptr< cIUTF8Strings > spcIUTF8Strings
Definition: XMPCommonFwdDeclarations.h:124
AdobeXMPCommon::pIObjectFactory
IObjectFactory * pIObjectFactory
Definition: XMPCommonFwdDeclarations.h:57
IERRORNOTIFIER_VERSION
#define IERRORNOTIFIER_VERSION
Definition: XMPCommonLatestInterfaceVersions.h:42
AdobeXMPCommon::spIMemoryAllocator
shared_ptr< IMemoryAllocator > spIMemoryAllocator
Definition: XMPCommonFwdDeclarations.h:90
AdobeXMPCommon::spcIConfigurationManager
shared_ptr< const IConfigurationManager > spcIConfigurationManager
Definition: XMPCommonFwdDeclarations.h:113
AdobeXMPCommon::IObjectFactory_v1
Version1 of a interface that represents a factory to create various artifacts defined within AdobeXMP...
Definition: IObjectFactory.h:27
AdobeXMPCommon::IMemoryAllocator_base
IMemoryAllocator_v1 IMemoryAllocator_base
Definition: XMPCommonFwdDeclarations.h:83
AdobeXMPCommon::pcIConfigurable
const typedef IConfigurable * pcIConfigurable
Definition: XMPCommonFwdDeclarations.h:118
AdobeXMPCommon
Definition: IConfigurable.h:21
AdobeXMPCommon::spcIUTF8String
shared_ptr< const IUTF8String > spcIUTF8String
Definition: XMPCommonFwdDeclarations.h:80
AdobeXMPCommon::IObjectFactory_base
IObjectFactory_v1 IObjectFactory_base
Definition: XMPCommonFwdDeclarations.h:52
AdobeXMPCommon::spIUTF8String
shared_ptr< IUTF8String > spIUTF8String
Definition: XMPCommonFwdDeclarations.h:79
AdobeXMPCommon::pcIObjectFactory
const typedef IObjectFactory * pcIObjectFactory
Definition: XMPCommonFwdDeclarations.h:58
AdobeXMPCommon::MemAllocate
void * MemAllocate(sizet size) __NOTHROW__
AdobeXMPCommon::pvoid
void * pvoid
Definition: XMPCommonFwdDeclarations.h:46
IERROR_VERSION
#define IERROR_VERSION
Definition: XMPCommonLatestInterfaceVersions.h:30
AdobeXMPCommon::pcIErrorNotifier
const typedef IErrorNotifier * pcIErrorNotifier
Definition: XMPCommonFwdDeclarations.h:100
AdobeXMPCommon::spcIError
shared_ptr< const IError > spcIError
Definition: XMPCommonFwdDeclarations.h:69
AdobeXMPCommon::MemRelease
void MemRelease(void *ptr) __NOTHROW__
AdobeXMPCommon::spcIErrorNotifier
shared_ptr< const IErrorNotifier > spcIErrorNotifier
Definition: XMPCommonFwdDeclarations.h:102
XMPCommonDefines.h
AdobeXMPCommon::sizet
uint32 sizet
Definition: XMPCommonDefines.h:176
AdobeXMPCommon::pcIMemoryAllocator
const typedef IMemoryAllocator * pcIMemoryAllocator
Definition: XMPCommonFwdDeclarations.h:89
AdobeXMPCommon::cIUTF8Strings
std::vector< spcIUTF8String > cIUTF8Strings
Definition: XMPCommonFwdDeclarations.h:122
AdobeXMPCommon::pcIConfigurationManager_base
const typedef IConfigurationManager_v1 * pcIConfigurationManager_base
Definition: XMPCommonFwdDeclarations.h:108
AdobeXMPCommon::IErrorNotifier_base
IErrorNotifier_v1 IErrorNotifier_base
Definition: XMPCommonFwdDeclarations.h:94
AdobeXMPCommon::IError_base
IError_v1 IError_base
Definition: XMPCommonFwdDeclarations.h:61
AdobeXMPCommon::BASE_CLASS
typedef BASE_CLASS(IObjectFactory, IOBJECTFACTORY_VERSION) IObjectFactory
AdobeXMPCommon::spIConfigurationManager
shared_ptr< IConfigurationManager > spIConfigurationManager
Definition: XMPCommonFwdDeclarations.h:112
AdobeXMPCommon::pIError_base
IError_v1 * pIError_base
Definition: XMPCommonFwdDeclarations.h:63
AdobeXMPCommon::IConfigurationManager_v1
Version1 of the interface that represents configuration settings controllable by the client.
Definition: IConfigurationManager.h:32
AdobeXMPCommon::pcIError
const typedef IError * pcIError
Definition: XMPCommonFwdDeclarations.h:67
AdobeXMPCommon::pIError
IError * pIError
Definition: XMPCommonFwdDeclarations.h:66
AdobeXMPCommon::pcIUTF8String
const typedef IUTF8String * pcIUTF8String
Definition: XMPCommonFwdDeclarations.h:78
AdobeXMPCommon_Int::pcISharedObject_I
const typedef ISharedObject_I * pcISharedObject_I
Definition: XMPCommonFwdDeclarations.h:151
AdobeXMPCommon::pcIObjectFactory_base
const typedef IObjectFactory_v1 * pcIObjectFactory_base
Definition: XMPCommonFwdDeclarations.h:55
AdobeXMPCommon::pIUTF8String_base
IUTF8String_v1 * pIUTF8String_base
Definition: XMPCommonFwdDeclarations.h:74
AdobeXMPCommon::IUTF8Strings
std::vector< spIUTF8String > IUTF8Strings
Definition: XMPCommonFwdDeclarations.h:121
AdobeXMPCommon::IUTF8String_v1
Version1 of the interface that represents an UTF8String.
Definition: IUTF8String.h:25
AdobeXMPCommon_Int::pcIThreadSafe_I
const typedef IThreadSafe_I * pcIThreadSafe_I
Definition: XMPCommonFwdDeclarations.h:156
AdobeXMPCommon::IErrorNotifier_v1
Version1 of the interface that represents an interface to be implemented by client in case he is inte...
Definition: IErrorNotifier.h:29
AdobeXMPCommon::pIErrorNotifier_base
IErrorNotifier_v1 * pIErrorNotifier_base
Definition: XMPCommonFwdDeclarations.h:96
AdobeXMPCommon::spIErrorNotifier
shared_ptr< IErrorNotifier > spIErrorNotifier
Definition: XMPCommonFwdDeclarations.h:101
AdobeXMPCommon::pIMemoryAllocator
IMemoryAllocator * pIMemoryAllocator
Definition: XMPCommonFwdDeclarations.h:88
IOBJECTFACTORY_VERSION
#define IOBJECTFACTORY_VERSION
Macro to include a client file through with client can control the interface versions he wants to sti...
Definition: XMPCommonLatestInterfaceVersions.h:26
AdobeXMPCommon::IUTF8String_base
IUTF8String_v1 IUTF8String_base
Definition: XMPCommonFwdDeclarations.h:72
AdobeXMPCommon::spIUTF8Strings
shared_ptr< IUTF8Strings > spIUTF8Strings
Definition: XMPCommonFwdDeclarations.h:123
AdobeXMPCommon_Int::pIThreadSafe_I
IThreadSafe_I * pIThreadSafe_I
Definition: XMPCommonFwdDeclarations.h:154
AdobeXMPCommon::spIUTF8Strings_const
shared_ptr< const IUTF8Strings > spIUTF8Strings_const
Definition: XMPCommonFwdDeclarations.h:125
AdobeXMPCommon::pcIError_base
const typedef IError_v1 * pcIError_base
Definition: XMPCommonFwdDeclarations.h:64
AdobeXMPCommon::pIObjectFactory_base
IObjectFactory_v1 * pIObjectFactory_base
Definition: XMPCommonFwdDeclarations.h:54
ICONFIGURATIONMANAGER_VERSION
#define ICONFIGURATIONMANAGER_VERSION
Definition: XMPCommonLatestInterfaceVersions.h:46
AdobeXMPCommon::spcIMemoryAllocator
shared_ptr< const IMemoryAllocator > spcIMemoryAllocator
Definition: XMPCommonFwdDeclarations.h:91