Vaucanson 1.4
structure.hh
Go to the documentation of this file.
00001 // structure.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 The Vaucanson Group.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
00016 //
00017 #ifndef VCSN_DESIGN_PATTERN_STRUCTURE_HH
00018 # define VCSN_DESIGN_PATTERN_STRUCTURE_HH
00019 
00027 # include <vaucanson/misc/selectors.hh>
00028 # include <vaucanson/design_pattern/predecls.hh>
00029 # include <vaucanson/misc/unique.hh>
00030 
00031 namespace vcsn {
00032 
00035   /*-------------.
00036   | Structure<S> |
00037   `-------------*/
00038 
00048   template<typename S>
00049   struct Structure : misc::unique::unifiable
00050   {
00052     template<typename T>
00053     bool  contains(const Element<S, T>& elt) const;
00054 
00061     template<typename OtherS, typename T>
00062     bool  contains(const Element<OtherS, T>& other) const;
00063 
00065     template<typename T>
00066     bool  contains(const T& elt_value) const;
00067 
00069     template <class T>
00070     Element<S, T>
00071     choose(SELECTOR(T)) const;
00072 
00073 
00075     typedef S           self_t;
00076 
00078 
00085     self_t&        self();
00086     const self_t&  self() const;
00088 
00089   protected:
00090 
00092 
00093     Structure();
00094     Structure(const Structure& other);
00096   };
00097 
00098   /*--------------------.
00099   | default comparisons |
00100   `--------------------*/
00101 
00111   template<typename S>
00112   bool operator != (const vcsn::Structure<S>& a,
00113                     const vcsn::Structure<S>& b);
00117   /*------------------------------.
00118   | dynamic_traits<Structure<S> > |
00119   `------------------------------*/
00120 
00126   template<typename S>
00127   struct dynamic_traits<Structure<S> >
00128   {
00129     static const bool ret = false;
00130   };
00131 
00132   /*-----------------------------.
00133   | virtual_types<Structure<S> > |
00134   `-----------------------------*/
00135 
00137   template<typename S>
00138   struct virtual_types<Structure<S> >
00139   { };
00140 
00143 } // vcsn
00144 
00145 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00146 #  include <vaucanson/design_pattern/structure.hxx>
00147 # endif // VCSN_USE_INTERFACE_ONLY
00148 
00149 #endif // ! VCSN_DESIGN_PATTERN_STRUCTURE_HH