|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67136 - in branches/release/boost/signals2: . detail
From: fmhess_at_[hidden]
Date: 2010-12-09 12:32:27
Author: fmhess
Date: 2010-12-09 12:32:23 EST (Thu, 09 Dec 2010)
New Revision: 67136
URL: http://svn.boost.org/trac/boost/changeset/67136
Log:
Merged from trunk to release. Fixes #4958.
Properties modified:
branches/release/boost/signals2/ (props changed)
Text files modified:
branches/release/boost/signals2/connection.hpp | 6 +-
branches/release/boost/signals2/detail/auto_buffer.hpp | 82 ++++++++++++++++++++--------------------
branches/release/boost/signals2/detail/signal_template.hpp | 52 +++++++++++++++---------
branches/release/boost/signals2/detail/slot_call_iterator.hpp | 4
branches/release/boost/signals2/preprocessed_signal.hpp | 4
5 files changed, 80 insertions(+), 68 deletions(-)
Modified: branches/release/boost/signals2/connection.hpp
==============================================================================
--- branches/release/boost/signals2/connection.hpp (original)
+++ branches/release/boost/signals2/connection.hpp 2010-12-09 12:32:23 EST (Thu, 09 Dec 2010)
@@ -40,7 +40,7 @@
virtual ~connection_body_base() {}
void disconnect()
{
- unique_lock<connection_body_base> lock(*this);
+ unique_lock<connection_body_base> local_lock(*this);
nolock_disconnect();
}
void nolock_disconnect()
@@ -50,7 +50,7 @@
virtual bool connected() const = 0;
shared_ptr<void> get_blocker()
{
- unique_lock<connection_body_base> lock(*this);
+ unique_lock<connection_body_base> local_lock(*this);
shared_ptr<void> blocker = _weak_blocker.lock();
if(blocker == shared_ptr<void>())
{
@@ -90,7 +90,7 @@
virtual ~connection_body() {}
virtual bool connected() const
{
- unique_lock<mutex_type> lock(_mutex);
+ unique_lock<mutex_type> local_lock(_mutex);
nolock_grab_tracked_objects(detail::null_output_iterator());
return nolock_nograb_connected();
}
Modified: branches/release/boost/signals2/detail/auto_buffer.hpp
==============================================================================
--- branches/release/boost/signals2/detail/auto_buffer.hpp (original)
+++ branches/release/boost/signals2/detail/auto_buffer.hpp 2010-12-09 12:32:23 EST (Thu, 09 Dec 2010)
@@ -158,19 +158,19 @@
optimized_const_reference;
private:
- pointer allocate( size_type capacity )
+ pointer allocate( size_type capacity_arg )
{
- if( capacity > N )
- return &*get_allocator().allocate( capacity );
+ if( capacity_arg > N )
+ return &*get_allocator().allocate( capacity_arg );
else
return static_cast<T*>( members_.address() );
}
- void deallocate( pointer where, size_type capacity )
+ void deallocate( pointer where, size_type capacity_arg )
{
- if( capacity <= N )
+ if( capacity_arg <= N )
return;
- get_allocator().deallocate( allocator_pointer(where), capacity );
+ get_allocator().deallocate( allocator_pointer(where), capacity_arg );
}
template< class I >
@@ -368,12 +368,12 @@
}
template< class I >
- void insert_impl( const_iterator before, I begin, I end,
+ void insert_impl( const_iterator before, I begin_arg, I end_arg,
std::input_iterator_tag )
{
- for( ; begin != end; ++begin )
+ for( ; begin_arg != end_arg; ++begin_arg )
{
- before = insert( before, *begin );
+ before = insert( before, *begin_arg );
++before;
}
}
@@ -411,10 +411,10 @@
}
template< class I >
- void insert_impl( const_iterator before, I begin, I end,
+ void insert_impl( const_iterator before, I begin_arg, I end_arg,
std::forward_iterator_tag )
{
- difference_type n = std::distance(begin,end);
+ difference_type n = std::distance(begin_arg, end_arg);
if( size_ + n <= members_.capacity_ )
{
@@ -424,11 +424,11 @@
grow_back( n );
iterator where = const_cast<T*>(before);
std::copy( before, cend() - n, where + n );
- assign_impl( begin, end, where );
+ assign_impl( begin_arg, end_arg, where );
}
else
{
- unchecked_push_back( begin, end );
+ unchecked_push_back( begin_arg, end_arg );
}
BOOST_ASSERT( is_valid() );
return;
@@ -436,7 +436,7 @@
auto_buffer temp( new_capacity_impl( size_ + n ) );
temp.unchecked_push_back( cbegin(), before );
- temp.unchecked_push_back( begin, end );
+ temp.unchecked_push_back( begin_arg, end_arg );
temp.unchecked_push_back( before, cend() );
one_sided_swap( temp );
BOOST_ASSERT( is_valid() );
@@ -528,53 +528,53 @@
return *this;
}
- explicit auto_buffer( size_type capacity )
- : members_( (std::max)(capacity,size_type(N)) ),
+ explicit auto_buffer( size_type capacity_arg )
+ : members_( (std::max)(capacity_arg, size_type(N)) ),
buffer_( allocate(members_.capacity_) ),
size_( 0 )
{
BOOST_ASSERT( is_valid() );
}
- auto_buffer( size_type size, optimized_const_reference init_value )
- : members_( (std::max)(size,size_type(N)) ),
+ auto_buffer( size_type size_arg, optimized_const_reference init_value )
+ : members_( (std::max)(size_arg, size_type(N)) ),
buffer_( allocate(members_.capacity_) ),
size_( 0 )
{
- std::uninitialized_fill( buffer_, buffer_ + size, init_value );
- size_ = size;
+ std::uninitialized_fill( buffer_, buffer_ + size_arg, init_value );
+ size_ = size_arg;
BOOST_ASSERT( is_valid() );
}
- auto_buffer( size_type capacity, const allocator_type& a )
+ auto_buffer( size_type capacity_arg, const allocator_type& a )
: allocator_type( a ),
- members_( (std::max)(capacity,size_type(N)) ),
+ members_( (std::max)(capacity_arg, size_type(N)) ),
buffer_( allocate(members_.capacity_) ),
size_( 0 )
{
BOOST_ASSERT( is_valid() );
}
- auto_buffer( size_type size, optimized_const_reference init_value,
+ auto_buffer( size_type size_arg, optimized_const_reference init_value,
const allocator_type& a )
: allocator_type( a ),
- members_( (std::max)(size,size_type(N)) ),
+ members_( (std::max)(size_arg, size_type(N)) ),
buffer_( allocate(members_.capacity_) ),
size_( 0 )
{
std::uninitialized_fill( buffer_, buffer_ + size, init_value );
- size_ = size;
+ size_ = size_arg;
BOOST_ASSERT( is_valid() );
}
template< class ForwardIterator >
- auto_buffer( ForwardIterator begin, ForwardIterator end )
+ auto_buffer( ForwardIterator begin_arg, ForwardIterator end_arg )
:
- members_( std::distance(begin,end) ),
+ members_( std::distance(begin_arg, end_arg) ),
buffer_( allocate(members_.capacity_) ),
size_( 0 )
{
- copy_impl( begin, end, buffer_ );
+ copy_impl( begin_arg, end_arg, buffer_ );
size_ = members_.capacity_;
if( members_.capacity_ < N )
members_.capacity_ = N;
@@ -582,14 +582,14 @@
}
template< class ForwardIterator >
- auto_buffer( ForwardIterator begin, ForwardIterator end,
+ auto_buffer( ForwardIterator begin_arg, ForwardIterator end_arg,
const allocator_type& a )
: allocator_type( a ),
- members_( std::distance(begin,end) ),
+ members_( std::distance(begin_arg, end_arg) ),
buffer_( allocate(members_.capacity_) ),
size_( 0 )
{
- copy_impl( begin, end, buffer_ );
+ copy_impl( begin_arg, end_arg, buffer_ );
size_ = members_.capacity_;
if( members_.capacity_ < N )
members_.capacity_ = N;
@@ -766,12 +766,12 @@
}
template< class ForwardIterator >
- void unchecked_push_back( ForwardIterator begin,
- ForwardIterator end ) // non-growing
+ void unchecked_push_back( ForwardIterator begin_arg,
+ ForwardIterator end_arg ) // non-growing
{
- BOOST_ASSERT( size_ + std::distance(begin,end) <= members_.capacity_ );
- copy_impl( begin, end, buffer_ + size_ );
- size_ += std::distance(begin,end);
+ BOOST_ASSERT( size_ + std::distance(begin_arg, end_arg) <= members_.capacity_ );
+ copy_impl( begin_arg, end_arg, buffer_ + size_ );
+ size_ += std::distance(begin_arg, end_arg);
}
void reserve_precisely( size_type n )
@@ -822,12 +822,12 @@
}
template< class ForwardIterator >
- void push_back( ForwardIterator begin, ForwardIterator end )
+ void push_back( ForwardIterator begin_arg, ForwardIterator end_arg )
{
- difference_type diff = std::distance(begin,end);
+ difference_type diff = std::distance(begin_arg, end_arg);
if( size_ + diff > members_.capacity_ )
reserve( size_ + diff );
- unchecked_push_back( begin, end );
+ unchecked_push_back( begin_arg, end_arg );
}
iterator insert( const_iterator before, optimized_const_reference x ) // basic
@@ -887,11 +887,11 @@
template< class ForwardIterator >
void insert( const_iterator before,
- ForwardIterator begin, ForwardIterator end ) // basic
+ ForwardIterator begin_arg, ForwardIterator end_arg ) // basic
{
typedef typename std::iterator_traits<ForwardIterator>
::iterator_category category;
- insert_impl( before, begin, end, category() );
+ insert_impl( before, begin_arg, end_arg, category() );
}
void pop_back()
Modified: branches/release/boost/signals2/detail/signal_template.hpp
==============================================================================
--- branches/release/boost/signals2/detail/signal_template.hpp (original)
+++ branches/release/boost/signals2/detail/signal_template.hpp 2010-12-09 12:32:23 EST (Thu, 09 Dec 2010)
@@ -151,9 +151,9 @@
typedef typename detail::slot_call_iterator_t<slot_invoker,
typename connection_list_type::iterator, connection_body<group_key_type, slot_type, Mutex> > slot_call_iterator;
- BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const combiner_type &combiner,
+ BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const combiner_type &combiner_arg,
const group_compare_type &group_compare):
- _shared_state(new invocation_state(connection_list_type(group_compare), combiner)),
+ _shared_state(new invocation_state(connection_list_type(group_compare), combiner_arg)),
_garbage_collector_it(_shared_state->connection_bodies().end())
{}
// connect slot
@@ -299,13 +299,13 @@
unique_lock<mutex_type> lock(_mutex);
return _shared_state->combiner();
}
- void set_combiner(const combiner_type &combiner)
+ void set_combiner(const combiner_type &combiner_arg)
{
unique_lock<mutex_type> lock(_mutex);
if(_shared_state.unique())
- _shared_state->combiner() = combiner;
+ _shared_state->combiner() = combiner_arg;
else
- _shared_state.reset(new invocation_state(*_shared_state, combiner));
+ _shared_state.reset(new invocation_state(*_shared_state, combiner_arg));
}
private:
typedef Mutex mutex_type;
@@ -316,9 +316,12 @@
{
public:
typedef nonvoid_slot_result_type result_type;
+// typename add_reference<Tn>::type
+#define BOOST_SIGNALS2_ADD_REF_TYPE(z, n, data) \
+ typename add_reference<BOOST_PP_CAT(T, BOOST_PP_INC(n))>::type
// typename add_reference<Tn>::type argn
#define BOOST_SIGNALS2_ADD_REF_ARG(z, n, data) \
- typename add_reference<BOOST_PP_CAT(T, BOOST_PP_INC(n))>::type \
+ BOOST_SIGNALS2_ADD_REF_TYPE(~, n, ~) \
BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
// typename add_reference<T1>::type arg1, typename add_reference<T2>::type arg2, ..., typename add_reference<Tn>::type argn
#define BOOST_SIGNALS2_ADD_REF_ARGS(arity) \
@@ -326,11 +329,13 @@
slot_invoker(BOOST_SIGNALS2_ADD_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS)) BOOST_PP_IF(BOOST_SIGNALS2_NUM_ARGS, :, )
#undef BOOST_SIGNALS2_ADD_REF_ARGS
-// argn ( argn ) ,
+// m_argn
+#define BOOST_SIGNALS2_M_ARG_NAME(z, n, data) BOOST_PP_CAT(m_arg, BOOST_PP_INC(n))
+// m_argn ( argn )
#define BOOST_SIGNALS2_MISC_STATEMENT(z, n, data) \
- BOOST_PP_CAT(arg, n) ( BOOST_PP_CAT(arg, n) )
-// arg1(arg1), arg2(arg2), ..., argn(argn)
- BOOST_PP_ENUM_SHIFTED(BOOST_PP_INC(BOOST_SIGNALS2_NUM_ARGS), BOOST_SIGNALS2_MISC_STATEMENT, ~)
+ BOOST_SIGNALS2_M_ARG_NAME(~, n, ~) ( BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~) )
+// m_arg1(arg1), m_arg2(arg2), ..., m_argn(argn)
+ BOOST_PP_ENUM(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_MISC_STATEMENT, ~)
#undef BOOST_SIGNALS2_MISC_STATEMENT
{}
result_type operator ()(const connection_body_type &connectionBody) const
@@ -340,22 +345,29 @@
resolver);
}
private:
-#define BOOST_SIGNALS2_ADD_REF_ARG_STATEMENT(z, n, data) \
- BOOST_SIGNALS2_ADD_REF_ARG(z, n, data) ;
- BOOST_PP_REPEAT(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_ADD_REF_ARG_STATEMENT, ~)
-#undef BOOST_SIGNALS2_ADD_REF_ARG_STATEMENT
+#define BOOST_SIGNALS2_ADD_REF_M_ARG_STATEMENT(z, n, data) \
+ BOOST_SIGNALS2_ADD_REF_TYPE(~, n, ~) BOOST_SIGNALS2_M_ARG_NAME(~, n, ~) ;
+ BOOST_PP_REPEAT(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_ADD_REF_M_ARG_STATEMENT, ~)
+#undef BOOST_SIGNALS2_ADD_REF_M_ARG_STATEMENT
#undef BOOST_SIGNALS2_ADD_REF_ARG
+#undef BOOST_SIGNALS2_ADD_REF_TYPE
+
+// m_arg1, m_arg2, ..., m_argn
+#define BOOST_SIGNALS2_M_ARG_NAMES(arity) BOOST_PP_ENUM(arity, BOOST_SIGNALS2_M_ARG_NAME, ~)
result_type m_invoke(const connection_body_type &connectionBody,
const void_type *) const
{
- connectionBody->slot.slot_function()(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ connectionBody->slot.slot_function()(BOOST_SIGNALS2_M_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
return void_type();
}
result_type m_invoke(const connection_body_type &connectionBody, ...) const
{
- return connectionBody->slot.slot_function()(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ return connectionBody->slot.slot_function()(BOOST_SIGNALS2_M_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
}
};
+#undef BOOST_SIGNALS2_M_ARG_NAMES
+#undef BOOST_SIGNALS2_M_ARG_NAME
+
#endif // BOOST_NO_VARIADIC_TEMPLATES
// a struct used to optimize (minimize) the number of shared_ptrs that need to be created
// inside operator()
@@ -636,9 +648,9 @@
#endif // BOOST_NO_VARIADIC_TEMPLATES
- BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const combiner_type &combiner = combiner_type(),
+ BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const combiner_type &combiner_arg = combiner_type(),
const group_compare_type &group_compare = group_compare_type()):
- _pimpl(new impl_class(combiner, group_compare))
+ _pimpl(new impl_class(combiner_arg, group_compare))
{};
virtual ~BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)()
{
@@ -695,9 +707,9 @@
{
return (*_pimpl).combiner();
}
- void set_combiner(const combiner_type &combiner)
+ void set_combiner(const combiner_type &combiner_arg)
{
- return (*_pimpl).set_combiner(combiner);
+ return (*_pimpl).set_combiner(combiner_arg);
}
protected:
virtual shared_ptr<void> lock_pimpl() const
Modified: branches/release/boost/signals2/detail/slot_call_iterator.hpp
==============================================================================
--- branches/release/boost/signals2/detail/slot_call_iterator.hpp (original)
+++ branches/release/boost/signals2/detail/slot_call_iterator.hpp 2010-12-09 12:32:23 EST (Thu, 09 Dec 2010)
@@ -30,8 +30,8 @@
class slot_call_iterator_cache
{
public:
- slot_call_iterator_cache(const Function &f):
- f(f),
+ slot_call_iterator_cache(const Function &f_arg):
+ f(f_arg),
connected_slot_count(0),
disconnected_slot_count(0)
{}
Modified: branches/release/boost/signals2/preprocessed_signal.hpp
==============================================================================
--- branches/release/boost/signals2/preprocessed_signal.hpp (original)
+++ branches/release/boost/signals2/preprocessed_signal.hpp 2010-12-09 12:32:23 EST (Thu, 09 Dec 2010)
@@ -44,8 +44,8 @@
typedef typename detail::signalN<boost::function_traits<Signature>::arity,
Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::type base_type;
public:
- signal(const Combiner &combiner = Combiner(), const GroupCompare &group_compare = GroupCompare()):
- base_type(combiner, group_compare)
+ signal(const Combiner &combiner_arg = Combiner(), const GroupCompare &group_compare = GroupCompare()):
+ base_type(combiner_arg, group_compare)
{}
};
}
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