head	1.6;
access;
symbols
	bobbase:1.6
	bob:1.6
	r2_1:1.6
	C_8:1.6
	r2_0:1.6
	r1_1_beta:1.5
	r1_1_alpha:1.4
	r1_0:1.4
	r0_11:1.4
	r0_10:1.1
	r0_9:1.1;
locks; strict;
comment	@// @;


1.6
date	94.08.22.15.20.29;	author thoth;	state Exp;
branches;
next	1.5;

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

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

1.3
date	94.02.22.18.46.25;	author thoth;	state Exp;
branches;
next	1.2;

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

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


desc
@Base discrete template declaration.
@


1.6
log
@DOS-inspired name rework.
@
text
@// Emacs: -*- C++ -*-

//
//	Copyright 1993, Center for Computer Vision and Visualization,
//	University of Florida.  All rights reserved.
//


//
// $Log: BaseDT.h,v $
// Revision 1.5  1994/07/25  17:26:39  thoth
// Name sanitization
//
// Revision 1.4  1994/03/14  15:48:33  thoth
// ValueSet has been replaced by container class Set.
//
// Revision 1.3  1994/02/22  18:46:25  thoth
// New is_a virtual method, used to determine if an object is of a
// class derived from another class.
//
// Revision 1.2  1994/02/12  19:34:43  thoth
// Using IA::Type instead of the IA_DiscreteImageType typedef.
//
// Revision 1.1  1993/09/15  12:50:03  thoth
// Initial revision
//
// Revision 1.2  93/05/27  11:19:27  thoth
// Copyright Notices
// 
// Revision 1.1  93/04/17  18:59:02  thoth
// Initial revision
// 


#ifndef BaseDT_h_
#define BaseDT_h_

#include <iostream.h>
#include "ia.h"
#include "IntPoint.h"
#include "IntPS.h"

template <class I>
class IA_DDTemplate;

template <class I>
class IA_BaseDT {
protected:
    IA_Set<IA_Point<int> > ps;

    // refcount counts the number of references to this BaseDT object
    //   from DDTemplate container class objects.
    // It is maintained by container classes.
    int refcount;


public:
    // Constructor for BaseDT takes care of initting the refcount.
    // Derived classes need not frob it.
    // It is the responsibility of the container to maintain the refcount!

    IA_BaseDT(const IA_Set<IA_Point<int> > &p):ps(p) {
	refcount = 0;
    }

    virtual ~IA_BaseDT() {};

    int get_ref() { return refcount; }
    int incr_ref() { return ++refcount; }
    int decr_ref() { return --refcount; }

    // For the next function, we expect our container to trap
    // out-of-bounds points
    virtual I operator ()(const IA_Point<int> &) const =0;

    // Each class derived from BaseDT must support the member function
    // type which returns a DiscreteImageType value (a pointer to an int).
    // To distinguish between the different classes derived from BaseDT,
    // we make certain that type will be distinct for each of these classes
    // as follows:
    //	Each class derived from BaseDT defines a static function member dummy:
    //		static int dummy;
    //  The class definition for derived class "classname" must also be
    //	followed by a declaration of form
    //		template <class T> char classname<T>::dummy = 0;
    //	The member function type() in each class derived from BaseDT returns
    //	the address of dummy.
    // Thus each class returns a unique value for a call of type().

    virtual IA::Type type() const =0;
    virtual int is_a(IA::Type) { return 0; }
#if 0
    // NYI
    virtual IA_BaseDT *restricted_to(const IA_Set<IA_Point<int> > &ps) const =0;

    virtual IA_BaseDIVIter<I> *value_iter(const IA_DDTemplate<I> &) const;
    virtual IA_BaseDIPIter<I> *pixel_iter(const IA_DDTemplate<I> &) const;
#endif
    IA_Set<IA_Point<int> > domain() const { return this->ps; }

    virtual ostream& print_this(ostream&) const = 0;
    
    friend class IA_DDTemplate<I>;
};

#endif
@


1.5
log
@Name sanitization
@
text
@d11 3
d41 1
a41 1
#include "IntPointSet.h"
@


1.4
log
@ValueSet has been replaced by container class Set.
@
text
@d11 3
d46 1
a46 1
    IA_IntPointSet ps;
d59 1
a59 1
    IA_BaseDT(const IA_IntPointSet &p):ps(p) {
d71 1
a71 1
    virtual I operator ()(const IA_IntPoint &) const =0;
d91 1
a91 1
    virtual IA_BaseDT *restricted_to(const IA_IntPointSet &ps) const =0;
d96 1
a96 1
    IA_IntPointSet domain() const { return this->ps; }
@


1.3
log
@New is_a virtual method, used to determine if an object is of a
class derived from another class.
@
text
@d11 4
a35 1
#include "ValueSet.h"
@


1.2
log
@Using IA::Type instead of the IA_DiscreteImageType typedef.
@
text
@d11 3
d82 1
a82 1
    virtual int is_a(IA::Type) { return 0; }  
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log:	BaseDT.h,v $
a30 2
typedef const char* const IA_DiscreteImageType;

d73 1
a73 1
    //		template <class T> int classname<T>::dummy = 0;
d78 2
a79 1
    virtual IA_DiscreteImageType type() const =0;
@
