projects
/
libcds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed redundant spaces
[libcds.git]
/
test
/
stress
/
pqueue
/
pqueue_type.h
diff --git
a/test/stress/pqueue/pqueue_type.h
b/test/stress/pqueue/pqueue_type.h
index 1df733d17b31f028f867d6146616b567f77f3471..60b86f70675350c5eae585f91e03f1b933235171 100644
(file)
--- a/
test/stress/pqueue/pqueue_type.h
+++ b/
test/stress/pqueue/pqueue_type.h
@@
-5,7
+5,7
@@
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@
-25,7
+25,7
@@
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSSTRESS_PQUEUE_TYPES_H
*/
#ifndef CDSSTRESS_PQUEUE_TYPES_H
@@
-92,7
+92,7
@@
namespace pqueue {
bool pop( value_type& dest )
{
scoped_lock l( m_Lock );
bool pop( value_type& dest )
{
scoped_lock l( m_Lock );
- if ( !m_PQueue.empty()
) {
+ if ( !m_PQueue.empty()) {
dest = m_PQueue.top();
m_PQueue.pop();
return true;
dest = m_PQueue.top();
m_PQueue.pop();
return true;
@@
-104,8
+104,8
@@
namespace pqueue {
bool pop_with( Q& dest, MoveFunc f )
{
scoped_lock l( m_Lock );
bool pop_with( Q& dest, MoveFunc f )
{
scoped_lock l( m_Lock );
- if ( !m_PQueue.empty()
) {
- f( dest, m_PQueue.top()
);
+ if ( !m_PQueue.empty()) {
+ f( dest, m_PQueue.top());
m_PQueue.pop();
return true;
}
m_PQueue.pop();
return true;
}
@@
-115,7
+115,7
@@
namespace pqueue {
void clear()
{
scoped_lock l( m_Lock );
void clear()
{
scoped_lock l( m_Lock );
- while ( !m_PQueue.empty()
)
+ while ( !m_PQueue.empty())
m_PQueue.pop();
}
m_PQueue.pop();
}
@@
-123,8
+123,8
@@
namespace pqueue {
void clear_with( Func f )
{
scoped_lock l( m_Lock );
void clear_with( Func f )
{
scoped_lock l( m_Lock );
- while ( !m_PQueue.empty()
) {
- f( m_PQueue.top()
);
+ while ( !m_PQueue.empty()) {
+ f( m_PQueue.top());
m_PQueue.pop();
}
}
m_PQueue.pop();
}
}
@@
-152,7
+152,7
@@
namespace pqueue {
template <typename T, typename Tree>
bool operator()( T& dest, Tree& container ) const
{
template <typename T, typename Tree>
bool operator()( T& dest, Tree& container ) const
{
- typename Tree::guarded_ptr gp( container.extract_max()
);
+ typename Tree::guarded_ptr gp( container.extract_max());
if ( gp )
dest = *gp;
return !gp.empty();
if ( gp )
dest = *gp;
return !gp.empty();
@@
-165,7
+165,7
@@
namespace pqueue {
template <typename T, typename Tree>
bool operator()( T& dest, Tree& container ) const
{
template <typename T, typename Tree>
bool operator()( T& dest, Tree& container ) const
{
- typename Tree::exempt_ptr ep( container.extract_max()
);
+ typename Tree::exempt_ptr ep( container.extract_max());
if ( ep )
dest = *ep;
return !ep.empty();
if ( ep )
dest = *ep;
return !ep.empty();
@@
-178,7
+178,7
@@
namespace pqueue {
template <typename T, typename Tree>
bool operator()( T& dest, Tree& container ) const
{
template <typename T, typename Tree>
bool operator()( T& dest, Tree& container ) const
{
- typename Tree::guarded_ptr gp( container.extract_min()
);
+ typename Tree::guarded_ptr gp( container.extract_min());
if ( gp )
dest = *gp;
return !gp.empty();
if ( gp )
dest = *gp;
return !gp.empty();
@@
-191,7
+191,7
@@
namespace pqueue {
template <typename T, typename Tree>
bool operator()( T& dest, Tree& container ) const
{
template <typename T, typename Tree>
bool operator()( T& dest, Tree& container ) const
{
- typename Tree::exempt_ptr ep( container.extract_min()
);
+ typename Tree::exempt_ptr ep( container.extract_min());
if ( ep )
dest = *ep;
return !ep.empty();
if ( ep )
dest = *ep;
return !ep.empty();
@@
-248,7
+248,7
@@
namespace pqueue {
template <typename T, typename Set>
bool operator()( T& dest, Set& container ) const
{
template <typename T, typename Set>
bool operator()( T& dest, Set& container ) const
{
- typename Set::guarded_ptr gp( container.extract_max()
);
+ typename Set::guarded_ptr gp( container.extract_max());
if ( gp )
dest = *gp;
return !gp.empty();
if ( gp )
dest = *gp;
return !gp.empty();
@@
-261,7
+261,7
@@
namespace pqueue {
template <typename T, typename Set>
bool operator()( T& dest, Set& container ) const
{
template <typename T, typename Set>
bool operator()( T& dest, Set& container ) const
{
- typename Set::exempt_ptr ep( container.extract_max()
);
+ typename Set::exempt_ptr ep( container.extract_max());
if ( ep )
dest = *ep;
return !ep.empty();
if ( ep )
dest = *ep;
return !ep.empty();
@@
-274,7
+274,7
@@
namespace pqueue {
template <typename T, typename Set>
bool operator()( T& dest, Set& container ) const
{
template <typename T, typename Set>
bool operator()( T& dest, Set& container ) const
{
- typename Set::guarded_ptr gp( container.extract_min()
);
+ typename Set::guarded_ptr gp( container.extract_min());
if ( gp )
dest = *gp;
return !gp.empty();
if ( gp )
dest = *gp;
return !gp.empty();
@@
-287,7
+287,7
@@
namespace pqueue {
template <typename T, typename Set>
bool operator()( T& dest, Set& container ) const
{
template <typename T, typename Set>
bool operator()( T& dest, Set& container ) const
{
- typename Set::exempt_ptr ep( container.extract_min()
);
+ typename Set::exempt_ptr ep( container.extract_min());
if ( ep )
dest = *ep;
return !ep.empty();
if ( ep )
dest = *ep;
return !ep.empty();
@@
-392,21
+392,19
@@
namespace pqueue {
{};
typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_static_mutex > MSPriorityQueue_static_mutex;
{};
typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_static_mutex > MSPriorityQueue_static_mutex;
- struct traits_MSPriorityQueue_dyn_less : public
- cc::mspriority_queue::make_traits<
- co::buffer< co::v::initialized_dynamic_buffer< char > >
- >::type
- {};
- typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_dyn_less > MSPriorityQueue_dyn_less;
+ struct traits_MSPriorityQueue_dyn: public cc::mspriority_queue::traits
+ {
+ typedef co::v::initialized_dynamic_buffer< char > buffer;
+ };
+ typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_dyn > MSPriorityQueue_dyn_less;
- struct traits_MSPriorityQueue_dyn_less_stat : public
- cc::mspriority_queue::make_traits <
- co::buffer< co::v::initialized_dynamic_buffer< char > >
- , co::stat < cc::mspriority_queue::stat<> >
- > ::type
- {};
+ struct traits_MSPriorityQueue_dyn_less_stat: public traits_MSPriorityQueue_dyn
+ {
+ typedef cc::mspriority_queue::stat<> stat;
+ };
typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_dyn_less_stat > MSPriorityQueue_dyn_less_stat;
typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_dyn_less_stat > MSPriorityQueue_dyn_less_stat;
+
struct traits_MSPriorityQueue_dyn_cmp : public
cc::mspriority_queue::make_traits <
co::buffer< co::v::initialized_dynamic_buffer< char > >
struct traits_MSPriorityQueue_dyn_cmp : public
cc::mspriority_queue::make_traits <
co::buffer< co::v::initialized_dynamic_buffer< char > >
@@
-619,7
+617,7
@@
namespace cds_test {
static inline property_stream& operator <<( property_stream& o, cds::container::fcpqueue::stat<> const& s )
{
static inline property_stream& operator <<( property_stream& o, cds::container::fcpqueue::stat<> const& s )
{
- return o
+ return o
<< CDSSTRESS_STAT_OUT( s, m_nPush )
<< CDSSTRESS_STAT_OUT( s, m_nPushMove )
<< CDSSTRESS_STAT_OUT( s, m_nPop )
<< CDSSTRESS_STAT_OUT( s, m_nPush )
<< CDSSTRESS_STAT_OUT( s, m_nPushMove )
<< CDSSTRESS_STAT_OUT( s, m_nPop )
@@
-640,7
+638,10
@@
namespace cds_test {
<< CDSSTRESS_STAT_OUT( s, m_nPushFailCount )
<< CDSSTRESS_STAT_OUT( s, m_nPopFailCount )
<< CDSSTRESS_STAT_OUT( s, m_nPushHeapifySwapCount )
<< CDSSTRESS_STAT_OUT( s, m_nPushFailCount )
<< CDSSTRESS_STAT_OUT( s, m_nPopFailCount )
<< CDSSTRESS_STAT_OUT( s, m_nPushHeapifySwapCount )
- << CDSSTRESS_STAT_OUT( s, m_nPopHeapifySwapCount );
+ << CDSSTRESS_STAT_OUT( s, m_nPopHeapifySwapCount )
+ << CDSSTRESS_STAT_OUT( s, m_nItemMovedTop )
+ << CDSSTRESS_STAT_OUT( s, m_nItemMovedUp )
+ << CDSSTRESS_STAT_OUT( s, m_nPushEmptyPass );
}
} // namespace cds_test
}
} // namespace cds_test