HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_ObjectArray.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  */
7 
8 #ifndef __SIM_ObjectArray_h__
9 #define __SIM_ObjectArray_h__
10 
11 #include "SIM_API.h"
12 #include "SIM_PtrArraySorted.h"
13 
14 class SIM_Object;
15 class SIM_ObjectAtTime;
17 class SIM_DataFilter;
18 
19 /// Holds pointers to a number of SIM_Object objects.
21  public SIM_PtrArraySorted<SIM_Object *>
22 {
23 public:
25  SIM_PtrArraySorted<SIM_Object *>(compareObjectId)
26  {
27  }
28  ~SIM_ObjectArray() override {}
29 
30  /// This function returns a pointer the the SIM_Object with the
31  /// specified object id. If the object id is not found, it returns
32  /// null.
33  SIM_Object *findObjectById(int objectid) const;
34 
35  /// This function returns the index within the array of the object
36  /// with the specified id. Returns -1 if objectid doesn't occur in
37  /// the array.
38  int findPositionById(int objectid) const;
39 
40  /// Fills an array with all the objects in this array that match the
41  /// supplied filter.
42  void filter(const SIM_DataFilter &filter,
43  SIM_ObjectArray &filtered) const;
44  /// Fills an array with all the objects in this array that match the
45  /// supplied filter.
46  void filterConst(const SIM_DataFilter &filter,
47  SIM_ConstObjectArray &filtered) const;
48 
49  /// This function is used for sorting the objects in the array.
50  /// It compares objects using the object id values.
51  static int compareObjectId(SIM_Object * const *,
52  SIM_Object * const *);
53 };
54 
55 /// Holds pointers to a number of const SIM_Object objects.
57  public SIM_PtrArraySorted<const SIM_Object *>
58 {
59 public:
61  SIM_PtrArraySorted<const SIM_Object *>(compareConstObjectId)
62  {}
63  ~SIM_ConstObjectArray() override {}
64 
65  /// An assignment operator to copy a SIM_ObjectArray into a
66  /// SIM_ConstObjectArray.
68 
69  /// This function returns a pointer the the SIM_Object with the
70  /// specified object id. If the object id is not found, it returns
71  /// null.
72  const SIM_Object *findObjectById(int objectid) const;
73 
74  /// This function returns the index within the array of the object
75  /// with the specified id.
76  int findPositionById(int objectid) const;
77 
78  /// Fills an array with all the objects in this array that match the
79  /// supplied filter.
80  void filterConst(const SIM_DataFilter &filter,
81  SIM_ConstObjectArray &filtered) const;
82 
83  /// This function is used for sorting the objects in the array.
84  /// It compares objects using the object id values.
85  static int compareConstObjectId(const SIM_Object * const *,
86  const SIM_Object * const *);
87 };
88 
90  public SIM_PtrArraySorted<SIM_ObjectAtTime *>
91 {
92 public:
93  SIM_ObjectAtTimeArray(int objectid);
94  ~SIM_ObjectAtTimeArray() override;
95 
96  int getObjectId() const;
97 
98  /// This function is used for sorting the objects in the array.
99  /// It compares objects using the object id values.
100  static int compareObjectTimes(SIM_ObjectAtTime * const *,
101  SIM_ObjectAtTime * const *);
102 
103 private:
104  int myObjectId;
105 };
106 
108  public SIM_PtrArraySorted<SIM_ObjectAtTimeArray *>
109 {
110 public:
112  SIM_PtrArraySorted<SIM_ObjectAtTimeArray *>(compareObjectId)
113  {}
115  { deleteAllEntries(); }
116 
117  void deleteAllEntries();
118 
119  /// Returns the total number of SIM_ObjectAtTime entries in all the
120  /// arrays stored in this matrix.
121  int fullCount() const;
122 
123  /// Finds or creates a SIM_ObjectAtTimeArray for the object, and adds
124  /// the specified entry to the array.
125  void addObjectAtTime(SIM_ObjectAtTime *objectattime);
126 
127  /// This function is used for sorting the objects in the array.
128  /// It compares objects using the object id values.
129  static int compareObjectId(SIM_ObjectAtTimeArray * const *,
130  SIM_ObjectAtTimeArray * const *);
131 
132 };
133 
134 
135 #endif
136 
~SIM_ConstObjectArray() override
Holds pointers to a number of SIM_Object objects.
~SIM_ObjectArray() override
~SIM_ObjectAtTimeMatrix() override
Holds pointers to a number of const SIM_Object objects.
SIM_PtrArraySorted & operator=(const SIM_PtrArraySorted &src)
#define SIM_API
Definition: SIM_API.h:12
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297
GLenum src
Definition: glcorearb.h:1793