|
Boost-Commit : |
From: huseyinakcan_at_[hidden]
Date: 2007-06-29 19:12:10
Author: huseyinakcan
Date: 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
New Revision: 7317
URL: http://svn.boost.org/trac/boost/changeset/7317
Log:
all of mutable concept tests.
Added:
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_backward_hds_concept.cpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_backward_hds_concept.t.cpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_bidirectional_hds_concept.cpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_bidirectional_hds_concept.t.cpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_facet_hds_concept.cpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_facet_hds_concept.t.cpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_vertex_hds_concept.cpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_vertex_hds_concept.t.cpp
Text files modified:
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/Makefile.dbg_exc_mt | 38 +++++++++++++++++++++++++++++++++++++-
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/facet_hds_concept.t.cpp | 12 ++++++------
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_backward_hds_concept.hpp | 15 +++++----------
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_bidirectional_hds_concept.hpp | 20 +++++++-------------
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_facet_hds_concept.hpp | 22 ++++++++++------------
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_forward_hds_concept.hpp | 6 +-----
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_forward_hds_concept.t.cpp | 25 +++++++++++++++----------
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_hds_concept.t.cpp | 3 ++-
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_vertex_hds_concept.hpp | 37 +++++++++++++++----------------------
9 files changed, 98 insertions(+), 80 deletions(-)
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/Makefile.dbg_exc_mt
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/Makefile.dbg_exc_mt (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/Makefile.dbg_exc_mt 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -1,5 +1,6 @@
CXX=g++
-CXXFLAGS=-pedantic -W -Wall -I${BOOST} -I.
+CXXFLAGS=-pedantic -W -Wall -I.
+#CXXFLAGS=-pedantic -W -Wall -I${BOOST} -I.
LD=g++
@@ -11,7 +12,11 @@
forward_hds_concept.o \
hds_concept.o \
mutable_forward_hds_concept.o \
+ mutable_backward_hds_concept.o \
+ mutable_bidirectional_hds_concept.o \
mutable_hds_concept.o \
+ mutable_facet_hds_concept.o \
+ mutable_vertex_hds_concept.o \
vertex_hds_concept.o
PACKAGE_LIBRARY=libhds_concepts.a
@@ -22,7 +27,11 @@
forward_hds_concept.t \
hds_concept.t \
mutable_forward_hds_concept.t \
+ mutable_backward_hds_concept.t \
+ mutable_bidirectional_hds_concept.t \
mutable_hds_concept.t \
+ mutable_facet_hds_concept.t \
+ mutable_vertex_hds_concept.t \
vertex_hds_concept.t
.SUFFIXES:
@@ -47,7 +56,16 @@
hds_concept.o:
mutable_forward_hds_concept.o: forward_hds_concept.hpp \
hds_concept.hpp mutable_hds_concept.hpp
+mutable_backward_hds_concept.o: backward_hds_concept.hpp \
+ hds_concept.hpp mutable_hds_concept.hpp
+mutable_bidirectional_hds_concept.o: mutable_forward_hds_concept.hpp \
+ mutable_backward_hds_concept.hpp hds_concept.hpp \
+ mutable_hds_concept.hpp
mutable_hds_concept.o: hds_concept.hpp
+mutable_facet_hds_concept.o: facet_hds_concept.hpp \
+ mutable_hds_concept.hpp
+mutable_vertex_hds_concept.o: vertex_hds_concept.hpp \
+ mutable_hds_concept.hpp
vertex_hds_concept.o: hds_concept.hpp
@@ -67,7 +85,16 @@
hds_concept.t.o:
mutable_forward_hds_concept.t.o: forward_hds_concept.hpp \
hds_concept.hpp mutable_hds_concept.hpp
+mutable_backward_hds_concept.t.o: backward_hds_concept.hpp \
+ hds_concept.hpp mutable_hds_concept.hpp
+mutable_bidirectional_hds_concept.t.o: mutable_forward_hds_concept.hpp \
+ mutable_backward_hds_concept.hpp hds_concept.hpp \
+ mutable_hds_concept.hpp
mutable_hds_concept.t.o: hds_concept.hpp
+mutable_facet_hds_concept.t.o: facet_hds_concept.hpp \
+ mutable_hds_concept.hpp
+mutable_vertex_hds_concept.t.o: vertex_hds_concept.hpp \
+ mutable_hds_concept.hpp
vertex_hds_concept.t.o: hds_concept.hpp
%.t.o: %.t.cpp %.h
@@ -81,7 +108,16 @@
hds_concept.t.o:
mutable_forward_hds_concept.t.o: forward_hds_concept.o \
hds_concept.o mutable_hds_concept.o
+mutable_backward_hds_concept.t.o: backward_hds_concept.o \
+ hds_concept.o mutable_hds_concept.o
+mutable_bidirectional_hds_concept.t.o: mutable_forward_hds_concept.hpp \
+ mutable_backward_hds_concept.o hds_concept.o \
+ mutable_hds_concept.o
mutable_hds_concept.t.o: hds_concept.o
+mutable_facet_hds_concept.o: facet_hds_concept.o \
+ mutable_hds_concept.o
+mutable_vertex_hds_concept.o: vertex_hds_concept.o \
+ mutable_hds_concept.o
vertex_hds_concept.t.o: hds_concept.o
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/facet_hds_concept.t.cpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/facet_hds_concept.t.cpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/facet_hds_concept.t.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -30,15 +30,15 @@
};
facet_hds_archetype::halfedge_descriptor
- opposite(facet_hds_archetype::halfedge_descriptor h,
- const facet_hds_archetype&)
+ opposite(facet_hds_archetype::halfedge_descriptor h,
+ const facet_hds_archetype&)
{
return h;
}
facet_hds_archetype::facet_descriptor
- facet(facet_hds_archetype::halfedge_descriptor h,
- const facet_hds_archetype&)
+ facet(facet_hds_archetype::halfedge_descriptor h,
+ const facet_hds_archetype&)
{
return facet_hds_archetype::facet_descriptor();
}
@@ -52,9 +52,9 @@
struct hds_traits<hdstl1::facet_hds_archetype>
{
typedef hdstl1::facet_hds_archetype::halfedge_descriptor
- halfedge_descriptor;
+ halfedge_descriptor;
typedef hdstl1::facet_hds_archetype::facet_descriptor
- facet_descriptor;
+ facet_descriptor;
enum { supports_vertices = false};
static const int supports_facets = true;
};
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_backward_hds_concept.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_backward_hds_concept.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,4 @@
+// mutable_backward_hds_concept.cpp -*- C++ -*-
+
+#include <boost/hdstl/hds_concepts/mutable_backward_hds_concept.hpp>
+
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_backward_hds_concept.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_backward_hds_concept.hpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_backward_hds_concept.hpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -107,7 +107,10 @@
#ifndef BOOST_HDSTL_CONCEPTS_MUTABLE_BACKWARD_HDS_CONCEPT_HPP
#define BOOST_HDSTL_CONCEPTS_MUTABLE_BACKWARD_HDS_CONCEPT_HPP 1
-#include <boost/concepts.h>
+#include <boost/concept_check.hpp>
+#include <boost/hdstl/hds_traits.hpp>
+#include <boost/hdstl/hds_concepts/backward_hds_concept.hpp>
+#include <boost/hdstl/hds_concepts/mutable_hds_concept.hpp>
namespace boost {
namespace hdstl{
@@ -150,19 +153,11 @@
set_prev_in_facet(h, g, hds);
set_prev_at_source(h, g, hds);
set_prev_at_target(h, g, hds);
- const_constraints(hds);
- }
-
- // OPAQUE ACCESSORS
- void const_constraints(HDS const& hds)
- // Check that the non-modifiable 'HDS' template parameters
- // satisfies all the constraints of 'MutableBackwardHDSConcept'.
- {
}
private:
// DATA
- MutableBackwardHDS hds; // a halfedge data structure object
+ HDS hds; // a halfedge data structure object
halfedge_descriptor h,g; // halfedge descriptors
};
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_backward_hds_concept.t.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_backward_hds_concept.t.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,173 @@
+//mutable_backward_hds_concept.t.cpp -*- C++ -*-
+//
+//@OVERVIEW: The component under test is a concept-checking class. We
+// proceed with the standard test plan for such a class.
+//
+//@TEST_PLAN: Create a (loose) archetype of the concept, and verify
+// (using the Boost.ConceptCheck library macros) that it satisfies all
+// the concept requirements of the concept. Note that the purpose of
+// this test driver is to verify the validity of the concept checking
+// class, not of the archetype. This is why it suffices to take the
+// 'halfedge_descriptor' as an 'int', although a real archetype would make
+// this into a custom-made class with the tailored minimal requirements.
+
+#include <boost/hdstl/hds_concepts/mutable_backward_hds_concept.hpp>
+#include <boost/test/minimal.hpp>
+#include <boost/concept_check.hpp>
+
+namespace hdstl1 {
+
+ struct TT : public boost::hdstl::backward_traversal_tag {};
+
+ template<typename BackwardCategory>
+ struct mutable_backward_hds_archetype {
+ // This 'struct', intentionally defined in a namespace different from
+ // 'hdstl', the 'hds_traits' specialization defined in the namespace
+ // 'hdstl', and the supporting functions 'opposite', 'prev_in_facet',
+ // 'prev_at_source', and 'prev_at_target' defined in the same namespace
+ // as this 'struct' to take advantage of ADL (argument-dependent
+ // lookup) provide an archetype for the 'MutableBackwardHDS' concept.
+
+ typedef int halfedge_descriptor;
+ typedef TT traversal_category;
+ typedef BackwardCategory backward_category;
+ };
+
+ template<typename BackwardCategory>
+ typename mutable_backward_hds_archetype<BackwardCategory>::halfedge_descriptor
+ opposite(typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor h,
+ const mutable_backward_hds_archetype<BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename BackwardCategory>
+ typename mutable_backward_hds_archetype<BackwardCategory>::halfedge_descriptor
+ prev_in_facet(typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor h,
+ const mutable_backward_hds_archetype<BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename BackwardCategory>
+ typename mutable_backward_hds_archetype<BackwardCategory>::halfedge_descriptor
+ prev_at_source(typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor h,
+ const mutable_backward_hds_archetype<BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename BackwardCategory>
+ typename mutable_backward_hds_archetype<BackwardCategory>::halfedge_descriptor
+ prev_at_target(typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor h,
+ const mutable_backward_hds_archetype<BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename BackwardCategory>
+ void
+ set_prev_in_facet(typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor,
+ typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor,
+ const mutable_backward_hds_archetype<BackwardCategory>&)
+ {
+ }
+
+ template<typename BackwardCategory>
+ void
+ set_prev_at_source(typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor,
+ typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor,
+ const mutable_backward_hds_archetype<BackwardCategory>&)
+ {
+ }
+
+ template<typename BackwardCategory>
+ void
+ set_prev_at_target(typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor,
+ typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor,
+ const mutable_backward_hds_archetype<BackwardCategory>&)
+ {
+ }
+
+ template<typename BackwardCategory>
+ typename mutable_backward_hds_archetype<BackwardCategory>::halfedge_descriptor
+ new_edge(mutable_backward_hds_archetype<BackwardCategory>&)
+ {
+ return typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor();
+ }
+
+ template<typename BackwardCategory>
+ void
+ delete_edge(typename mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor,
+ mutable_backward_hds_archetype<BackwardCategory>&)
+ {
+ }
+
+} // namespace hdstl
+
+namespace boost {
+namespace hdstl {
+
+ template <typename BackwardCategory>
+ struct hds_traits<hdstl1::mutable_backward_hds_archetype<BackwardCategory> >
+ {
+ typedef typename hdstl1::mutable_backward_hds_archetype<BackwardCategory>
+ ::halfedge_descriptor
+ halfedge_descriptor;
+ typedef typename hdstl1::mutable_backward_hds_archetype<BackwardCategory>
+ ::traversal_category
+ traversal_category;
+ typedef typename hdstl1::mutable_backward_hds_archetype<BackwardCategory>
+ ::backward_category
+ backward_category;
+ enum { supports_vertices = false};
+ static const int supports_facets = true;
+ };
+
+} // namespace hdstl
+} // namespace boost
+
+// ===========================================================================
+// BOOST TEST APPARATUS
+// ===========================================================================
+
+template <class HDS>
+struct class_concept_requirements
+{
+ BOOST_CLASS_REQUIRE(HDS, boost::hdstl::concepts, MutableBackwardHDSConcept);
+};
+
+template <class HDS>
+bool concept_requirements()
+{
+ boost::function_requires<
+ boost::hdstl::concepts::MutableBackwardHDSConcept<HDS> >();
+ class_concept_requirements<HDS>(); // force instantiation
+ return true;
+}
+
+int test_main(int, char **)
+{
+ BOOST_CHECK(( concept_requirements<
+ hdstl1::mutable_backward_hds_archetype<
+ boost::hdstl::prev_in_facet_tag> >() ));
+ BOOST_CHECK(( concept_requirements<
+ hdstl1::mutable_backward_hds_archetype<
+ boost::hdstl::prev_at_source_tag> >() ));
+ BOOST_CHECK(( concept_requirements<
+ hdstl1::mutable_backward_hds_archetype<
+ boost::hdstl::prev_at_target_tag> >() ));
+ return 0;
+}
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_bidirectional_hds_concept.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_bidirectional_hds_concept.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,4 @@
+// mutable_bidirectional_hds_concept.cpp -*- C++ -*-
+
+#include <boost/hdstl/hds_concepts/mutable_bidirectional_hds_concept.hpp>
+
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_bidirectional_hds_concept.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_bidirectional_hds_concept.hpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_bidirectional_hds_concept.hpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -80,16 +80,18 @@
// function_requires<ConvertibleConcept<traversal_category,
// bidirectional_traversal_tag> >();
// }
-// void const_constraints(HDS const& hds) {
-// }
-// MutableBidirectionalHDS hds;
+// HDS hds;
// };
//..
#ifndef BOOST_HDSTL_CONCEPTS_MUTABLE_BIDIRECTIONAL_HDS_CONCEPT_HPP
#define BOOST_HDSTL_CONCEPTS_MUTABLE_BIDIRECTIONAL_HDS_CONCEPT_HPP 1
-#include <boost/concepts.h>
+#include <boost/concept_check.hpp>
+#include <boost/hdstl/hds_traits.hpp>
+#include <boost/hdstl/hds_concepts/mutable_forward_hds_concept.hpp>
+#include <boost/hdstl/hds_concepts/mutable_backward_hds_concept.hpp>
+#include <boost/hdstl/hds_concepts/bidirectional_hds_concept.hpp>
namespace boost {
namespace hdstl{
@@ -133,17 +135,9 @@
bidirectional_traversal_tag> >();
}
- // OPAQUE ACCESSORS
- void const_constraints(HDS const& hds)
- // Check that the non-modifiable 'HDS' template parameters
- // satisfies all the constraints of
- // 'MutableBidirectionalHDSConcept'.
- {
- }
-
private:
//DATA
- MutableBidirectionalHDS hds; // a halfedge data structure object
+ HDS hds; // a halfedge data structure object
};
} // close namespace concepts
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_bidirectional_hds_concept.t.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_bidirectional_hds_concept.t.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,261 @@
+//mutable_bidirectional_hds_concept.t.cpp -*- C++ -*-
+//
+//@OVERVIEW: The component under test is a concept-checking class. We
+// proceed with the standard test plan for such a class.
+//
+//@TEST_PLAN: Create a (loose) archetype of the concept, and verify
+// (using the Boost.ConceptCheck library macros) that it satisfies all
+// the concept requirements of the concept. Note that the purpose of
+// this test driver is to verify the validity of the concept checking
+// class, not of the archetype. This is why it suffices to take the
+// 'halfedge_descriptor' as an 'int', although a real archetype would make
+// this into a custom-made class with the tailored minimal requirements.
+
+#include <boost/hdstl/hds_concepts/mutable_bidirectional_hds_concept.hpp>
+#include <boost/test/minimal.hpp>
+#include <boost/concept_check.hpp>
+
+namespace hdstl1 {
+
+ struct TT : public boost::hdstl::bidirectional_traversal_tag {};
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ struct mutable_bidirectional_hds_archetype {
+ // This 'struct', intentionally defined in a namespace different from
+ // 'hdstl', the 'hds_traits' specialization defined in the namespace
+ // 'hdstl', and the supporting functions 'opposite', 'next_in_facet',
+ // 'next_at_source', and 'next_at_target' defined in the same namespace
+ // as this 'struct' to take advantage of ADL (argument-dependent
+ // lookup) provide an archetype for the 'MutableForwardHDS' concept.
+
+ typedef int halfedge_descriptor;
+ typedef TT traversal_category;
+ typedef ForwardCategory forward_category;
+ typedef BackwardCategory backward_category;
+ };
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor
+ opposite(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor h,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor
+ next_in_facet(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor h,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor
+ next_at_source(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor h,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor
+ next_at_target(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor h,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ void
+ set_next_in_facet(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ void
+ set_next_at_source(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ void
+ set_next_at_target(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor
+ prev_in_facet(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor h,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor
+ prev_at_source(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor h,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor
+ prev_at_target(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor h,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ return h;
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ void
+ set_prev_in_facet(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ void
+ set_prev_at_source(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ void
+ set_prev_at_target(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ const mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor
+ new_edge(mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ return typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor();
+ }
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ void
+ delete_edge(typename mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor,
+ mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>&)
+ {
+ }
+
+} // namespace hdstl
+
+namespace boost {
+namespace hdstl {
+
+ template<typename ForwardCategory, typename BackwardCategory>
+ struct hds_traits<hdstl1::mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory> >
+ {
+ typedef typename hdstl1::mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::halfedge_descriptor
+ halfedge_descriptor;
+ typedef typename hdstl1::mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::traversal_category
+ traversal_category;
+ typedef typename hdstl1::mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::forward_category
+ forward_category;
+ typedef typename hdstl1::mutable_bidirectional_hds_archetype<
+ ForwardCategory, BackwardCategory>::backward_category
+ backward_category;
+ enum { supports_vertices = false};
+ static const int supports_facets = true;
+ };
+
+} // namespace hdstl
+} // namespace boost
+
+// ===========================================================================
+// BOOST TEST APPARATUS
+// ===========================================================================
+
+template <class HDS>
+struct class_concept_requirements
+{
+ BOOST_CLASS_REQUIRE(HDS, boost::hdstl::concepts, MutableBidirectionalHDSConcept);
+};
+
+template <class HDS>
+bool concept_requirements()
+{
+ boost::function_requires<
+ boost::hdstl::concepts::MutableBidirectionalHDSConcept<HDS> >();
+ class_concept_requirements<HDS>(); // force instantiation
+ return true;
+}
+
+int test_main(int, char **)
+{
+ BOOST_CHECK(( concept_requirements<
+ hdstl1::mutable_bidirectional_hds_archetype<
+ boost::hdstl::next_in_facet_tag,boost::hdstl::prev_in_facet_tag> >() ));
+
+ BOOST_CHECK(( concept_requirements<
+ hdstl1::mutable_bidirectional_hds_archetype<
+ boost::hdstl::next_at_source_tag,boost::hdstl::prev_at_source_tag> >() ));
+
+ BOOST_CHECK(( concept_requirements<
+ hdstl1::mutable_bidirectional_hds_archetype<
+ boost::hdstl::next_at_source_tag,boost::hdstl::prev_at_target_tag> >() ));
+
+ return 0;
+}
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_facet_hds_concept.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_facet_hds_concept.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,4 @@
+// mutable_facet_hds_concept.cpp -*- C++ -*-
+
+#include <boost/hdstl/hds_concepts/mutable_facet_hds_concept.hpp>
+
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_facet_hds_concept.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_facet_hds_concept.hpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_facet_hds_concept.hpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -79,7 +79,8 @@
//..
// template <class HDS>
// struct MutableFacetHDSConcept {
-// typedef typename hds_traits<HDS>::facet_descriptor facet_descriptor;
+// typedef typename hds_traits<HDS>::halfedge_descriptor halfedge_descriptor;
+// typedef typename hds_traits<HDS>::facet_descriptor facet_descriptor;
// void constraints() {
// using namespace boost;
// function_requires<HDSConcept>();
@@ -103,7 +104,10 @@
#ifndef BOOST_HDSTL_CONCEPTS_MUTABLE_FACET_HDS_CONCEPT_HPP
#define BOOST_HDSTL_CONCEPTS_MUTABLE_FACET_HDS_CONCEPT_HPP 1
-#include <boost/concepts.h>
+#include <boost/concept_check.hpp>
+#include <boost/hdstl/hds_traits.hpp>
+#include <boost/hdstl/hds_concepts/facet_hds_concept.hpp>
+#include <boost/hdstl/hds_concepts/mutable_hds_concept.hpp>
namespace boost {
namespace hdstl{
@@ -124,6 +128,7 @@
// if the type HDS does not model the 'MutableFacetHDSConcept'.
// OPAQUE TYPES
+ typedef typename hds_traits<HDS>::halfedge_descriptor halfedge_descriptor;
typedef typename hds_traits<HDS>::facet_descriptor facet_descriptor;
// The specialization of 'hds_traits<HDS>' must have these required
// types, obeying the types requirements stated in the detailed
@@ -137,7 +142,8 @@
// [mutablefacethdsconcept].
{
using namespace boost;
- function_requires<HDSConcept>();
+ function_requires<FacetHDSConcept<HDS> >();
+ function_requires<MutableHDSConcept<HDS> >();
function_requires<DefaultConstructibleConcept<facet_descriptor> >();
function_requires<CopyConstructibleConcept<facet_descriptor> >();
function_requires<EqualityComparableConcept<facet_descriptor> >();
@@ -146,19 +152,11 @@
set_facet(h, f, hds);
f = new_facet(hds);
delete_facet(f, hds);
- const_constraints(hds);
- }
-
- // OPAQUE ACCESSORS
- void const_constraints(HDS const& hds)
- // Check that the non-modifiable 'HDS' template parameters
- // satisfies all the constraints of 'MutableFacetHDSConcept'.
- {
}
private:
//DATA
- MutableFacetHDS hds; // a halfedge data structure object
+ HDS hds; // a halfedge data structure object
halfedge_descriptor h; // a halfedge descriptor
facet_descriptor f; // a facet descriptor
};
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_facet_hds_concept.t.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_facet_hds_concept.t.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,118 @@
+// mutable_facet_hds_concept.t.cpp -*- C++ -*-
+//
+//@OVERVIEW: The component under test is a concept-checking class. We
+// proceed with the standard test plan for such a class.
+//
+//@TEST_PLAN: Create a (loose) archetype of the concept, and verify
+// (using the Boost.ConceptCheck library macros) that it satisfies all
+// the concept requirements of the concept. Note that the purpose of
+// this test driver is to verify the validity of the concept checking
+// class, not of the archetype. This is why it suffices to take the
+// 'halfedge_descriptor' as an 'int', although a real archetype would make
+// this into a custom-made class with the tailored minimal requirements.
+
+#include <boost/hdstl/hds_concepts/mutable_facet_hds_concept.hpp>
+#include <boost/test/minimal.hpp>
+#include <boost/concept_check.hpp>
+
+namespace hdstl1 {
+
+ struct mutable_facet_hds_archetype {
+ // This 'struct', intentionally defined in a namespace different from
+ // 'hdstl', the 'hds_traits' specialization defined in the namespace
+ // 'hdstl', and the supporting function 'opposite', defined in the same
+ // namespace as this 'struct' to take advantage of ADL
+ // (argument-dependent lookup) provide an archetype for the 'HDS'
+ // concept.
+
+ typedef int halfedge_descriptor;
+ typedef int facet_descriptor;
+ };
+
+ mutable_facet_hds_archetype::halfedge_descriptor
+ opposite(mutable_facet_hds_archetype::halfedge_descriptor h,
+ const mutable_facet_hds_archetype&)
+ {
+ return h;
+ }
+
+ mutable_facet_hds_archetype::facet_descriptor
+ facet(mutable_facet_hds_archetype::halfedge_descriptor,
+ const mutable_facet_hds_archetype&)
+ {
+ return mutable_facet_hds_archetype::facet_descriptor();
+ }
+
+ mutable_facet_hds_archetype::halfedge_descriptor
+ new_edge(mutable_facet_hds_archetype&)
+ {
+ return mutable_facet_hds_archetype::halfedge_descriptor();
+ }
+
+ void
+ delete_edge(mutable_facet_hds_archetype::halfedge_descriptor,
+ mutable_facet_hds_archetype&)
+ {
+ }
+
+ void
+ set_facet(mutable_facet_hds_archetype::halfedge_descriptor,
+ mutable_facet_hds_archetype::facet_descriptor,
+ mutable_facet_hds_archetype&)
+ {
+ }
+
+ mutable_facet_hds_archetype::facet_descriptor
+ new_facet(mutable_facet_hds_archetype&)
+ {
+ return mutable_facet_hds_archetype::facet_descriptor();
+ }
+
+ void
+ delete_facet(mutable_facet_hds_archetype::facet_descriptor,
+ mutable_facet_hds_archetype&)
+ {
+ }
+
+} // namespace hdstl1
+
+namespace boost {
+namespace hdstl {
+
+ template <>
+ struct hds_traits<hdstl1::mutable_facet_hds_archetype>
+ {
+ typedef hdstl1::mutable_facet_hds_archetype::halfedge_descriptor
+ halfedge_descriptor;
+ typedef hdstl1::mutable_facet_hds_archetype::facet_descriptor
+ facet_descriptor;
+ enum { supports_vertices = false};
+ static const int supports_facets = true;
+ };
+
+} // namespace hdstl
+} // namespace boost
+
+// ===========================================================================
+// BOOST TEST APPARATUS
+// ===========================================================================
+
+template <class HDS>
+struct class_concept_requirements
+{
+ BOOST_CLASS_REQUIRE(HDS, boost::hdstl::concepts, MutableFacetHDSConcept);
+};
+
+template <class HDS>
+bool concept_requirements()
+{
+ boost::function_requires<boost::hdstl::concepts::MutableFacetHDSConcept<HDS> >();
+ class_concept_requirements<HDS>(); // force instantiation
+ return true;
+}
+
+int test_main(int, char **)
+{
+ BOOST_CHECK(( concept_requirements<hdstl1::mutable_facet_hds_archetype>() ));
+ return 0;
+}
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_forward_hds_concept.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_forward_hds_concept.hpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_forward_hds_concept.hpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -93,13 +93,9 @@
// set_next_in_facet(h, g, hds);
// set_next_at_source(h, g, hds);
// set_next_at_target(h, g, hds);
-// const_constraints(hds);
-// }
-// void const_constraints(HDS const& hds)
-// {
// }
// private:
-// MutableForwardHDS hds;
+// HDS hds;
// halfedge_descriptor h,g;
// };
//..
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_forward_hds_concept.t.cpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_forward_hds_concept.t.cpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_forward_hds_concept.t.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -24,10 +24,9 @@
// This 'struct', intentionally defined in a namespace different from
// 'hdstl', the 'hds_traits' specialization defined in the namespace
// 'hdstl', and the supporting functions 'opposite', 'next_in_facet',
- // 'next_at_source', and 'next_at_target' defined in the same
- // namespace as this 'struct' to take advantage of ADL
- // (argument-dependent lookup) provide an archetype for the 'MutableForwardHDS'
- // concept.
+ // 'next_at_source', and 'next_at_target' defined in the same namespace
+ // as this 'struct' to take advantage of ADL (argument-dependent
+ // lookup) provide an archetype for the 'MutableForwardHDS' concept.
typedef int halfedge_descriptor;
typedef TT traversal_category;
@@ -104,12 +103,14 @@
typename mutable_forward_hds_archetype<ForwardCategory>::halfedge_descriptor
new_edge(mutable_forward_hds_archetype<ForwardCategory>&)
{
- return typename mutable_forward_hds_archetype<ForwardCategory>::halfedge_descriptor();
+ return typename mutable_forward_hds_archetype<ForwardCategory>
+ ::halfedge_descriptor();
}
template<typename ForwardCategory>
void
- delete_edge(typename mutable_forward_hds_archetype<ForwardCategory>::halfedge_descriptor,
+ delete_edge(typename mutable_forward_hds_archetype<ForwardCategory>
+ ::halfedge_descriptor,
mutable_forward_hds_archetype<ForwardCategory>&)
{
}
@@ -151,7 +152,8 @@
template <class HDS>
bool concept_requirements()
{
- boost::function_requires<boost::hdstl::concepts::MutableForwardHDSConcept<HDS> >();
+ boost::function_requires<
+ boost::hdstl::concepts::MutableForwardHDSConcept<HDS> >();
class_concept_requirements<HDS>(); // force instantiation
return true;
}
@@ -159,10 +161,13 @@
int test_main(int, char **)
{
BOOST_CHECK(( concept_requirements<
- hdstl1::mutable_forward_hds_archetype<boost::hdstl::next_in_facet_tag> >() ));
+ hdstl1::mutable_forward_hds_archetype<
+ boost::hdstl::next_in_facet_tag> >() ));
BOOST_CHECK(( concept_requirements<
- hdstl1::mutable_forward_hds_archetype<boost::hdstl::next_at_source_tag> >() ));
+ hdstl1::mutable_forward_hds_archetype<
+ boost::hdstl::next_at_source_tag> >() ));
BOOST_CHECK(( concept_requirements<
- hdstl1::mutable_forward_hds_archetype<boost::hdstl::next_at_target_tag> >() ));
+ hdstl1::mutable_forward_hds_archetype<
+ boost::hdstl::next_at_target_tag> >() ));
return 0;
}
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_hds_concept.t.cpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_hds_concept.t.cpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_hds_concept.t.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -44,7 +44,8 @@
void
delete_edge(mutable_hds_archetype::halfedge_descriptor,
mutable_hds_archetype&)
- { }
+ {
+ }
} // namespace hdstl
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_vertex_hds_concept.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_vertex_hds_concept.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,4 @@
+// mutable_vertex_hds_concept.cpp -*- C++ -*-
+
+#include <boost/hdstl/hds_concepts/mutable_vertex_hds_concept.hpp>
+
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_vertex_hds_concept.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_vertex_hds_concept.hpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_vertex_hds_concept.hpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -53,7 +53,7 @@
///--------------------
// In addition to the expression semantics of the 'VertexHDS' and the
// 'MutableHDS' concepts:
-// - 'set_vertex(h, v, hds)' sets the source vertex descriptor value of 'h' to
+// - 'set_vertex(h, v, hds)' sets the source vertex descriptor value of 'h' to
// 'v' for a single halfedge in the 'hds' data structure.
// - 'new_vertex(hds)' adds a new vertex 'v' to the 'hds' data structure.
// By this operation the vertex is added but no connections to the halfedges
@@ -81,11 +81,12 @@
//..
// template <class HDS>
// struct MutableVertexHDSConcept {
-// typedef typename hds_traits<HDS>::vertex_descriptor vertex_descriptor;
+// typedef typename hds_traits<HDS>::halfedge_descriptor halfedge_descriptor;
+// typedef typename hds_traits<HDS>::vertex_descriptor vertex_descriptor;
// void constraints() {
// using namespace boost;
-// function_requires<HDSConcept>();
-// function_requires<VertexHDSConcept>();
+// function_requires<MutableHDSConcept<HDS> >();
+// function_requires<VertexHDSConcept<HDS>> >();
// function_requires<DefaultConstructibleConcept<vertex_descriptor> >();
// function_requires<CopyConstructibleConcept<vertex_descriptor> >();
// function_requires<EqualityComparableConcept<vertex_descriptor> >();
@@ -93,10 +94,7 @@
//
// set_vertex(h, v, hds);
// v = new_vertex(hds);
-// remove_vertex(h, v, hds);
-// const_constraints(hds);
-// }
-// void const_constraints(HDS const& hds) {
+// delete_vertex(v, hds);
// }
// HDS hds;
// halfedge_descriptor h;
@@ -107,7 +105,10 @@
#ifndef BOOST_HDSTL_CONCEPTS_MUTABLE_VERTEX_HDS_CONCEPT_HPP
#define BOOST_HDSTL_CONCEPTS_MUTABLE_VERTEX_HDS_CONCEPT_HPP 1
-#include <boost/concepts.h>
+#include <boost/concept_check.hpp>
+#include <boost/hdstl/hds_traits.hpp>
+#include <boost/hdstl/hds_concepts/vertex_hds_concept.hpp>
+#include <boost/hdstl/hds_concepts/mutable_hds_concept.hpp>
namespace boost {
namespace hdstl{
@@ -128,6 +129,7 @@
// if the type HDS does not model the 'MutableVertexHDSConcept'.
// OPAQUE TYPES
+ typedef typename hds_traits<HDS>::halfedge_descriptor halfedge_descriptor;
typedef typename hds_traits<HDS>::vertex_descriptor vertex_descriptor;
// The specialization of 'hds_traits<HDS>' must have these required
// types, obeying the types requirements stated in the detailed
@@ -141,8 +143,8 @@
// [mutablevertexhdsconcept].
{
using namespace boost;
- function_requires<HDSConcept>();
- function_requires<VertexHDSConcept>();
+ function_requires<MutableHDSConcept<HDS> >();
+ function_requires<VertexHDSConcept<HDS> >();
function_requires<DefaultConstructibleConcept<vertex_descriptor> >();
function_requires<CopyConstructibleConcept<vertex_descriptor> >();
function_requires<EqualityComparableConcept<vertex_descriptor> >();
@@ -150,21 +152,12 @@
set_vertex(h, v, hds);
v = new_vertex(hds);
- remove_vertex(hds,v);
-
- const_constraints(hds);
- }
-
- // OPAQUE ACCESSORS
- void const_constraints(HDS const& hds)
- // Check that the non-modifiable 'HDS' template parameters
- // satisfies all the constraints of 'MutableVertexHDSConcept'.
- {
+ delete_vertex(v, hds);
}
private:
//DATA
- MutableVertexHDS hds; // a halfedge data structure object
+ HDS hds; // a halfedge data structure object
halfedge_descriptor h; // a vertex descriptor
vertex_descriptor v; // a vertex descriptor
};
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_vertex_hds_concept.t.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_concepts/mutable_vertex_hds_concept.t.cpp 2007-06-29 19:12:08 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,132 @@
+// mutable_vertex_hds_concept.t.cpp -*- C++ -*-
+//
+//@OVERVIEW: The component under test is a concept-checking class. We
+// proceed with the standard test plan for such a class.
+//
+//@TEST_PLAN: Create a (loose) archetype of the concept, and verify
+// (using the Boost.ConceptCheck library macros) that it satisfies all
+// the concept requirements of the concept. Note that the purpose of
+// this test driver is to verify the validity of the concept checking
+// class, not of the archetype. This is why it suffices to take the
+// 'halfedge_descriptor' as an 'int', although a real archetype would make
+// this into a custom-made class with the tailored minimal requirements.
+
+#include <boost/hdstl/hds_concepts/mutable_vertex_hds_concept.hpp>
+#include <boost/test/minimal.hpp>
+#include <boost/concept_check.hpp>
+
+namespace hdstl1 {
+
+ struct mutable_vertex_hds_archetype {
+ // This 'struct', intentionally defined in a namespace different from
+ // 'hdstl', the 'hds_traits' specialization defined in the namespace
+ // 'hdstl', and the supporting function 'opposite', defined in the same
+ // namespace as this 'struct' to take advantage of ADL
+ // (argument-dependent lookup) provide an archetype for the 'HDS'
+ // concept.
+
+ typedef int halfedge_descriptor;
+ typedef int vertex_descriptor;
+ };
+
+ mutable_vertex_hds_archetype::halfedge_descriptor
+ opposite(mutable_vertex_hds_archetype::halfedge_descriptor h,
+ const mutable_vertex_hds_archetype&)
+ {
+ return h;
+ }
+
+ mutable_vertex_hds_archetype::vertex_descriptor
+ vertex(mutable_vertex_hds_archetype::halfedge_descriptor,
+ const mutable_vertex_hds_archetype&)
+ {
+ return mutable_vertex_hds_archetype::vertex_descriptor();
+ }
+
+ mutable_vertex_hds_archetype::halfedge_descriptor
+ new_edge(mutable_vertex_hds_archetype&)
+ {
+ return mutable_vertex_hds_archetype::halfedge_descriptor();
+ }
+
+ void
+ delete_edge(mutable_vertex_hds_archetype::halfedge_descriptor,
+ mutable_vertex_hds_archetype&)
+ {
+ }
+
+ void
+ set_vertex(mutable_vertex_hds_archetype::halfedge_descriptor,
+ mutable_vertex_hds_archetype::vertex_descriptor,
+ mutable_vertex_hds_archetype&)
+ {
+ }
+
+ mutable_vertex_hds_archetype::vertex_descriptor
+ new_vertex(mutable_vertex_hds_archetype&)
+ {
+ return mutable_vertex_hds_archetype::vertex_descriptor();
+ }
+
+ void
+ delete_vertex(mutable_vertex_hds_archetype::vertex_descriptor,
+ mutable_vertex_hds_archetype&)
+ {
+ }
+
+ mutable_vertex_hds_archetype::vertex_descriptor
+ source(mutable_vertex_hds_archetype::halfedge_descriptor,
+ const mutable_vertex_hds_archetype&)
+ {
+ return mutable_vertex_hds_archetype::vertex_descriptor();
+ }
+
+ mutable_vertex_hds_archetype::vertex_descriptor
+ target(mutable_vertex_hds_archetype::halfedge_descriptor,
+ const mutable_vertex_hds_archetype&)
+ {
+ return mutable_vertex_hds_archetype::vertex_descriptor();
+ }
+
+} // namespace hdstl1
+
+namespace boost {
+namespace hdstl {
+
+ template <>
+ struct hds_traits<hdstl1::mutable_vertex_hds_archetype>
+ {
+ typedef hdstl1::mutable_vertex_hds_archetype::halfedge_descriptor
+ halfedge_descriptor;
+ typedef hdstl1::mutable_vertex_hds_archetype::vertex_descriptor
+ vertex_descriptor;
+ enum { supports_vertices = true};
+ static const int supports_facets = false;
+ };
+
+} // namespace hdstl
+} // namespace boost
+
+// ===========================================================================
+// BOOST TEST APPARATUS
+// ===========================================================================
+
+template <class HDS>
+struct class_concept_requirements
+{
+ BOOST_CLASS_REQUIRE(HDS, boost::hdstl::concepts, MutableVertexHDSConcept);
+};
+
+template <class HDS>
+bool concept_requirements()
+{
+ boost::function_requires<boost::hdstl::concepts::MutableVertexHDSConcept<HDS> >();
+ class_concept_requirements<HDS>(); // force instantiation
+ return true;
+}
+
+int test_main(int, char **)
+{
+ BOOST_CHECK(( concept_requirements<hdstl1::mutable_vertex_hds_archetype>() ));
+ return 0;
+}
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