|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51164 - in sandbox/synchro/boost/synchro: dsl iccl
From: vicente.botet_at_[hidden]
Date: 2009-02-09 17:56:52
Author: viboes
Date: 2009-02-09 17:56:51 EST (Mon, 09 Feb 2009)
New Revision: 51164
URL: http://svn.boost.org/trac/boost/changeset/51164
Log:
Boost.Synchro V0.0.0
Added:
sandbox/synchro/boost/synchro/dsl/error_handling.hpp (contents, props changed)
sandbox/synchro/boost/synchro/dsl/thread_model.hpp (contents, props changed)
sandbox/synchro/boost/synchro/iccl/thread_locking_traits.hpp (contents, props changed)
Added: sandbox/synchro/boost/synchro/dsl/error_handling.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/dsl/error_handling.hpp 2009-02-09 17:56:51 EST (Mon, 09 Feb 2009)
@@ -0,0 +1,36 @@
+/* Copyright 2008 Vicente J. Botet Escriba
+ * 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)
+ *
+ * See http://www.boost.org/libs/luid for library home page.
+ */
+
+#ifndef BOOST_DSL_ERROR_HANDLING_HPP_
+#define BOOST_DSL_ERROR_HANDLING_HPP_
+
+#include <boost/detail/is_xxx.hpp>
+#include <boost/parameter/aux_/void.hpp>
+
+namespace boost {
+namespace dsl {
+
+template <typename dummy=parameter::void_>
+struct throw_on_error {};
+BOOST_DETAIL_IS_XXX_DEF(throw_on_error, throw_on_error, 1)
+
+template <typename dummy=parameter::void_>
+struct errno_on_error {};
+BOOST_DETAIL_IS_XXX_DEF(errno_on_error, errno_on_error, 1)
+
+template <typename dummy=parameter::void_>
+struct ignore_error {};
+BOOST_DETAIL_IS_XXX_DEF(ignore_error, ignore_error, 1)
+
+template <typename dummy=parameter::void_>
+struct user_error {};
+BOOST_DETAIL_IS_XXX_DEF(user_error, user_error, 1)
+
+}
+}
+#endif /*BOOST_DSL_ERROR_HANDLING_HPP_*/
Added: sandbox/synchro/boost/synchro/dsl/thread_model.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/dsl/thread_model.hpp 2009-02-09 17:56:51 EST (Mon, 09 Feb 2009)
@@ -0,0 +1,68 @@
+/* Copyright 2008 Vicente J. Botet Escriba
+ * 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)
+ *
+ * See http://www.boost.org/libs/luid for library home page.
+ */
+
+#ifndef BOOST_DSL_THREAD_MODEL_HPP_
+#define BOOST_DSL_THREAD_MODEL_HPP_
+
+#include <boost/detail/is_xxx.hpp>
+#include <boost/parameter/aux_/void.hpp>
+#include "boost/iccl/thread_locking_traits.hpp"
+//#include "boost/iccl/process_locking_traits.hpp"
+
+/* DSL:
+ *
+ * ThreadModel: mono_threaded | multi_threaded[LockingStrategy]
+ * ScopeModel: thread | inter_threads[LockingStrategy] | inter_process[LockingStrategy]
+ * LockingStrategy: externally_locked[MutexType] | internally_locked[MutexType, ScopedLockType]
+ *
+ */
+
+namespace boost {
+namespace dsl {
+// LockingStrategy
+template <typename LockingTraits=parameter::void_>
+struct externally_locked {
+ typedef LockingTraits locking_traits;
+};
+BOOST_DETAIL_IS_XXX_DEF(externally_locked, externally_locked, 1)
+
+template <typename LockingTraits=parameter::void_>
+struct internally_locked {
+ typedef LockingTraits locking_traits;
+};
+BOOST_DETAIL_IS_XXX_DEF(internally_locked, internally_locked, 1)
+
+template <typename LockingTraits=parameter::void_>
+struct no_locking {
+ typedef LockingTraits locking_traits;
+};
+BOOST_DETAIL_IS_XXX_DEF(no_locking, no_locking, 1)
+
+
+template <typename LockingStrategy=no_locking<iccl::null_locking_traits> >
+struct mono_threaded {
+ typedef LockingStrategy locking_strategy;
+};
+BOOST_DETAIL_IS_XXX_DEF(mono_threaded, mono_threaded, 1)
+
+template <typename LockingStrategy=internally_locked<iccl::thread_locking_traits> >
+struct multi_threaded {
+ typedef LockingStrategy locking_strategy;
+};
+BOOST_DETAIL_IS_XXX_DEF(multi_threaded, multi_threaded, 1)
+
+template <typename LockingStrategy=internally_locked<iccl::process_locking_traits> >
+struct multi_process {
+ typedef LockingStrategy locking_strategy;
+};
+BOOST_DETAIL_IS_XXX_DEF(multi_process, multi_process, 1)
+
+
+} // dsl
+} // boost
+#endif /*THREAD_MODEL_HPP_*/
Added: sandbox/synchro/boost/synchro/iccl/thread_locking_traits.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/iccl/thread_locking_traits.hpp 2009-02-09 17:56:51 EST (Mon, 09 Feb 2009)
@@ -0,0 +1,52 @@
+/* Copyright 2008 Vicente J. Botet Escriba
+ * 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)
+ *
+ * See http://www.boost.org/libs/luid for library home page.
+ */
+
+#ifndef BOOST_ICCL_THREAD_LOCKING_TRAITS_HPP_
+#define BOOST_ICCL_THREAD_LOCKING_TRAITS_HPP_
+
+#include "boost/thread/mutex.hpp"
+#include "boost/thread/locks.hpp"
+#include "boost/interprocess/sync/interprocess_mutex.hpp"
+#include "boost/interprocess/sync/scoped_lock.hpp"
+
+namespace boost {
+namespace iccl {
+
+namespace detail {
+struct null_tag{
+ template <typename T> null_tag(T&) {}
+};
+
+}
+struct null_locking_traits {
+ typedef detail::null_tag mutex_type;
+ typedef detail::null_tag scoped_lock;
+ static const int try_to_lock() {return 0;}
+};
+
+
+struct thread_locking_traits {
+ typedef boost::mutex mutex_type;
+ typedef boost::mutex::scoped_lock scoped_lock;
+ static const boost::try_to_lock_t try_to_lock() {return boost::try_to_lock;}
+};
+
+struct process_locking_traits {
+ typedef boost::interprocess::interprocess_mutex mutex_type;
+ typedef boost::interprocess::scoped_lock<mutex_type> scoped_lock;
+ static boost::interprocess::detail::try_to_lock_type try_to_lock()
+ {
+ return boost::interprocess::try_to_lock;
+ }
+};
+
+
+
+}
+}
+#endif // BOOST_LUID_THREAD_LOCKING_TRAITS_HPP_
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