Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

nsheap.hh

Go to the documentation of this file.
00001 // Copyright (C) 2004  Laboratoire d'Informatique de Paris 6 (LIP6),
00002 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
00003 // et Marie Curie.
00004 //
00005 // This file is part of Spot, a model checking library.
00006 //
00007 // Spot is free software; you can redistribute it and/or modify it
00008 // under the terms of the GNU General Public License as published by
00009 // the Free Software Foundation; either version 2 of the License, or
00010 // (at your option) any later version.
00011 //
00012 // Spot is distributed in the hope that it will be useful, but WITHOUT
00013 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00014 // or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
00015 // License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Spot; see the file COPYING.  If not, write to the Free
00019 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00020 // 02111-1307, USA.
00021 
00022 #ifndef SPOT_TGBAALGOS_GTEC_NSHEAP_HH
00023 # define SPOT_TGBAALGOS_GTEC_NSHEAP_HH
00024 
00025 #include "tgba/state.hh"
00026 #include "misc/hash.hh"
00027 
00028 namespace spot
00029 {
00031   class numbered_state_heap_const_iterator
00032   {
00033   public:
00034     virtual ~numbered_state_heap_const_iterator() {}
00035 
00037 
00038     virtual void first() = 0;
00039     virtual void next() = 0;
00040     virtual bool done() const = 0;
00042 
00044 
00045     virtual const state* get_state() const = 0;
00046     virtual int get_index() const = 0;
00048   };
00049 
00051   class numbered_state_heap
00052   {
00053   public:
00054     typedef std::pair<const state*, int*> state_index_p;
00055     typedef std::pair<const state*, int> state_index;
00056 
00057     virtual ~numbered_state_heap() {}
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073     virtual state_index find(const state* s) const = 0;
00074     virtual state_index_p find(const state* s) = 0;
00076 
00078 
00079 
00080 
00081 
00082 
00083 
00084 
00085     virtual state_index index(const state* s) const = 0;
00086     virtual state_index_p index(const state* s) = 0;
00088 
00090     virtual void insert(const state* s, int index) = 0;
00091 
00096     virtual int& index_and_insert(const state*& s) = 0;
00097 
00099     virtual int size() const = 0;
00100 
00102     virtual numbered_state_heap_const_iterator* iterator() const = 0;
00103   };
00104 
00106   class numbered_state_heap_factory
00107   {
00108   public:
00109     virtual ~numbered_state_heap_factory() {}
00110     virtual numbered_state_heap* build() const = 0;
00111   };
00112 
00114   class numbered_state_heap_hash_map : public numbered_state_heap
00115   {
00116   public:
00117     virtual ~numbered_state_heap_hash_map();
00118 
00119     virtual state_index find(const state* s) const;
00120     virtual state_index_p find(const state* s);
00121     virtual state_index index(const state* s) const;
00122     virtual state_index_p index(const state* s);
00123     virtual int& index_and_insert(const state*& s);
00124 
00125     virtual void insert(const state* s, int index);
00126     virtual int size() const;
00127 
00128     virtual numbered_state_heap_const_iterator* iterator() const;
00129 
00130     typedef Sgi::hash_map<const state*, int,
00131                           state_ptr_hash, state_ptr_equal> hash_type;
00132   protected:
00133     hash_type h;                
00134   };
00135 
00139   class numbered_state_heap_hash_map_factory:
00140     public numbered_state_heap_factory
00141   {
00142   public:
00143     virtual numbered_state_heap_hash_map* build() const;
00144 
00146     static const numbered_state_heap_hash_map_factory* instance();
00147   protected:
00148     virtual ~numbered_state_heap_hash_map_factory() {}
00149     numbered_state_heap_hash_map_factory();
00150   };
00151 
00152 }
00153 
00154 #endif // SPOT_TGBAALGOS_GTEC_NSHEAP_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Mon Jan 31 12:54:25 2005 for spot by doxygen 1.4.0