head	1.3;
access;
symbols
	bobbase:1.3
	bob:1.3.1
	r2_1:1.3
	r2_0:1.3
	r1_1_beta:1.2
	r1_1_alpha:1.2
	r1_0:1.2
	r0_11:1.2
	r0_10:1.1;
locks
	thoth:1.3.1.1; strict;
comment	@// @;


1.3
date	94.08.22.15.20.29;	author thoth;	state Exp;
branches
	1.3.1.1;
next	1.2;

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

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

1.3.1.1
date	94.12.28.15.41.55;	author thoth;	state Exp;
branches;
next	;


desc
@Base neighborhood implementation.
@


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

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


//
// $Log: BaseNbh.h,v $
// Revision 1.2  1994/03/14  15:48:33  thoth
// ValueSet has been replaced by container class Set.
//
// Revision 1.1  1994/01/31  16:43:38  thoth
// Initial revision
//


#ifndef BaseNbh_h_
#define BaseNbh_h_

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


template <class P, class Q> class IA_Neighborhood;

template <class P, class Q>
class IA_BaseNbh {
protected:
    IA_Set<Q> ps;

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


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

    IA_BaseNbh(const IA_Set<Q> &p):ps(p) {
	refcount = 0;
    }

    virtual ~IA_BaseNbh() {};

    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 IA_Set<P> operator ()(const Q &) const =0;

    // Each class derived from BaseNbh must support the member function
    // type which returns an IA::Type value (a pointer to an int).
    // To distinguish between the different classes derived from BaseNbh,
    // we make certain that type will be distinct for each of these classes
    // as follows:
    //	Each class derived from BaseNbh defines a static function member dummy:
    //		static char 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 BaseNbh returns
    //	the address of dummy.
    // Thus each class returns a unique value for a call of type().

    virtual IA::Type type() const =0;

    IA_Set<Q> domain() const { return this->ps; }

    virtual ostream& print_this(ostream&) const = 0;
    
    friend class IA_Neighborhood<P,Q>;
};

#endif
@


1.3.1.1
log
@operator= is illegal.
Neighborhood does not have to be friendly.
@
text
@a10 3
// Revision 1.3  1994/08/22  15:20:29  thoth
// DOS-inspired name rework.
//
a21 1
#include <stdlib.h>
a39 1
    IA_BaseNbh<P,Q> & operator=(const IA_BaseNbh<P,Q> &) { abort(); return *this; }
d80 1
a80 1
//    friend class IA_Neighborhood<P,Q>;
@


1.2
log
@ValueSet has been replaced by container class Set.
@
text
@d11 3
d25 1
a25 1
#include "IntPointSet.h"
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log: BaseDT.h,v $
a22 1
#include "ValueSet.h"
@
