Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54382 - in sandbox/monotonic: boost/object_model boost/object_model/containers boost/object_model/detail boost/object_model/generic libs/object_model/src
From: christian.schladetsch_at_[hidden]
Date: 2009-06-26 15:50:37


Author: cschladetsch
Date: 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
New Revision: 54382
URL: http://svn.boost.org/trac/boost/changeset/54382

Log:
added containers

Added:
   sandbox/monotonic/boost/object_model/containers/
   sandbox/monotonic/boost/object_model/containers/list.hpp (contents, props changed)
   sandbox/monotonic/boost/object_model/containers/map.hpp (contents, props changed)
   sandbox/monotonic/boost/object_model/containers/set.hpp (contents, props changed)
   sandbox/monotonic/boost/object_model/containers/vector.hpp (contents, props changed)
   sandbox/monotonic/boost/object_model/field.hpp (contents, props changed)
   sandbox/monotonic/boost/object_model/method.hpp (contents, props changed)
Text files modified:
   sandbox/monotonic/boost/object_model/builder.hpp | 6 ++++--
   sandbox/monotonic/boost/object_model/detail/make_method.hpp | 26 ++++++++++++++++++++++++++
   sandbox/monotonic/boost/object_model/forward_declarations.hpp | 20 ++++++++++++++++++++
   sandbox/monotonic/boost/object_model/generic/method.hpp | 13 +++++++++++++
   sandbox/monotonic/boost/object_model/registry.hpp | 3 +++
   sandbox/monotonic/libs/object_model/src/object_model.vcproj | 28 ++++++++++++++++++++++++++++
   6 files changed, 94 insertions(+), 2 deletions(-)

Modified: sandbox/monotonic/boost/object_model/builder.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/builder.hpp (original)
+++ sandbox/monotonic/boost/object_model/builder.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -11,6 +11,7 @@
 
 #include <boost/object_model/detail/prefix.hpp>
 #include <boost/object_model/class.hpp>
+#include <boost/object_model/detail/make_method.hpp>
 
 BOOST_OM_BEGIN
 
@@ -18,11 +19,11 @@
 struct builder
 {
         typedef Reg registry_type;
- typedef typename Reg::traits_type system_traits;
         typedef type::traits<T> type_traits;
+ typedef typename Reg::traits_type system_traits;
 
 private:
- typename registry_type::rebind_klass<T>::type *my_klass;
+ typename registry_type::template rebind_klass<T>::type *my_klass;
 
 public:
         builder(registry_type &reg)
@@ -43,6 +44,7 @@
                 template <class Method>
                 methods_type &operator()(const char *name, Method method)
                 {
+ my_klass->add_method(name, detail::make_method(method));
                         return *this;
                 }
                 

Added: sandbox/monotonic/boost/object_model/containers/list.hpp
==============================================================================
--- (empty file)
+++ sandbox/monotonic/boost/object_model/containers/list.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -0,0 +1,22 @@
+// (C) 2009 Christian Schladetsch
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// documentation at https://svn.boost.org/svn/boost/sandbox/monotonic/libs/object_model/doc/index.html
+// sandbox at https://svn.boost.org/svn/boost/sandbox/monotonic/object_model/
+
+#ifndef BOOST_OBJECT_MODEL_CONTAINERS_LIST_HPP
+#define BOOST_OBJECT_MODEL_CONTAINERS_LIST_HPP
+
+#include <boost/object_model/detail/prefix.hpp>
+
+BOOST_OM_BEGIN
+
+BOOST_OM_END
+
+#include <boost/object_model/detail/postfix.hpp>
+
+#endif // BOOST_OBJECT_MODEL_CONTAINERS_LIST_HPP
+
+//EOF

Added: sandbox/monotonic/boost/object_model/containers/map.hpp
==============================================================================
--- (empty file)
+++ sandbox/monotonic/boost/object_model/containers/map.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -0,0 +1,22 @@
+// (C) 2009 Christian Schladetsch
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// documentation at https://svn.boost.org/svn/boost/sandbox/monotonic/libs/object_model/doc/index.html
+// sandbox at https://svn.boost.org/svn/boost/sandbox/monotonic/object_model/
+
+#ifndef BOOST_OBJECT_MODEL_CONTAINERS_MAP_HPP
+#define BOOST_OBJECT_MODEL_CONTAINERS_MAP_HPP
+
+#include <boost/object_model/detail/prefix.hpp>
+
+BOOST_OM_BEGIN
+
+BOOST_OM_END
+
+#include <boost/object_model/detail/postfix.hpp>
+
+#endif // BOOST_OBJECT_MODEL_CONTAINERS_MAP_HPP
+
+//EOF

Added: sandbox/monotonic/boost/object_model/containers/set.hpp
==============================================================================
--- (empty file)
+++ sandbox/monotonic/boost/object_model/containers/set.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -0,0 +1,22 @@
+// (C) 2009 Christian Schladetsch
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// documentation at https://svn.boost.org/svn/boost/sandbox/monotonic/libs/object_model/doc/index.html
+// sandbox at https://svn.boost.org/svn/boost/sandbox/monotonic/object_model/
+
+#ifndef BOOST_OBJECT_MODEL_CONTAINERS_SET_HPP
+#define BOOST_OBJECT_MODEL_CONTAINERS_SET_HPP
+
+#include <boost/object_model/detail/prefix.hpp>
+
+BOOST_OM_BEGIN
+
+BOOST_OM_END
+
+#include <boost/object_model/detail/postfix.hpp>
+
+#endif // BOOST_OBJECT_MODEL_CONTAINERS_SET_HPP
+
+//EOF

Added: sandbox/monotonic/boost/object_model/containers/vector.hpp
==============================================================================
--- (empty file)
+++ sandbox/monotonic/boost/object_model/containers/vector.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -0,0 +1,42 @@
+// (C) 2009 Christian Schladetsch
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// documentation at https://svn.boost.org/svn/boost/sandbox/monotonic/libs/object_model/doc/index.html
+// sandbox at https://svn.boost.org/svn/boost/sandbox/monotonic/object_model/
+
+#ifndef BOOST_OBJECT_MODEL_CONTAINERS_VECTOR_HPP
+#define BOOST_OBJECT_MODEL_CONTAINERS_VECTOR_HPP
+
+#include <boost/object_model/detail/prefix.hpp>
+#include <boost/object_model/generic/object.hpp>
+
+BOOST_OM_BEGIN
+
+namespace containers
+{
+ template <class Alloc>
+ struct vector
+ {
+ //typedef boost::containers::vector<object, Alloc> implementation;
+ typedef std::vector<object, Alloc> implementation;
+ typedef typename implementation::value_type value_type;
+ typedef typename implementation::iterator iterator;
+ typedef typename implementation::const_iterator const_iterator;
+
+ private:
+ implementation impl;
+
+ public:
+ };
+
+}
+
+BOOST_OM_END
+
+#include <boost/object_model/detail/postfix.hpp>
+
+#endif // BOOST_OBJECT_MODEL_CONTAINERS_VECTOR_HPP
+
+//EOF

Modified: sandbox/monotonic/boost/object_model/detail/make_method.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/detail/make_method.hpp (original)
+++ sandbox/monotonic/boost/object_model/detail/make_method.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -0,0 +1,26 @@
+// (C) 2009 Christian Schladetsch
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// documentation at https://svn.boost.org/svn/boost/sandbox/monotonic/libs/object_model/doc/index.html
+// sandbox at https://svn.boost.org/svn/boost/sandbox/monotonic/object_model/
+
+#ifndef BOOST_OBJECT_MODEL_DETAIL_MAKE_METHOD_HPP
+#define BOOST_OBJECT_MODEL_DETAIL_MAKE_METHOD_HPP
+
+#include <boost/object_model/detail/prefix.hpp>
+#include <boost/object_model/generic/method.hpp>
+#include <boost/object_model/method.hpp>
+
+BOOST_OM_BEGIN
+
+template
+
+BOOST_OM_END
+
+#include <boost/object_model/detail/postfix.hpp>
+
+#endif // BOOST_OBJECT_MODEL_DETAIL_MAKE_METHOD_HPP
+
+//EOF

Added: sandbox/monotonic/boost/object_model/field.hpp
==============================================================================
--- (empty file)
+++ sandbox/monotonic/boost/object_model/field.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -0,0 +1,22 @@
+// (C) 2009 Christian Schladetsch
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// documentation at https://svn.boost.org/svn/boost/sandbox/monotonic/libs/object_model/doc/index.html
+// sandbox at https://svn.boost.org/svn/boost/sandbox/monotonic/object_model/
+
+#ifndef BOOST_OBJECT_MODEL_FIELD_HPP
+#define BOOST_OBJECT_MODEL_FIELD_HPP
+
+#include <boost/object_model/detail/prefix.hpp>
+
+BOOST_OM_BEGIN
+
+BOOST_OM_END
+
+#include <boost/object_model/detail/postfix.hpp>
+
+#endif // BOOST_OBJECT_MODEL_FIELD_HPP
+
+//EOF

Modified: sandbox/monotonic/boost/object_model/forward_declarations.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/forward_declarations.hpp (original)
+++ sandbox/monotonic/boost/object_model/forward_declarations.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -149,6 +149,26 @@
 template <class Traits = system_traits<> >
 struct registry;
 
+namespace containers
+{
+ /// an array of objects given an allocator
+ template <class Al>
+ struct vector;
+
+ /// an list of objects given an allocator
+ template <class Al>
+ struct list;
+
+ /// an map of objects to objects given an allocator
+ template <class Al>
+ struct map;
+
+ /// an set of objects given an allocator
+ template <class Al>
+ struct set;
+
+}
+
 /// a sequence of executable objects
 struct continuation;
 

Modified: sandbox/monotonic/boost/object_model/generic/method.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/generic/method.hpp (original)
+++ sandbox/monotonic/boost/object_model/generic/method.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -12,15 +12,28 @@
 #include <boost/object_model/detail/prefix.hpp>
 #include <boost/object_model/label.hpp>
 #include <boost/object_model/type/signature.hpp>
+#include <boost/object_model/containers/vector.hpp>
 
 BOOST_OM_BEGIN
 
 namespace generic
 {
+ /// common base for all specific methods
         struct method
         {
+ private:
                 label name;
                 signature sig;
+ public:
+
+ virtual void invoke(object &servant, vector &args) const = 0;
+
+ template <class Traits>
+ typename Traits::string_type to_string(const object_model::registry<Traits> &reg) const
+ {
+ typename Traits::string_type s;
+ return s;
+ }
         };
 }
 

Added: sandbox/monotonic/boost/object_model/method.hpp
==============================================================================
--- (empty file)
+++ sandbox/monotonic/boost/object_model/method.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -0,0 +1,22 @@
+// (C) 2009 Christian Schladetsch
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// documentation at https://svn.boost.org/svn/boost/sandbox/monotonic/libs/object_model/doc/index.html
+// sandbox at https://svn.boost.org/svn/boost/sandbox/monotonic/object_model/
+
+#ifndef BOOST_OBJECT_MODEL_METHOD_HPP
+#define BOOST_OBJECT_MODEL_METHOD_HPP
+
+#include <boost/object_model/detail/prefix.hpp>
+
+BOOST_OM_BEGIN
+
+BOOST_OM_END
+
+#include <boost/object_model/detail/postfix.hpp>
+
+#endif // BOOST_OBJECT_MODEL_METHOD_HPP
+
+//EOF

Modified: sandbox/monotonic/boost/object_model/registry.hpp
==============================================================================
--- sandbox/monotonic/boost/object_model/registry.hpp (original)
+++ sandbox/monotonic/boost/object_model/registry.hpp 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -20,6 +20,7 @@
 #include <boost/object_model/exceptions.hpp>
 #include <boost/object_model/system_traits.hpp>
 #include <boost/object_model/object.hpp>
+#include <boost/object_model/containers/vector.hpp>
 
 //#define BOOST_OBJECT_MODEL_REGISTRY_USE_UNORDERED_MAPS
 
@@ -36,6 +37,8 @@
         typedef typename traits::string_type string_type;
         typedef typename traits::label_type label_type;
 
+ typedef containers::vector<allocator_type> vector_type;
+
         typedef registry<Tr> This, this_type;
 
         template <class T>

Modified: sandbox/monotonic/libs/object_model/src/object_model.vcproj
==============================================================================
--- sandbox/monotonic/libs/object_model/src/object_model.vcproj (original)
+++ sandbox/monotonic/libs/object_model/src/object_model.vcproj 2009-06-26 15:50:35 EDT (Fri, 26 Jun 2009)
@@ -270,6 +270,10 @@
>
                                 </File>
                                 <File
+ RelativePath="..\..\..\boost\object_model\field.hpp"
+ >
+ </File>
+ <File
                                         RelativePath="..\..\..\boost\object_model\forward_declarations.hpp"
>
                                 </File>
@@ -282,6 +286,10 @@
>
                                 </File>
                                 <File
+ RelativePath="..\..\..\boost\object_model\method.hpp"
+ >
+ </File>
+ <File
                                         RelativePath="..\..\..\boost\object_model\object.hpp"
>
                                 </File>
@@ -389,6 +397,26 @@
>
                                         </File>
                                 </Filter>
+ <Filter
+ Name="containers"
+ >
+ <File
+ RelativePath="..\..\..\boost\object_model\containers\list.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\object_model\containers\map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\object_model\containers\set.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\object_model\containers\vector.hpp"
+ >
+ </File>
+ </Filter>
                         </Filter>
                 </Filter>
                 <Filter


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