CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
RxIterator.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef _ODRXITERATOR_H_
25#define _ODRXITERATOR_H_
26
27#include "RxObject.h"
28#include "SmartPtr.h"
29#ifndef SWIG
30#include <iterator>
31#endif
32
33#include "TD_PackPush.h"
34
46class FIRSTDLL_EXPORT OdRxIterator : public OdRxObject
47{
48public:
49
51
53
57 virtual bool done() const = 0;
58
65 virtual bool next() = 0;
66
70 virtual OdRxObjectPtr object() const = 0;
71};
72
77
78#ifndef SWIG
86template<typename I> class OdDbNextIteratorWrap
87{
88protected:
90public:
91 using difference_type = ptrdiff_t;
92 using value_type = const I*;
93 using pointer = void;
94 using reference = const I*;
95 using iterator_category = std::input_iterator_tag;
100 {
101 m_pIterator = i;
102 if (!!m_pIterator && m_pIterator->done())
103 m_pIterator.release();
104 }
105
110 reference operator*() const { return m_pIterator.get(); }
111
115 bool operator ==(const OdDbNextIteratorWrap& other) const { return m_pIterator == other.m_pIterator; }
116
120 bool operator !=(const OdDbNextIteratorWrap& other) const { return m_pIterator != other.m_pIterator; }
121
126 {
127 if (!!m_pIterator)
128 {
129 m_pIterator->next();
130 if (m_pIterator->done())
131 m_pIterator.release();
132 }
133 return *this;
134 }
135};
136#endif
137
138#include "TD_PackPop.h"
139
140#endif // _ODRXITERATOR_H_
141
OdSmartPtr< OdRxIterator > OdRxIteratorPtr
#define FIRSTDLL_EXPORT
Definition RootExport.h:39
OdSmartPtr< I > m_pIterator
Definition RxIterator.h:89
ptrdiff_t difference_type
Definition RxIterator.h:91
const OdDbNextIteratorWrap & operator++()
Definition RxIterator.h:125
reference operator*() const
Definition RxIterator.h:110
bool operator==(const OdDbNextIteratorWrap &other) const
Definition RxIterator.h:115
OdDbNextIteratorWrap(const OdSmartPtr< I > &i)
Definition RxIterator.h:99
bool operator!=(const OdDbNextIteratorWrap &other) const
Definition RxIterator.h:120
std::input_iterator_tag iterator_category
Definition RxIterator.h:95
virtual OdRxObjectPtr object() const =0
virtual bool done() const =0
virtual bool next()=0
ODRX_DECLARE_MEMBERS(OdRxIterator)
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)