| XMP Toolkit SDK 6.0.0

INodeIterator.h
Go to the documentation of this file.
1 #ifndef __INodeIterator_h__
2 #define __INodeIterator_h__ 1
3
4
5 // =================================================================================================
6 // Copyright Adobe
7 // Copyright 2014 Adobe
8 // All Rights Reserved
9 //
10 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
11 // of the Adobe license agreement accompanying it. If you have received this file from a source other
12 // than Adobe, then your use, modification, or distribution of it requires the prior written permission
13 // of Adobe.
14 // =================================================================================================
15
16 #include "XMPCore/XMPCoreFwdDeclarations.h"
17 #include "XMPCommon/Interfaces/BaseInterfaces/ISharedObject.h"
18 #include "XMPCore/Interfaces/INode.h"
19 #include "XMPCommon/Interfaces/BaseInterfaces/IVersionable.h"
20
21 namespace AdobeXMPCore {
22
28 class XMP_PUBLIC INodeIterator_v1
29 : public virtual ISharedObject
30 , public virtual IVersionable
31 {
32 public:
33
38 virtual INode_v1::eNodeType APICALL GetNodeType() const = 0;
39
46 virtual spINode APICALL GetNode() = 0;
47 XMP_PRIVATE spcINode APICALL GetNode() const {
48 return const_cast< INodeIterator * >( this )->GetNode();
49 };
51
60 XMP_PRIVATE spISimpleNode GetSimpleNode() {
61 auto node = GetNode();
62 if ( node ) return node->ConvertToSimpleNode();
63 return spISimpleNode();
64 }
65
66 XMP_PRIVATE spcISimpleNode GetSimpleNode() const {
67 return const_cast< INodeIterator * >( this )->GetSimpleNode();
68 }
70
78 XMP_PRIVATE spIStructureNode GetStructureNode() {
79 auto node = GetNode();
80 if ( node ) return node->ConvertToStructureNode();
81 return spIStructureNode();
82 }
83
84 XMP_PRIVATE spcIStructureNode GetStructureNode() const {
85 return const_cast< INodeIterator * >( this )->GetStructureNode();
86 }
88
96 XMP_PRIVATE spIArrayNode GetArrayNode() {
97 auto node = GetNode();
98 if ( node ) return node->ConvertToArrayNode();
99 return spIArrayNode();
100 }
101
102 XMP_PRIVATE spcIArrayNode GetArrayNode() const {
103 return const_cast< INodeIterator * >( this )->GetArrayNode();
104 }
106
113 virtual spINodeIterator APICALL Next() = 0;
114 XMP_PRIVATE spcINodeIterator APICALL Next() const {
115 return const_cast< INodeIterator * >( this )->Next();
116 }
118
119
122
128 virtual pINodeIterator APICALL GetActualINodeIterator() __NOTHROW__ = 0;
129 XMP_PRIVATE pcINodeIterator GetActualINodeIterator() const __NOTHROW__ {
130 return const_cast< INodeIterator * >( this )->GetActualINodeIterator();
131 }
134
140 virtual AdobeXMPCore_Int::pINodeIterator_I APICALL GetINodeIterator_I() __NOTHROW__ = 0;
141 XMP_PRIVATE AdobeXMPCore_Int::pcINodeIterator_I GetINodeIterator_I() const __NOTHROW__ {
142 return const_cast< INodeIterator * >( this )->GetINodeIterator_I();
143 }
146
152 XMP_PRIVATE static spINodeIterator MakeShared( pINodeIterator ptr );
153 XMP_PRIVATE static spcINodeIterator MakeShared( pcINodeIterator ptr ) {
154 return MakeShared( const_cast< pINodeIterator >( ptr ) );
155 }
158
161
166 XMP_PRIVATE static uint64 GetInterfaceID() { return kINodeIteratorID; }
167
172 XMP_PRIVATE static uint32 GetInterfaceVersion() { return 1; }
174
175 protected:
179 virtual ~INodeIterator_v1() __NOTHROW__ {}
180
182 virtual uint32 APICALL getNodeType( pcIError_base & error ) const __NOTHROW__ = 0;
183 virtual pINode_base APICALL getNode( pcIError_base & error ) __NOTHROW__ = 0;
184 virtual pINodeIterator_base APICALL next( pcIError_base & error ) __NOTHROW__ = 0;
185
186 #ifdef FRIEND_CLASS_DECLARATION
187 FRIEND_CLASS_DECLARATION();
188 #endif
189 REQ_FRIEND_CLASS_DECLARATION();
191
192 };
193 }
194
195 #endif // __INodeIterator_h__
AdobeXMPCore::INode_v1::eNodeType
eNodeType
Indicates various types of node available in XMP Data Model like simple, array and structure.
Definition: INode.h:38
AdobeXMPCore::INodeIterator_v1::Next
XMP_PRIVATE spcINodeIterator APICALL Next() const
Definition: INodeIterator.h:114
AdobeXMPCore_Int::pINodeIterator_I
INodeIterator_I * pINodeIterator_I
Definition: XMPCoreFwdDeclarations.h:276
AdobeXMPCore::INodeIterator_v1::GetArrayNode
XMP_PRIVATE spIArrayNode GetArrayNode()
Gets the iterator's currently pointed node as an array node, if possible.
Definition: INodeIterator.h:96
AdobeXMPCore::pcINodeIterator
const typedef INodeIterator * pcINodeIterator
Definition: XMPCoreFwdDeclarations.h:126
XMP_PRIVATE
#define XMP_PRIVATE
Definition: XMP_Environment.h:222
__NOTHROW__
#define __NOTHROW__
Definition: XMPCommonDefines.h:147
AdobeXMPCore::INode_v1
Version1 of the interface that serves as a base interface to all types of nodes in the XMP DOM.
Definition: INode.h:28
AdobeXMPCore::spcINodeIterator
shared_ptr< const INodeIterator > spcINodeIterator
Definition: XMPCoreFwdDeclarations.h:128
AdobeXMPCore::spIStructureNode
shared_ptr< IStructureNode > spIStructureNode
Definition: XMPCoreFwdDeclarations.h:103
XMP_PUBLIC
#define XMP_PUBLIC
Definition: XMP_Environment.h:221
AdobeXMPCore::spISimpleNode
shared_ptr< ISimpleNode > spISimpleNode
Definition: XMPCoreFwdDeclarations.h:79
AdobeXMPCore_Int::pcINodeIterator_I
const typedef INodeIterator_I * pcINodeIterator_I
Definition: XMPCoreFwdDeclarations.h:278
AdobeXMPCore::spINodeIterator
shared_ptr< INodeIterator > spINodeIterator
Definition: XMPCoreFwdDeclarations.h:127
ISharedObject.h
INode.h
AdobeXMPCore
Definition: IArrayNode.h:18
AdobeXMPCommon::uint32
XMP_Uns32 uint32
Definition: XMPCommonDefines.h:174
XMPCoreFwdDeclarations.h
AdobeXMPCore::INodeIterator_v1
Interface that represents an iterator over the mutable children of a XMP DOM Node.
Definition: INodeIterator.h:28
AdobeXMPCore::INodeIterator_v1::GetSimpleNode
XMP_PRIVATE spcISimpleNode GetSimpleNode() const
Definition: INodeIterator.h:66
AdobeXMPCore::INodeIterator_v1::GetStructureNode
XMP_PRIVATE spcIStructureNode GetStructureNode() const
Definition: INodeIterator.h:84
AdobeXMPCommon::IVersionable
Interface that serves as the base interface for all the externally exposed interfaces which needs to ...
Definition: IVersionable.h:30
AdobeXMPCore::spIArrayNode
shared_ptr< IArrayNode > spIArrayNode
Definition: XMPCoreFwdDeclarations.h:115
AdobeXMPCore::spcISimpleNode
shared_ptr< const ISimpleNode > spcISimpleNode
Definition: XMPCoreFwdDeclarations.h:80
REQ_FRIEND_CLASS_DECLARATION
#define REQ_FRIEND_CLASS_DECLARATION()
Definition: XMPCommonDefines.h:137
AdobeXMPCore::spINode
shared_ptr< INode > spINode
Definition: XMPCoreFwdDeclarations.h:67
AdobeXMPCore::spcIArrayNode
shared_ptr< const IArrayNode > spcIArrayNode
Definition: XMPCoreFwdDeclarations.h:116
IVersionable.h
AdobeXMPCore::INodeIterator_v1::~INodeIterator_v1
virtual ~INodeIterator_v1() __NOTHROW__
Definition: INodeIterator.h:179
AdobeXMPCore::spcIStructureNode
shared_ptr< const IStructureNode > spcIStructureNode
Definition: XMPCoreFwdDeclarations.h:104
AdobeXMPCore_Int
Definition: XMPCoreFwdDeclarations.h:233
AdobeXMPCore::pINodeIterator
INodeIterator * pINodeIterator
Definition: XMPCoreFwdDeclarations.h:125
AdobeXMPCommon::pcIError_base
const typedef IError_v1 * pcIError_base
Definition: XMPCommonFwdDeclarations.h:64
AdobeXMPCommon::uint64
XMP_Uns64 uint64
Definition: XMPCommonDefines.h:172
AdobeXMPCore::INodeIterator_v1::GetArrayNode
XMP_PRIVATE spcIArrayNode GetArrayNode() const
Definition: INodeIterator.h:102
AdobeXMPCore::INodeIterator_v1::GetStructureNode
XMP_PRIVATE spIStructureNode GetStructureNode()
Gets the iterator's currently pointed node as structure node, if possible.
Definition: INodeIterator.h:78
AdobeXMPCore::INodeIterator_v1::GetSimpleNode
XMP_PRIVATE spISimpleNode GetSimpleNode()
Gets the iterator's currently pointed node as simple node, if possible.
Definition: INodeIterator.h:60
AdobeXMPCore::spcINode
shared_ptr< const INode > spcINode
Definition: XMPCoreFwdDeclarations.h:68
AdobeXMPCore::kINodeIteratorID
static const uint64 kINodeIteratorID(0x634e6f6465497420)
AdobeXMPCore::INodeIterator_v1::GetNode
XMP_PRIVATE spcINode APICALL GetNode() const
Definition: INodeIterator.h:47
AdobeXMPCommon::ISharedObject
Interface that serves as the base interface of all the externally exposed interfaces.
Definition: ISharedObject.h:29