845: Update some abstractions and remove topology-related classes.

https://svn.lrde.epita.fr/svn/oln/trunk/olena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Update some abstractions and remove topology-related classes. * oln/core/abstract/value.hh: Rename as... * oln/core/concept/value.hh: ...this and update. * oln/core/abstract/iterator_on_values.hh: Rename as... * oln/core/concept/iterator_on_values.hh: ...this and update. * oln/core/abstract/topology/topology_having_bbox.hh, * oln/core/abstract/topology/hierarchies.hh, * oln/core/abstract/topology/all.hh, * oln/core/abstract/topology/topology_being_random_accessible.hh, * oln/core/abstract/topology/topology_having_subset.hh, * oln/core/abstract/topology/topology_having_neighborhood.hh: Remove. iterator_on_values.hh | 93 +++++++++++++++----------------------------------- value.hh | 27 ++++++-------- 2 files changed, 41 insertions(+), 79 deletions(-) Index: oln/core/concept/iterator_on_values.hh --- oln/core/concept/iterator_on_values.hh (revision 844) +++ oln/core/concept/iterator_on_values.hh (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2003, 2004, 2005, 2006 EPITA Research and +// Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 EPITA Research and // Development Laboratory // // This file is part of the Olena Library. This library is free @@ -26,109 +26,72 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLN_CORE_ABSTRACT_ITERATOR_ON_VALUES_HH -# define OLN_CORE_ABSTRACT_ITERATOR_ON_VALUES_HH +#ifndef OLN_CORE_CONCEPT_ITERATOR_ON_VALUES_HH +# define OLN_CORE_CONCEPT_ITERATOR_ON_VALUES_HH -# include <oln/core/abstract/iterator.hh> +# include <ostream> +# include <oln/core/concept/iterator.hh> namespace oln { + /// Concept-class "Iterator_on_Values". - // Forward declaration. - namespace abstract { template <typename E> class iterator_on_values; } - - - // Super type declaration. - template <typename E> - struct set_super_type< abstract::iterator_on_values<E> > - { - typedef abstract::iterator<E> ret; - }; - - - /// Virtual types associated to abstract::iterator_on_values<E>. - template <typename E> - struct vtypes< abstract::iterator_on_values<E> > - { - typedef stc::abstract value_type; - }; - - - namespace abstract + template <typename Exact> + struct Iterator_on_Values : public Iterator<Exact> { + stc_typename(value); - /// Abstract value iterator class. - template <typename E> - class iterator_on_values : public abstract::iterator<E> - { - public: - typedef oln_vtype(E, value) value_type; - - value_type to_value() const; + value to_value() const; - // Concrete method. - operator value_type() const; + // Default. + operator value() const; protected: + Iterator_on_Values(); - iterator_on_values(); + }; // end of class oln::Iterator_on_Values<Exact> - ~iterator_on_values(); - }; // end of class oln::abstract::iterator_on_values<E> + template <typename Exact> + std::ostream& operator<<(std::ostream& ostr, const Iterator_on_Values<Exact>& vit); - template <typename E> - std::ostream& operator<<(std::ostream& ostr, - const iterator_on_values<E>& vit); # ifndef OLN_INCLUDE_ONLY - template <typename E> - typename iterator_on_values<E>::value_type - iterator_on_values<E>::to_value() const + template <typename Exact> + typename Iterator_on_Values<Exact>::value + Iterator_on_Values<Exact>::to_value() const { precondition(this->is_valid()); - return this->exact().impl_to_value(); + return exact(this)->impl_to_value(); } - template <typename E> - // Concrete method. - iterator_on_values<E>::operator typename iterator_on_values<E>::value_type() const + template <typename Exact> + Iterator_on_Values<Exact>::operator typename Iterator_on_Values<Exact>::value() const { precondition(this->is_valid()); return this->to_value(); } - template <typename E> - iterator_on_values<E>::iterator_on_values() - { - } - - template <typename E> - iterator_on_values<E>::~iterator_on_values() + template <typename Exact> + Iterator_on_Values<Exact>::Iterator_on_Values() { - mlc::assert_defined_< typename iterator_on_values<E>::value_type >::check(); } - - template <typename E> - std::ostream& operator<<(std::ostream& ostr, - const iterator_on_values<E>& vit) + template <typename Exact> + std::ostream& operator<<(std::ostream& ostr, const Iterator_on_Values<Exact>& vit) { - return ostr << vit.to_value(); + return ostr << vit.to_point(); } - # endif - } // end of namespace oln::abstract - } // end of namespace oln -#endif // ! OLN_CORE_ABSTRACT_ITERATOR_ON_VALUES_HH +#endif // ! OLN_CORE_CONCEPT_ITERATOR_ON_VALUES_HH Index: oln/core/concept/value.hh --- oln/core/concept/value.hh (revision 844) +++ oln/core/concept/value.hh (working copy) @@ -1,4 +1,5 @@ -// Copyright (C) 2005, 2006 EPITA Research and Development Laboratory +// Copyright (C) 2005, 2006, 2007 EPITA Research and Development +// Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -25,36 +26,34 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLN_CORE_ABSTRACT_VALUE_HH -# define OLN_CORE_ABSTRACT_VALUE_HH +#ifndef OLN_CORE_CONCEPT_VALUE_HH +# define OLN_CORE_CONCEPT_VALUE_HH -# include <oln/core/type.hh> +# include <oln/core/equipment.hh> -namespace oln { +namespace oln +{ - namespace abstract { + /// Concept-class "Value". - // A value is not an oln::type. As a consequence, - // traits are basically defined. - struct value + template <typename Exact> + struct Value : public Any<Exact> { protected: - value(); + Value(); }; # ifndef OLN_INCLUDE_ONLY - value::value() + Value::Value() { } # endif - } // end of namespace oln::abstract - } // end of namespace oln -#endif // ! OLN_CORE_ABSTRACT_VALUE_HH +#endif // ! OLN_CORE_CONCEPT_VALUE_HH
participants (1)
-
Thierry Geraud