HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_RTIRepeater.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_RTIRepeater.h ( GA Library, C++)
7  *
8  * COMMENTS: This is like the "Python" range function. That is, the end is
9  * non-inclusive:
10  * GA_RTIRepeater(list, 0, 3) = [0, 1, 2]
11  */
12 
13 #ifndef __GA_RTIRepeater__
14 #define __GA_RTIRepeater__
15 
16 #include "GA_API.h"
17 #include "GA_RangeTypeInterface.h"
18 #include "GA_Types.h"
19 
20 
21 class GA_IndexMap;
22 class GA_IteratorState;
23 class GA_Range;
24 
25 
27 {
28 public:
29  // Range which repeats the @c offset for @c count times
31 
32  // Copy c-tor
34  ~GA_RTIRepeater() override;
35 
36  /// @{
37  /// RangeTypeInterface implementation
38  GA_RangeTypeInterface *copy() const override;
39  bool isSplittable() const override { return false; }
40  bool isEmpty() const override;
41  GA_Size getMaxEntries() const override;
42  GA_Size getEntries() const override;
43  bool split(GA_RangeTypeInterface *list[2]) const override;
44  bool isEqual(const GA_RangeTypeInterface &src) const override;
45  void iterateCopy(GA_IteratorState &dest,
46  const GA_IteratorState &src) const override;
47  void iterateRewind(GA_IteratorState &state,
48  GA_Offset &start, GA_Offset &end) const override;
49  void iterateNext(GA_IteratorState &state,
50  GA_Offset &start, GA_Offset &end) const override;
51  bool areTraversalDeletionsSafe() const override { return true; }
52  GA_Size getPageCount() const override { return -1; }
53  bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const override
57  /// @}
58 
59 private:
60  /// @{
61  /// RangeTypeInterface implementation
62  virtual void singleRewind(GA_IteratorState &state) const;
63  virtual bool singleGet(const GA_IteratorState &state,
64  GA_Offset &value) const;
65  virtual void singleNext(GA_IteratorState &state) const;
66  /// @}
67 
68  GA_Offset myOffset;
69  GA_Size myCount;
70 };
71 
72 #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 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:475
GA_Offset getFirstOffsetInPage(GA_Size) const override
#define GA_API
Definition: GA_API.h:14
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:236
A range of elements in an index-map.
Definition: GA_Range.h:42
bool getPageElementRangeNonSplittable() const
Method which can be called for getPageElementRange()
GA_Size GA_Offset
Definition: GA_Types.h:646
GLintptr offset
Definition: glcorearb.h:665
GA_Offset getFirstOffsetInPageNonSplittable() const
Method which can be called for getFirstOffsetInPage()
GLuint GLuint end
Definition: glcorearb.h:475
bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const override
virtual void iterateRewind(GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const =0
Abstract implementation of a range.
virtual GA_Size getMaxEntries() const =0
Get an upper bound on the size of the range.
bool areTraversalDeletionsSafe() const override
Definition: core.h:1131
GA_Size getPageCount() const override
bool isSplittable() const override
virtual GA_Size getEntries() const =0
virtual void iterateNext(GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const =0
GLint GLsizei count
Definition: glcorearb.h:405
virtual bool isEqual(const GA_RangeTypeInterface &src) const =0
GLenum src
Definition: glcorearb.h:1793