/*H+ TTGenericArrayTemplate.h
*
*    SCCS ID: %Z%%M% %I% %E% SMI
*
*    Copyright (c) 1990-1993 Sun Microsystems, Inc.  All rights reserved.
*    See SUN_LEGAL_NOTICE file for terms of the license.
*
*    PURPOSE:
*
*    Defines the TTGenericArrayTemplate class.
*
*    AUTHOR: Mark Soloway
*
*    REVISION HISTORY:
*
*    Who       When       Why                   
*    --------- ---------- -----------------------
*    MGS       03/17/93   Original creation.
*
*H-*/

#ifndef _TT_GENERIC_ARRAY_TEMPLATE_H
#define _TT_GENERIC_ARRAY_TEMPLATE_H

// Includes
#include <generic.h>

#include "TTGenericArray.h"

// Class Definition
#define DECLARE_TT_GENERIC_ARRAY(TYPE)					\
									\
class TYPE;								\
									\
class name2(TYPE,Array) : public TTGenericArray {			\
public:									\
  name2(TYPE,Array) () {}						\
  name2(TYPE,Array) (const name2(TYPE,Array)& a) : TTGenericArray (a) {}\
  name2(TYPE,Array) (const TTGenericArray& a) : TTGenericArray (a) {}	\
  ~name2(TYPE,Array) () {}						\
									\
  void	          setGrowSize (int grow_size)				\
	          { TTGenericArray::setGrowSize (grow_size); }		\
									\
  void            addItem (TYPE *item)					\
		  { TTGenericArray::addItem ((TTGeneric *)item); }	\
									\
  TYPE		 *removeItem (int index)				\
		  { return (TYPE *)					\
			   TTGenericArray::removeItem (index); }	\
									\
  void	          removeItem (const TYPE *item)				\
		  { TTGenericArray::removeItem ((TTGeneric *)item); }	\
									\
  TYPE           *getItem (int index) const				\
		  { return (TYPE *)					\
			   TTGenericArray::getItem (index); }		\
									\
  int             findItem (const TTGeneric *item) const		\
		  { return TTGenericArray::findItem ((TTGeneric *)	\
						     item); }		\
									\
  TYPE           *traverse (TTBoolean reset_flag)			\
		  { return (TYPE *)					\
			   TTGenericArray::traverse (reset_flag); }	\
									\
  void            clear ()						\
		  { TTGenericArray::clear (); }				\
									\
  void            dropItems ()						\
		  { TTGenericArray::dropItems (); }			\
									\
  int             getSize () const					\
		  { return TTGenericArray::getSize (); }		\
									\
  name2(TYPE,Array) &operator= (const name2(TYPE,Array) &array)		\
		  { TTGenericArray *return_array =			\
				    &TTGenericArray::operator= (array);	\
		    return *(name2(TYPE,Array) *)return_array; }	\
									\
  TYPE *         &operator[] (int index) const				\
		  { TTGeneric **item =					\
				&TTGenericArray::operator[] (index);	\
		    return *(TYPE **)item; }				\
									\
  name2(TYPE,Array) operator+ (const name2(TYPE,Array) &array)		\
                  { name2(TYPE,Array) return_array =			\
                                      TTGenericArray::operator+ (array);\
                    return return_array; }				\
};

#endif /* _TT_GENERIC_ARRAY_TEMPLATE_H */
