Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66178 - sandbox/itl/boost/itl_xt
From: afojgo_at_[hidden]
Date: 2010-10-25 09:22:40


Author: jofaber
Date: 2010-10-25 09:22:37 EDT (Mon, 25 Oct 2010)
New Revision: 66178
URL: http://svn.boost.org/trac/boost/changeset/66178

Log:
Some adjustments of icl_xt code. Fixed example history. Stable{msvc-9.0,10.0, gcc-3.4.4}

Added:
   sandbox/itl/boost/itl_xt/set.hpp (contents, props changed)
Text files modified:
   sandbox/itl/boost/itl_xt/episode_product.hpp | 16 ++++++++++++++++
   1 files changed, 16 insertions(+), 0 deletions(-)

Modified: sandbox/itl/boost/itl_xt/episode_product.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/episode_product.hpp (original)
+++ sandbox/itl/boost/itl_xt/episode_product.hpp 2010-10-25 09:22:37 EDT (Mon, 25 Oct 2010)
@@ -186,6 +186,22 @@
 };
 
 
+template <class TimeT, class TypeDomain>
+bool operator == (const episode_product<TimeT,TypeDomain>& left,
+ const episode_product<TimeT,TypeDomain>& right)
+{
+ typedef typename episode_product<TimeT,TypeDomain>::base_type base_type;
+ return dynamic_cast<const base_type&>(left) == dynamic_cast<const base_type&>(right);
+}
+
+template <class TimeT, class TypeDomain>
+struct is_map<episode_product<TimeT,TypeDomain> >
+{
+ typedef is_map type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+
 /* KEEP Eigentlich bessere Implementierung exemplarisch für 'using' in Verbindung
     private inheritence. Müsste aber wg. Rückwärtskompatibilität sorgfältig
     eingepflegt werden (eigentlich nur StatPflege)

Added: sandbox/itl/boost/itl_xt/set.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl_xt/set.hpp 2010-10-25 09:22:37 EDT (Mon, 25 Oct 2010)
@@ -0,0 +1,223 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2007-2010: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ICL_XT_SET_HPP_JOFA_070519
+#define BOOST_ICL_XT_SET_HPP_JOFA_070519
+
+#include <boost/itl/impl_config.hpp>
+
+#if defined(ICL_USE_BOOST_INTERPROCESS_IMPLEMENTATION)
+#include <boost/interprocess/containers/set.hpp>
+#elif defined(ICL_USE_BOOST_MOVE_IMPLEMENTATION)
+#include <boost/container/set.hpp>
+#else
+#include <set>
+#endif
+
+#include <string>
+#include <boost/itl/detail/design_config.hpp>
+#include <boost/itl/detail/concept_check.hpp>
+#include <boost/itl/type_traits/to_string.hpp>
+#include <boost/itl/type_traits/is_set.hpp>
+#include <boost/itl/detail/subset_comparer.hpp>
+#include <boost/itl/detail/set_algo.hpp>
+#include <boost/itl/predicates.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/itl/concept/container.hpp>
+#include <boost/itl/concept/element_set.hpp>
+#include <boost/itl/concept/element_associator.hpp>
+#include <boost/itl/concept/comparable.hpp>
+
+
+namespace boost{namespace icl
+{
+
+/** \brief Addable, subtractable and intersectable sets. */
+template
+<
+ typename DomainT,
+ ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, DomainT),
+ ICL_ALLOC Alloc = std::allocator
+>
+class set: private ICL_IMPL_SPACE::set<DomainT, ICL_COMPARE_DOMAIN(Compare,DomainT), Alloc<DomainT> >
+{
+public:
+ typedef typename icl::set<DomainT, Compare, Alloc> type;
+ typedef typename ICL_IMPL_SPACE::set<DomainT, ICL_COMPARE_DOMAIN(Compare,DomainT), Alloc<DomainT> > base_type;
+ typedef type key_object_type;
+
+public:
+ typedef DomainT domain_type;
+ typedef DomainT codomain_type;
+ typedef DomainT element_type;
+ typedef DomainT key_type;
+ typedef DomainT value_type;
+ typedef DomainT data_type;
+ typedef ICL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
+ typedef domain_compare element_compare;
+ typedef ICL_COMPARE_DOMAIN(Compare,DomainT) key_compare;
+ typedef ICL_COMPARE_DOMAIN(Compare,DomainT) value_compare;
+ typedef Alloc<DomainT> allocator_type;
+
+public:
+ typedef typename base_type::pointer pointer;
+ typedef typename base_type::const_pointer const_pointer;
+ typedef typename base_type::reference reference;
+ typedef typename base_type::const_reference const_reference;
+ typedef typename base_type::iterator iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::size_type size_type;
+ typedef typename base_type::difference_type difference_type;
+ typedef typename base_type::reverse_iterator reverse_iterator;
+ typedef typename base_type::const_reverse_iterator const_reverse_iterator;
+
+ enum { fineness = 4 };
+
+public:
+ //==========================================================================
+ //= Construct, copy, destruct
+ //==========================================================================
+ set()
+ {
+ BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
+ BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
+ }
+
+ explicit set(const domain_compare& comp): base_type(comp){}
+
+ template <class InputIterator>
+ set(InputIterator first, InputIterator past)
+ : base_type(first,past){}
+
+ template <class InputIterator>
+ set(InputIterator first, InputIterator past, const key_compare& comp)
+ : base_type(first, past, comp){}
+
+ set(const set& src): base_type::set(src)
+ {
+ BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
+ BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
+ }
+
+ explicit set(const element_type& key): base_type::set()
+ {
+ insert(key);
+ }
+
+ set& operator=(const set& src) { base_type::operator=(src); return *this; }
+ void swap(set& src) { base_type::swap(src); }
+
+ /** Copy the elements in set \c src to which property \c hasProperty applies
+ into \c *this set. */
+ template<class Predicate>
+ set& assign_if(const set& src, const Predicate&);
+
+ //==========================================================================
+ using base_type::empty;
+ using base_type::clear;
+
+ using base_type::begin;
+ using base_type::end;
+ using base_type::rbegin;
+ using base_type::rend;
+
+ using base_type::size;
+ using base_type::max_size;
+
+ using base_type::key_comp;
+ using base_type::value_comp;
+
+ using base_type::insert;
+ using base_type::erase;
+ using base_type::find;
+ using base_type::count;
+
+ using base_type::lower_bound;
+ using base_type::upper_bound;
+ using base_type::equal_range;
+
+public:
+ //==========================================================================
+ //= Containedness
+ //==========================================================================
+
+ /// Checks if the element \c value is in the set
+ bool contains(const element_type& value)const
+ { return icl::contains(*this, value); }
+
+ /** Does <tt>*this</tt> contain <tt>sub</tt>? */
+ bool contains(const set& sub)const
+ { return icl::contains(*this, sub); }
+
+ /** Is <tt>*this</tt> contained in <tt>super</tt>? */
+ bool within(const set& super)const
+ { return icl::within(*this, super); }
+
+ /** <tt>*this</tt> and <tt>x2</tt> are disjoint, if their intersection is empty */
+ bool disjoint(const set& x2)const
+ { return icl::disjoint(*this, x2); }
+
+ //==========================================================================
+ //= Size
+ //==========================================================================
+ /** \c iterative_size() yields the number of elements that is visited
+ throu complete iteration. For interval sets \c iterative_size() is
+ different from \c size(). */
+ std::size_t iterative_size()const { return base_type::size(); }
+
+ size_t cardinality()const { return base_type::size(); }
+
+ //==========================================================================
+ //= Addition, subtraction
+ //==========================================================================
+ /** Add an \c element to the set. */
+ set& add(const element_type& element)
+ { return icl::insert(*this, element); }
+
+ /** Add an element \c element after \c prior to the set. */
+ iterator add(iterator prior, const element_type& element)
+ { return icl::insert(*this, prior, element); }
+
+ /** Subtract an \c element from the set. */
+ set& subtract(const element_type& element)
+ { return icl::subtract(*this, element); }
+
+ //==========================================================================
+ //= Symmetric difference
+ //==========================================================================
+ /** If \c *this set contains \c element it is erased, otherwise it is added. */
+ set& flip(const element_type& element)
+ { return icl::flip(*this, element); }
+};
+
+
+
+//-----------------------------------------------------------------------------
+// type traits
+//-----------------------------------------------------------------------------
+template <class Type>
+struct is_set<icl::set<Type> >
+{
+ typedef is_set<icl::set<Type> > type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+
+template <class Type>
+struct type_to_string<icl::set<Type> >
+{
+ static std::string apply()
+ { return "set<"+ type_to_string<Type>::apply() +">"; }
+};
+
+}} // namespace icl boost
+
+#endif // BOOST_ICL_XT_SET_HPP_JOFA_070519
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk