h o m e d o c u m e n t a t i o n c l a s s h i e r a r c h y

Predicates0D.h

00001 //
00002 //  Filename         : Predicates0D.h
00003 //  Author(s)        : Stephane Grabli, Emmanuel Turquin
00004 //  Purpose          : Class gathering stroke creation algorithms
00005 //  Date of creation : 01/07/2003
00006 //
00008 
00009 
00010 //
00011 //  Copyright (C) : Please refer to the COPYRIGHT file distributed 
00012 //   with this source distribution. 
00013 //
00014 //  This program is free software; you can redistribute it and/or
00015 //  modify it under the terms of the GNU General Public License
00016 //  as published by the Free Software Foundation; either version 2
00017 //  of the License, or (at your option) any later version.
00018 //
00019 //  This program is distributed in the hope that it will be useful,
00020 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 //  GNU General Public License for more details.
00023 //
00024 //  You should have received a copy of the GNU General Public License
00025 //  along with this program; if not, write to the Free Software
00026 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00027 //
00029 
00030 #ifndef  PREDICATES0D_H
00031 # define PREDICATES0D_H
00032 
00033 # include "../view_map/Functions0D.h"
00034 
00035 //
00036 // UnaryPredicate0D (base class for predicates in 0D)
00037 //
00039 
00048 class UnaryPredicate0D
00049 {
00050 public:
00052   UnaryPredicate0D() {}
00054   virtual ~UnaryPredicate0D() {}
00058   virtual string getName() const {
00059     return "UnaryPredicate0D";
00060   }
00070   virtual bool operator()(Interface0DIterator& it) {
00071     cerr << "Warning: operator() not implemented" << endl;
00072     return false;
00073   }
00074 };
00075 
00076 
00077 //
00078 // BinaryPredicate0D (base class for predicates in 0D)
00079 //
00081 
00088 class BinaryPredicate0D
00089 {
00090 public:
00092   BinaryPredicate0D() {}
00094   virtual ~BinaryPredicate0D() {}
00098   virtual string getName() const {
00099     return "BinaryPredicate0D";
00100   }
00101 
00110   virtual bool operator()(Interface0D& inter1, Interface0D& inter2) {
00111     cerr << "Warning: operator() not implemented" << endl;
00112     return false;
00113   }
00114 };
00115 
00116 
00117 //
00118 // Predicates definitions
00119 //
00121 
00122 namespace Predicates0D {
00123 
00124   // TrueUP0D
00126   class TrueUP0D : public UnaryPredicate0D
00127   {
00128   public:
00130     TrueUP0D() {}
00132     string getName() const {
00133       return "TrueUP0D";
00134     }
00136     bool operator()(Interface0DIterator&) {
00137       return true;
00138     }
00139   };
00140 
00141   // FalseUP0D
00143   class FalseUP0D : public UnaryPredicate0D
00144   {
00145   public:
00147     FalseUP0D() {}
00149     string getName() const {
00150       return "FalseUP0D";
00151     }
00153     bool operator()(Interface0DIterator&) {
00154       return false;
00155     }
00156   };
00157 
00158 } // end of namespace Predicates0D
00159 
00160 #endif // PREDICATES0D_H