HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_RTIOffsetList.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_RTIOffsetList.h ( GA Library, C++)
7  *
8  * COMMENTS: This is similar to GA_RangeOffset, except instead of
9  * specifying a range of offsets, we specify a list of offsets.
10  */
11 
12 #ifndef __GA_RTIOffsetList__
13 #define __GA_RTIOffsetList__
14 
15 #include "GA_API.h"
16 #include "GA_OffsetList.h"
17 #include "GA_RTISingle.h"
18 #include "GA_Types.h"
19 
20 class GA_IndexMap;
21 class GA_IteratorState;
22 class GA_Range;
24 
25 
26 /// @brief Define a range based on a specific offset list
28 {
29 public:
30  // Iterate over the entire range of the offset list. If end is -1, it will
31  // be set to the number of entries in the offset list.
33  GA_Size start=0, GA_Size end=-1);
34 
35  // Copy c-tor
37 
38  virtual ~GA_RTIOffsetList();
39 
40  /// @{
41  /// RangeTypeInterface implementation
42  virtual GA_RangeTypeInterface *copy() const;
43  virtual bool isSplittable() const;
44  virtual bool isEmpty() const;
45  virtual GA_Size getMaxEntries() const;
46  virtual GA_Size getEntries() const;
47  virtual bool split(GA_RangeTypeInterface *list[2]) const;
48  virtual bool isEqual(const GA_RangeTypeInterface &src) const;
49  virtual void iterateCopy(GA_IteratorState &dest,
50  const GA_IteratorState &src) const;
51  virtual bool areTraversalDeletionsSafe() const { return true; }
52  virtual GA_Size getPageCount() const { return -1; }
53  virtual bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const
57  /// @}
58 
59  /// Accessor for offset list.
60  const GA_OffsetList &getOffsetList() const { return myOffsetList; }
61 
62  /// Rewind the iterator (i.e. reset the iterator state). The start/offset
63  /// should be initialized so that they define the first contiguous "block"
64  /// for iteration. If the range is empty, @c start should be greater than
65  /// @c end
66  virtual void iterateRewind(GA_IteratorState &state,
67  GA_Offset &start, GA_Offset &end) const;
68 
69  /// Choose the next contiguous range. If the iteration is complete,
70  /// @c start should be set to a value greater than @c end.
71  virtual void iterateNext(GA_IteratorState &state,
72  GA_Offset &start, GA_Offset &end) const;
73 
74 private:
75  /// @{
76  /// RangeTypeInterface implementation
77  virtual void singleRewind(GA_IteratorState &state) const;
78  virtual bool singleGet(const GA_IteratorState &state,
79  GA_Offset &value) const;
80  virtual void singleNext(GA_IteratorState &state) const;
81  /// @}
82 
83  GA_OffsetList myOffsetList;
84  GA_Size myStart, myEnd; // Range of offset list
85 };
86 
87 #endif
A class to manage an ordered array which has fixed offset handles.
Definition: GA_IndexMap.h:63
virtual bool isEmpty() const =0
Check whether the range is empty.
virtual GA_RangeTypeInterface * copy() const =0
Method to create a copy of this selection.
virtual bool isSplittable() const =0
virtual bool singleGet(const GA_IteratorState &state, GA_Offset &value) const =0
virtual void iterateCopy(GA_IteratorState &dest, const GA_IteratorState &src) const =0
Copy iterator state. The dest state will not have been constructed.
virtual bool split(GA_RangeTypeInterface *list[2]) const =0
GLuint start
Definition: glcorearb.h:474
virtual bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const
#define GA_API
Definition: GA_API.h:12
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
virtual void iterateRewind(GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const
virtual GA_Size getPageCount() const
A range of elements in an index-map.
Definition: GA_Range.h:42
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2620
bool getPageElementRangeNonSplittable() const
Method which can be called for getPageElementRange()
GA_Size GA_Offset
Definition: GA_Types.h:617
virtual GA_Offset getFirstOffsetInPage(GA_Size) const
GA_Offset getFirstOffsetInPageNonSplittable() const
Method which can be called for getFirstOffsetInPage()
GLuint GLuint end
Definition: glcorearb.h:474
const GA_OffsetList & getOffsetList() const
Accessor for offset list.
virtual bool areTraversalDeletionsSafe() const
virtual void iterateNext(GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const
Abstract implementation of a range.
virtual void singleNext(GA_IteratorState &state) const =0
Define a range based on a specific offset list.
GLsizei const GLfloat * value
Definition: glcorearb.h:823
virtual GA_Size getMaxEntries() const =0
Get an upper bound on the size of the range.
virtual void singleRewind(GA_IteratorState &state) const =0
virtual GA_Size getEntries() const =0
Base class for ranges providing consolidation to contiguous blocks.
Definition: GA_RTISingle.h:31
virtual bool isEqual(const GA_RangeTypeInterface &src) const =0
GLenum src
Definition: glcorearb.h:1792