HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
GA_IteratorState.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* NAME: GA_IteratorState.h ( GA Library, C++)
7
*
8
* COMMENTS:
9
*/
10
11
#ifndef __GA_IteratorState__
12
#define __GA_IteratorState__
13
14
#include "
GA_API.h
"
15
#include "
GA_Types.h
"
16
17
#include <
UT/UT_NonCopyable.h
>
18
19
#include <stddef.h>
20
21
22
/// State information for a GA_Iterator. This stores unique information for
23
/// each iterator which the GA_Range bound to the iterator can reference.
24
class
GA_API
GA_IteratorState
:
public
UT_NonCopyable
25
{
26
public
:
27
GA_IteratorState
()
28
: myPointer(NULL)
29
, myOffset(
GA_INVALID_OFFSET
)
30
, myIndex(
GA_INVALID_INDEX
)
31
, mySize(0)
32
, myNestedState(NULL)
33
{}
34
35
~
GA_IteratorState
();
36
37
/// Copy the POD state (not including nested state)
38
void
copyState
(
const
GA_IteratorState
&
src
)
39
{
40
myPointer = src.
myPointer
;
41
myOffset = src.
myOffset
;
42
myIndex = src.
myIndex
;
43
mySize = src.
mySize
;
44
}
45
46
/// These variables provide easy storage to GA_RangeTypeInterface
47
/// without the style necessarily having to allocate state
48
/// information (i.e. the named storage)
49
void
*
myPointer
;
50
GA_Offset
myOffset
;
51
GA_Index
myIndex
;
52
GA_Size
mySize
;
53
54
/// Some ranges contain nested ranges. These RTIs can create nested
55
/// states. These nested states should be used to store the iteration
56
/// state for the nested range.
57
/// Call @c createNestedState() in GA_RangeTypeInterface::iterateCreate().
58
/// And it should only be called once.
59
/// For example, a nested range might have code like: @code
60
/// GA_RTINested::iterateCreate(GA_IteratorState &state)
61
/// {
62
/// myBase->iterateCreate(state.createNestedState());
63
/// // Use any data in state to store the parent's state information
64
/// }
65
///
66
/// GA_RTINested::iterateDestroy(GA_IteratorState &state)
67
/// {
68
/// myBase->iterateDestroy(&state.getNestedState());
69
/// state.clearNestedState();
70
/// // Do any cleanup on state that you need
71
/// }
72
///
73
/// GA_RTINested::iterateRewind(GA_IteratorState &state,
74
/// GA_Offset &start, GA_Offset &end) const
75
/// {
76
/// GA_Offset n_start, n_end;
77
/// myBase->iterateRewind(state.getNestedState(), n_start, n_end);
78
/// // Use base_start base_end and the state to rewind the parent
79
/// }
80
/// GA_RTINested::iterateCopy(GA_IteratorState &d,
81
/// const GA_IteratorState &s)
82
/// {
83
/// GA_IteratorState &nest = dest.createNestedState();
84
/// myBase->iterateCopy(nest, src.getNestedState());
85
/// state.copyState(src);
86
/// }
87
/// @endcode
88
GA_IteratorState
&createNestedState();
89
90
/// Clear the nested pointer.
91
void
clearNestedState();
92
93
/// Access to the nested state.
94
GA_IteratorState
&getNestedState()
const
;
95
96
private
:
97
GA_IteratorState
*myNestedState;
98
};
99
100
#endif
GA_IteratorState::myIndex
GA_Index myIndex
Definition:
GA_IteratorState.h:51
GA_IteratorState::myPointer
void * myPointer
Definition:
GA_IteratorState.h:49
GA_IteratorState::myOffset
GA_Offset myOffset
Definition:
GA_IteratorState.h:50
GA_API
#define GA_API
Definition:
GA_API.h:14
GA_IteratorState::GA_IteratorState
GA_IteratorState()
Definition:
GA_IteratorState.h:27
GA_Size
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition:
GA_Types.h:236
GA_INVALID_OFFSET
#define GA_INVALID_OFFSET
Definition:
GA_Types.h:687
GA_Offset
GA_Size GA_Offset
Definition:
GA_Types.h:646
GA_API.h
GA_IteratorState::copyState
void copyState(const GA_IteratorState &src)
Copy the POD state (not including nested state)
Definition:
GA_IteratorState.h:38
GA_Index
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition:
GA_Types.h:640
GA_IteratorState
Definition:
GA_IteratorState.h:24
UT_NonCopyable.h
GA_IteratorState::mySize
GA_Size mySize
Definition:
GA_IteratorState.h:52
UT_NonCopyableNS::UT_NonCopyable
Definition:
UT_NonCopyable.h:17
GA_INVALID_INDEX
#define GA_INVALID_INDEX
Definition:
GA_Types.h:686
GA_Types.h
src
GLenum src
Definition:
glcorearb.h:1793
GA
GA_IteratorState.h
Generated on Tue Dec 24 2024 02:40:20 for HDK by
1.8.6