HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_RefArray.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: Utility Library (C++)
7  *
8  * COMMENTS:
9  * This is a class template that implements a resizable array of
10  * arbitrary objects. The template parameter represents the type
11  * of object, and is called utRef. You can instantiate this class
12  * with any object or pointer, such as:
13  * UT_Array<int> iObj;
14  * UT_Array<GeoPrimMesh> mObj;
15  * UT_Array<GeoPoint*> pObj; ... etc
16  * The "Ref" in the class name stands for "passed by reference", which
17  * is the argument passing strategy used by this class. Use this class
18  * if you want to construct arrays of arbitrary objects. Pointers and
19  * primitive types are stored and passed more efficiently in another
20  * class, UT_Array, which passes arguments by value to avoid the
21  * referencing overhead.
22  */
23 
24 #ifndef __UT_RefArray_h__
25 #define __UT_RefArray_h__
26 
27 #include <SYS/SYS_Types.h>
28 #include "UT_Array.h"
29 
30 // TODO: Do not add new methods to this class. The methods implemented
31 // here are only provided for compatibility until we sweep the baseline to
32 // use the UT_Array interface exclusively.
33 template <typename T>
34 class SYS_DEPRECATED(12.5) UT_RefArray : public UT_Array<T>
35 {
36 public:
37  // gcc doesn't warning about deprecated attributes on class names, so add
38  // it to the constructors as well
39  SYS_DEPRECATED(12.5) explicit UT_RefArray(exint sz = 0)
40  : UT_Array<T>::UT_Array(sz) {}
42  : UT_Array<T>::UT_Array(sz, count) {}
43 
44  exint remove(const T &t)
45  { return UT_Array<T>::findAndRemove(t); }
46 
47  exint remove(exint index)
48  { return UT_Array<T>::removeIndex(index); }
49 };
50 
51 #endif
#define SYS_DEPRECATED(__V__)
exint findAndRemove(const S &s)
int64 exint
Definition: SYS_Types.h:125
exint removeIndex(exint index)
Definition: UT_Array.h:375
exint index(const T &t) const
Definition: UT_Array.h:445
GLdouble t
Definition: glad.h:2397
GLuint index
Definition: glcorearb.h:786
GLint GLsizei count
Definition: glcorearb.h:405