head     1.5;
branch   ;
access   ;
symbols  ;
locks    ; strict;
comment  @// @;


1.5
date     92.06.21.16.58.21;  author thoth;  state Exp;
branches ;
next     1.4;

1.4
date     92.05.21.20.28.19;  author thoth;  state Exp;
branches ;
next     1.3;

1.3
date     92.05.21.08.10.03;  author fischer;  state Exp;
branches ;
next     1.2;

1.2
date     92.05.19.14.29.51;  author thoth;  state Exp;
branches ;
next     1.1;

1.1
date     92.05.19.01.40.15;  author thoth;  state Exp;
branches ;
next     ;


desc
@Initial version
@


1.5
log
@removed local variables,
experimented with template member function overrides.
@
text
@#ifndef CoordVecOf_h_
#define CoordVecOf_h_

//
// $Log:	CoordVecOf-old.h,v $
// Revision 1.4  92/05/21  20:28:19  thoth
// switched to // comments
// 
// Revision 1.3  92/05/21  08:10:03  fischer
// Reworking CoordType to use more genmeral IA::NumericType.
// Made a lot of names longer, since I got emacs completion.el
// over to CIS.
// 
// Revision 1.2  92/05/19  14:29:51  thoth
// removed Local Variables:
// 
// Revision 1.1  92/05/19  01:40:15  thoth
// Initial revision
// 


#include <CoordVec.h>

template <class T>
class CoordVecOf: public CoordVec {
    T	*vals;
public:
    CoordVecOf(int np) { vals = new T[n=np]; }
    CoordVecOf(const CoordVecOf &);
    ~CoordVecOf() { delete[] vals; }
    const CoordVecOf& operator=(const CoordVecOf&);

    Coord operator[](int idx) {return vals[idx];}
    void set(int idx, Coord val) { vals[idx] = val; }
    CoordVec *clone_self();
};

void CoordVecOf<int>::set(int idx, Coord val) {
  vals[idx] = int(val);
}


template <class T> CoordVecOf<T>::CoordVecOf(const CoordVecOf &cv)
{
    n = cv.n;
    vals = new T[n];
    for (int i=0; i<n; i++)
	vals[i] = cv.vals[i];
}

template <class T>
const CoordVecOf<T>& CoordVecOf<T>::operator=(const CoordVecOf& c)
{
    if (c.n!= n) {
	delete[] vals;
	vals = new T[n=c.n];
    }
    for (int i=0; i<n; i++)
	vals[i] = c.vals[i];

    return *this;
}

template <class T>
CoordVec* CoordVecOf<T>::clone_self()
{
    CoordVecOf * rval;
    rval = new CoordVecOf(*this);
    return rval;
}

#endif
@


1.4
log
@switched to // comments
@
text
@d5 4
a8 1
// $Log:	CoordVecOf.h,v $
d38 3
d42 1
a72 4

// Local variables:
// eval: (c++-mode)
// End:
@


1.3
log
@Reworking CoordType to use more genmeral IA::NumericType.
Made a lot of names longer, since I got emacs completion.el
over to CIS.
@
text
@d4 14
a17 10
/*
 * $Log:	CoordVecOf.h,v $
 * Revision 1.2  92/05/19  14:29:51  thoth
 * removed Local Variables:
 * 
 * Revision 1.1  92/05/19  01:40:15  thoth
 * Initial revision
 * 
 *
 */
@


1.2
log
@removed Local Variables:
@
text
@d6 3
a30 11
#ifndef OVERLOADINGWORKS
void CoordVecOf<int>::set(int idx, Coord val)
{
    vals[idx] = val.to_int();
}

CoordVecOf<float>::set(int idx, Coord val)
{
    vals[idx] = val.to_float();
}
#endif
@


1.1
log
@Initial revision
@
text
@d5 4
a8 1
 * $Log$
a72 1
// eval: (joe-style)
@
