Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
36491961
Commit
36491961
authored
Nov 05, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unused class `singly_linked_list`
parent
746c69fb
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
672 deletions
+79
-672
cppa.files
cppa.files
+77
-79
cppa/intrusive/forward_iterator.hpp
cppa/intrusive/forward_iterator.hpp
+0
-181
cppa/intrusive/singly_linked_list.hpp
cppa/intrusive/singly_linked_list.hpp
+0
-357
cppa/thread_mapped_actor.hpp
cppa/thread_mapped_actor.hpp
+0
-2
unit_testing/test__intrusive_containers.cpp
unit_testing/test__intrusive_containers.cpp
+2
-53
No files found.
cppa.files
View file @
36491961
cppa/detail/abstract_actor.hpp
cppa/event_based_actor.hpp
cppa/actor.hpp
cppa/actor.hpp
cppa/actor_addressing.hpp
cppa/actor_companion_mixin.hpp
cppa/actor_proxy.hpp
cppa/actor_proxy.hpp
cppa/announce.hpp
cppa/announce.hpp
cppa/any_tuple.hpp
cppa/any_tuple.hpp
...
@@ -12,40 +12,50 @@ cppa/binary_deserializer.hpp
...
@@ -12,40 +12,50 @@ cppa/binary_deserializer.hpp
cppa/binary_serializer.hpp
cppa/binary_serializer.hpp
cppa/channel.hpp
cppa/channel.hpp
cppa/config.hpp
cppa/config.hpp
cppa/context_switching_actor.hpp
cppa/cow_ptr.hpp
cppa/cow_ptr.hpp
cppa/cow_tuple.hpp
cppa/cow_tuple.hpp
cppa/cppa.hpp
cppa/cppa.hpp
cppa/cppa_fwd.hpp
cppa/deserializer.hpp
cppa/deserializer.hpp
cppa/detail/abstract_actor.hpp
cppa/detail/abstract_scheduled_actor.hpp
cppa/detail/abstract_scheduled_actor.hpp
cppa/detail/abstract_tuple.hpp
cppa/detail/abstract_tuple.hpp
cppa/detail/actor_count.hpp
cppa/detail/actor_count.hpp
cppa/actor_addressing.hpp
cppa/detail/actor_registry.hpp
cppa/detail/actor_registry.hpp
cppa/detail/atom_val.hpp
cppa/detail/atom_val.hpp
cppa/detail/behavior_impl.hpp
cppa/detail/behavior_stack.hpp
cppa/detail/boxed.hpp
cppa/detail/boxed.hpp
cppa/detail/channel.hpp
cppa/detail/channel.hpp
cppa/detail/container_tuple_view.hpp
cppa/detail/container_tuple_view.hpp
cppa/
thread_mapped_actor
.hpp
cppa/
detail/decorated_names_map
.hpp
cppa/detail/decorated_tuple.hpp
cppa/detail/decorated_tuple.hpp
cppa/detail/default_uniform_type_info_impl.hpp
cppa/detail/default_uniform_type_info_impl.hpp
cppa/detail/demangle.hpp
cppa/detail/demangle.hpp
cppa/detail/disablable_delete.hpp
cppa/detail/disablable_delete.hpp
cppa/detail/empty_tuple.hpp
cppa/detail/empty_tuple.hpp
cppa/detail/event_based_actor_factory.hpp
cppa/detail/fd_util.hpp
cppa/detail/get_behavior.hpp
cppa/detail/get_behavior.hpp
cppa/detail/group_manager.hpp
cppa/detail/group_manager.hpp
cppa/detail/implicit_conversions.hpp
cppa/detail/implicit_conversions.hpp
cppa/detail/matches.hpp
cppa/detail/matches.hpp
cppa/detail/object_array.hpp
cppa/detail/object_array.hpp
cppa/detail/object_impl.hpp
cppa/detail/object_impl.hpp
cppa/detail/opt_impls.hpp
cppa/detail/pair_member.hpp
cppa/detail/pair_member.hpp
cppa/detail/projection.hpp
cppa/detail/projection.hpp
cppa/detail/pseudo_tuple.hpp
cppa/detail/pseudo_tuple.hpp
cppa/detail/ptype_to_type.hpp
cppa/detail/ptype_to_type.hpp
cppa/detail/receive_loop_helper.hpp
cppa/detail/receive_loop_helper.hpp
cppa/detail/receive_policy.hpp
cppa/detail/recursive_queue_node.hpp
cppa/detail/recursive_queue_node.hpp
cppa/detail/scheduled_actor_dummy.hpp
cppa/detail/scheduled_actor_dummy.hpp
cppa/detail/serialize_tuple.hpp
cppa/detail/serialize_tuple.hpp
cppa/detail/singleton_manager.hpp
cppa/detail/singleton_manager.hpp
cppa/detail/singleton_mixin.hpp
cppa/detail/stacked_actor_mixin.hpp
cppa/detail/swap_bytes.hpp
cppa/detail/swap_bytes.hpp
cppa/detail/tdata.hpp
cppa/detail/tdata.hpp
cppa/detail/thread_pool_scheduler.hpp
cppa/detail/thread_pool_scheduler.hpp
...
@@ -60,36 +70,62 @@ cppa/detail/unboxed.hpp
...
@@ -60,36 +70,62 @@ cppa/detail/unboxed.hpp
cppa/detail/uniform_type_info_map.hpp
cppa/detail/uniform_type_info_map.hpp
cppa/detail/value_guard.hpp
cppa/detail/value_guard.hpp
cppa/detail/yield_interface.hpp
cppa/detail/yield_interface.hpp
cppa/context_switching_actor.hpp
cppa/either.hpp
cppa/either.hpp
cppa/enable_weak_ptr_mixin.hpp
cppa/event_based_actor.hpp
cppa/exception.hpp
cppa/exception.hpp
cppa/exit_reason.hpp
cppa/exit_reason.hpp
cppa/factory.hpp
cppa/from_string.hpp
cppa/from_string.hpp
cppa/sb_actor.hpp
cppa/get.hpp
cppa/get.hpp
cppa/group.hpp
cppa/group.hpp
cppa/guard_expr.hpp
cppa/guard_expr.hpp
cppa/intrusive/forward_iterator.hpp
cppa/intrusive/single_reader_queue.hpp
cppa/intrusive/single_reader_queue.hpp
cppa/intrusive/singly_linked_list.hpp
cppa/intrusive_ptr.hpp
cppa/intrusive_ptr.hpp
cppa/local_actor.hpp
cppa/local_actor.hpp
cppa/logging.hpp
cppa/match.hpp
cppa/match.hpp
cppa/match_expr.hpp
cppa/match_expr.hpp
cppa/message_future.hpp
cppa/message_id.hpp
cppa/network/acceptor.hpp
cppa/network/continuable_io.hpp
cppa/network/continuable_reader.hpp
cppa/network/default_actor_addressing.hpp
cppa/network/default_actor_proxy.hpp
cppa/network/default_message_queue.hpp
cppa/network/default_peer.hpp
cppa/network/default_peer_acceptor.hpp
cppa/network/default_protocol.hpp
cppa/network/input_stream.hpp
cppa/network/io_stream.hpp
cppa/network/ipv4_acceptor.hpp
cppa/network/ipv4_io_stream.hpp
cppa/network/message_header.hpp
cppa/network/middleman.hpp
cppa/network/middleman_event_handler_base.hpp
cppa/network/output_stream.hpp
cppa/network/protocol.hpp
cppa/object.hpp
cppa/object.hpp
cppa/on.hpp
cppa/on.hpp
cppa/opt.hpp
cppa/option.hpp
cppa/option.hpp
cppa/partial_function.hpp
cppa/partial_function.hpp
cppa/primitive_type.hpp
cppa/primitive_type.hpp
cppa/primitive_variant.hpp
cppa/primitive_variant.hpp
cppa/process_information.hpp
cppa/process_information.hpp
cppa/qtsupport/actor_widget_mixin.hpp
cppa/receive.hpp
cppa/receive.hpp
cppa/ref_counted.hpp
cppa/ref_counted.hpp
cppa/response_handle.hpp
cppa/sb_actor.hpp
cppa/scheduled_actor.hpp
cppa/scheduled_actor.hpp
cppa/scheduler.hpp
cppa/scheduler.hpp
cppa/scheduling_hint.hpp
cppa/scheduling_hint.hpp
cppa/self.hpp
cppa/self.hpp
cppa/serializer.hpp
cppa/serializer.hpp
cppa/thread_mapped_actor.hpp
cppa/timeout_definition.hpp
cppa/to_string.hpp
cppa/to_string.hpp
cppa/tpartial_function.hpp
cppa/tpartial_function.hpp
cppa/tuple_cast.hpp
cppa/tuple_cast.hpp
...
@@ -138,44 +174,72 @@ cppa/util/type_pair.hpp
...
@@ -138,44 +174,72 @@ cppa/util/type_pair.hpp
cppa/util/upgrade_lock_guard.hpp
cppa/util/upgrade_lock_guard.hpp
cppa/util/void_type.hpp
cppa/util/void_type.hpp
cppa/util/wrapped.hpp
cppa/util/wrapped.hpp
cppa/weak_intrusive_ptr.hpp
cppa/weak_ptr_anchor.hpp
cppa/wildcard_position.hpp
examples/announce_example_1.cpp
examples/announce_example_1.cpp
examples/announce_example_2.cpp
examples/announce_example_2.cpp
examples/announce_example_3.cpp
examples/announce_example_3.cpp
examples/announce_example_4.cpp
examples/announce_example_4.cpp
examples/announce_example_5.cpp
examples/announce_example_5.cpp
examples/dancing_kirby.cpp
examples/dancing_kirby.cpp
examples/distributed_math_actor_example.cpp
examples/dining_philosophers.cpp
examples/dining_philosophers.cpp
examples/distributed_math_actor_example.cpp
examples/group_chat.cpp
examples/group_server.cpp
examples/hello_world_example.cpp
examples/hello_world_example.cpp
examples/math_actor_example.cpp
examples/math_actor_example.cpp
src/event_based_actor.c
pp
examples/type_plugins.h
pp
src/abstract_tuple.cpp
src/abstract_tuple.cpp
src/actor.cpp
src/actor.cpp
src/actor_addressing.cpp
src/actor_count.cpp
src/actor_count.cpp
src/actor_proxy.cpp
src/actor_proxy.cpp
src/actor_registry.cpp
src/actor_registry.cpp
src/any_tuple.cpp
src/any_tuple.cpp
src/atom.cpp
src/atom.cpp
src/attachable.cpp
src/attachable.cpp
src/behavior_stack.cpp
src/binary_deserializer.cpp
src/binary_deserializer.cpp
src/binary_serializer.cpp
src/binary_serializer.cpp
src/buffer.cpp
src/channel.cpp
src/channel.cpp
src/thread_mapped_actor.cpp
src/context_switching_actor.cpp
src/continuable_reader.cpp
src/continuable_writer.cpp
src/decorated_names_map.cpp
src/default_actor_addressing.cpp
src/default_actor_proxy.cpp
src/default_peer.cpp
src/default_peer_acceptor.cpp
src/default_protocol.cpp
src/demangle.cpp
src/demangle.cpp
src/deserializer.cpp
src/deserializer.cpp
src/duration.cpp
src/duration.cpp
src/empty_tuple.cpp
src/empty_tuple.cpp
src/event_based_actor.cpp
src/exception.cpp
src/exception.cpp
src/factory.cpp
src/fd_util.cpp
src/fiber.cpp
src/fiber.cpp
src/group.cpp
src/group.cpp
src/group_manager.cpp
src/group_manager.cpp
src/ipv4_acceptor.cpp
src/ipv4_io_stream.cpp
src/local_actor.cpp
src/local_actor.cpp
src/logging.cpp
src/message_header.cpp
src/middleman.cpp
src/object.cpp
src/object.cpp
src/object_array.cpp
src/object_array.cpp
src/opt.cpp
src/partial_function.cpp
src/partial_function.cpp
src/primitive_variant.cpp
src/primitive_variant.cpp
src/process_information.cpp
src/process_information.cpp
src/protocol.cpp
src/receive.cpp
src/receive.cpp
src/ref_counted.cpp
src/response_handle.cpp
src/ripemd_160.cpp
src/ripemd_160.cpp
src/scheduled_actor.cpp
src/scheduled_actor.cpp
src/scheduled_actor_dummy.cpp
src/scheduled_actor_dummy.cpp
...
@@ -185,12 +249,13 @@ src/serializer.cpp
...
@@ -185,12 +249,13 @@ src/serializer.cpp
src/shared_spinlock.cpp
src/shared_spinlock.cpp
src/singleton_manager.cpp
src/singleton_manager.cpp
src/string_serialization.cpp
src/string_serialization.cpp
src/thread_mapped_actor.cpp
src/thread_pool_scheduler.cpp
src/thread_pool_scheduler.cpp
src/to_uniform_name.cpp
src/to_uniform_name.cpp
src/unicast_network.cpp
src/unicast_network.cpp
src/uniform_type_info.cpp
src/uniform_type_info.cpp
src/weak_ptr_anchor.cpp
src/yield_interface.cpp
src/yield_interface.cpp
src/context_switching_actor.cpp
unit_testing/ping_pong.cpp
unit_testing/ping_pong.cpp
unit_testing/ping_pong.hpp
unit_testing/ping_pong.hpp
unit_testing/test.hpp
unit_testing/test.hpp
...
@@ -210,70 +275,3 @@ unit_testing/test__tuple.cpp
...
@@ -210,70 +275,3 @@ unit_testing/test__tuple.cpp
unit_testing/test__type_list.cpp
unit_testing/test__type_list.cpp
unit_testing/test__uniform_type.cpp
unit_testing/test__uniform_type.cpp
unit_testing/test__yield_interface.cpp
unit_testing/test__yield_interface.cpp
cppa/detail/receive_policy.hpp
cppa/detail/behavior_stack.hpp
src/behavior_stack.cpp
cppa/detail/stacked_actor_mixin.hpp
cppa/detail/event_based_actor_factory.hpp
cppa/factory.hpp
src/factory.cpp
cppa/message_id.hpp
cppa/cppa_fwd.hpp
cppa/timeout_definition.hpp
cppa/detail/behavior_impl.hpp
cppa/network/output_stream.hpp
cppa/network/input_stream.hpp
cppa/network/io_stream.hpp
cppa/network/acceptor.hpp
cppa/network/ipv4_io_stream.hpp
src/ipv4_io_stream.cpp
cppa/network/ipv4_acceptor.hpp
src/ipv4_acceptor.cpp
cppa/network/middleman.hpp
src/middleman.cpp
src/buffer.cpp
cppa/message_future.hpp
cppa/detail/fd_util.hpp
src/fd_util.cpp
examples/group_server.cpp
examples/group_chat.cpp
cppa/opt.hpp
src/opt.cpp
cppa/detail/opt_impls.hpp
examples/type_plugins.hpp
cppa/detail/decorated_names_map.hpp
src/decorated_names_map.cpp
cppa/network/continuable_reader.hpp
src/continuable_reader.cpp
cppa/network/default_peer.hpp
src/default_peer.cpp
cppa/network/default_peer_acceptor.hpp
src/default_peer_acceptor.cpp
src/ref_counted.cpp
cppa/enable_weak_ptr_mixin.hpp
cppa/weak_intrusive_ptr.hpp
cppa/network/default_actor_proxy.hpp
src/default_actor_proxy.cpp
cppa/network/default_actor_addressing.hpp
src/default_actor_addressing.cpp
cppa/network/protocol.hpp
src/protocol.cpp
cppa/network/default_protocol.hpp
src/default_protocol.cpp
cppa/logging.hpp
src/logging.cpp
cppa/network/continuable_io.hpp
src/continuable_writer.cpp
cppa/network/middleman_event_handler_base.hpp
src/actor_addressing.cpp
cppa/weak_ptr_anchor.hpp
src/weak_ptr_anchor.cpp
cppa/actor_companion_mixin.hpp
cppa/detail/singleton_mixin.hpp
cppa/response_handle.hpp
src/response_handle.cpp
cppa/wildcard_position.hpp
cppa/network/message_header.hpp
src/message_header.cpp
cppa/qtsupport/actor_widget_mixin.hpp
cppa/network/default_message_queue.hpp
cppa/intrusive/forward_iterator.hpp
deleted
100644 → 0
View file @
746c69fb
/******************************************************************************\
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011, 2012 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
* libcppa is free software: you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License *
* or (at your option) any later version. *
* *
* libcppa is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
\******************************************************************************/
#ifndef CPPA_FORWARD_ITERATOR_HPP
#define CPPA_FORWARD_ITERATOR_HPP
#include <iterator>
namespace
cppa
{
namespace
intrusive
{
/**
* @brief A forward iterator for intrusive lists.
*/
template
<
class
T
>
class
forward_iterator
{
public:
typedef
T
value_type
;
typedef
value_type
&
reference
;
typedef
const
value_type
&
const_reference
;
typedef
value_type
*
pointer
;
typedef
const
value_type
*
const_pointer
;
typedef
ptrdiff_t
difference_type
;
typedef
std
::
forward_iterator_tag
iterator_category
;
inline
forward_iterator
(
pointer
ptr
=
nullptr
)
:
m_ptr
(
ptr
)
{
}
forward_iterator
(
const
forward_iterator
&
)
=
default
;
forward_iterator
&
operator
=
(
const
forward_iterator
&
)
=
default
;
inline
forward_iterator
&
operator
++
()
{
m_ptr
=
m_ptr
->
next
;
return
*
this
;
}
inline
forward_iterator
operator
++
(
int
)
{
forward_iterator
tmp
{
*
this
};
m_ptr
=
m_ptr
->
next
;
return
tmp
;
}
inline
explicit
operator
bool
()
{
return
m_ptr
!=
nullptr
;
}
inline
bool
operator
!
()
{
return
m_ptr
!=
nullptr
;
}
inline
reference
operator
*
()
{
return
*
m_ptr
;
}
inline
const_reference
operator
*
()
const
{
return
*
m_ptr
;
}
inline
pointer
operator
->
()
{
return
m_ptr
;
}
inline
const_pointer
operator
->
()
const
{
return
m_ptr
;
}
/**
* @brief Returns the element this iterator points to.
*/
inline
pointer
ptr
()
{
return
m_ptr
;
}
/**
* @brief Returns the element this iterator points to.
*/
inline
const_pointer
ptr
()
const
{
return
m_ptr
;
}
private:
pointer
m_ptr
;
};
/**
* @relates forward_iterator
*/
template
<
class
T
>
inline
bool
operator
==
(
const
forward_iterator
<
T
>&
lhs
,
const
forward_iterator
<
T
>&
rhs
)
{
return
lhs
.
ptr
()
==
rhs
.
ptr
();
}
/**
* @relates forward_iterator
*/
template
<
class
T
>
inline
bool
operator
==
(
const
forward_iterator
<
T
>&
lhs
,
const
T
*
rhs
)
{
return
lhs
.
ptr
()
==
rhs
;
}
/**
* @relates forward_iterator
*/
template
<
class
T
>
inline
bool
operator
==
(
const
T
*
lhs
,
const
forward_iterator
<
T
>&
rhs
)
{
return
lhs
==
rhs
.
ptr
();
}
/**
* @relates forward_iterator
*/
template
<
class
T
>
inline
bool
operator
==
(
const
forward_iterator
<
T
>&
lhs
,
std
::
nullptr_t
)
{
return
lhs
.
ptr
()
==
nullptr
;
}
/**
* @relates forward_iterator
*/
template
<
class
T
>
inline
bool
operator
==
(
std
::
nullptr_t
,
const
forward_iterator
<
T
>&
rhs
)
{
return
rhs
.
ptr
()
==
nullptr
;
}
/**
* @relates forward_iterator
*/
template
<
class
T
>
inline
bool
operator
!=
(
const
forward_iterator
<
T
>&
lhs
,
const
forward_iterator
<
T
>&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
/**
* @relates forward_iterator
*/
template
<
class
T
>
inline
bool
operator
!=
(
const
forward_iterator
<
T
>&
lhs
,
const
T
*
rhs
)
{
return
!
(
lhs
==
rhs
);
}
/**
* @relates forward_iterator
*/
template
<
class
T
>
inline
bool
operator
!=
(
const
T
*
lhs
,
const
forward_iterator
<
T
>&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
/**
* @relates forward_iterator
*/
template
<
class
T
>
inline
bool
operator
!=
(
const
forward_iterator
<
T
>&
lhs
,
std
::
nullptr_t
)
{
return
!
(
lhs
==
nullptr
);
}
/**
* @relates forward_iterator
*/
template
<
class
T
>
inline
bool
operator
!=
(
std
::
nullptr_t
,
const
forward_iterator
<
T
>&
rhs
)
{
return
!
(
nullptr
==
rhs
);
}
}
}
// namespace cppa::intrusive
#endif // CPPA_FORWARD_ITERATOR_HPP
cppa/intrusive/singly_linked_list.hpp
deleted
100644 → 0
View file @
746c69fb
This diff is collapsed.
Click to expand it.
cppa/thread_mapped_actor.hpp
View file @
36491961
...
@@ -49,8 +49,6 @@
...
@@ -49,8 +49,6 @@
#include "cppa/intrusive_ptr.hpp"
#include "cppa/intrusive_ptr.hpp"
#include "cppa/detail/abstract_actor.hpp"
#include "cppa/detail/abstract_actor.hpp"
#include "cppa/intrusive/singly_linked_list.hpp"
#include "cppa/detail/receive_policy.hpp"
#include "cppa/detail/receive_policy.hpp"
#include "cppa/detail/behavior_stack.hpp"
#include "cppa/detail/behavior_stack.hpp"
#include "cppa/detail/stacked_actor_mixin.hpp"
#include "cppa/detail/stacked_actor_mixin.hpp"
...
...
unit_testing/test__intrusive_containers.cpp
View file @
36491961
...
@@ -31,7 +31,6 @@
...
@@ -31,7 +31,6 @@
#include <iterator>
#include <iterator>
#include "test.hpp"
#include "test.hpp"
#include "cppa/intrusive/singly_linked_list.hpp"
#include "cppa/intrusive/single_reader_queue.hpp"
#include "cppa/intrusive/single_reader_queue.hpp"
using
std
::
begin
;
using
std
::
begin
;
...
@@ -58,68 +57,18 @@ inline bool operator==(int lhs, const iint& rhs) {
...
@@ -58,68 +57,18 @@ inline bool operator==(int lhs, const iint& rhs) {
return
lhs
==
rhs
.
value
;
return
lhs
==
rhs
.
value
;
}
}
typedef
cppa
::
intrusive
::
singly_linked_list
<
iint
>
iint_list
;
typedef
cppa
::
intrusive
::
single_reader_queue
<
iint
>
iint_queue
;
typedef
cppa
::
intrusive
::
single_reader_queue
<
iint
>
iint_queue
;
int
main
()
{
int
main
()
{
CPPA_TEST
(
test__intrusive_containers
);
CPPA_TEST
(
test__intrusive_containers
);
iint_list
ilist1
;
ilist1
.
push_back
(
new
iint
(
1
));
ilist1
.
emplace_back
(
2
);
ilist1
.
push_back
(
new
iint
(
3
));
{
iint_list
tmp
;
tmp
.
push_back
(
new
iint
(
4
));
tmp
.
push_back
(
new
iint
(
5
));
ilist1
.
splice_after
(
ilist1
.
before_end
(),
std
::
move
(
tmp
));
CPPA_CHECK
(
tmp
.
empty
());
}
int
iarr1
[]
=
{
1
,
2
,
3
,
4
,
5
};
CPPA_CHECK
((
std
::
equal
(
begin
(
iarr1
),
end
(
iarr1
),
begin
(
ilist1
))));
CPPA_CHECK
((
std
::
equal
(
begin
(
ilist1
),
end
(
ilist1
),
begin
(
iarr1
))));
ilist1
.
push_front
(
new
iint
(
0
));
auto
i
=
ilist1
.
erase_after
(
ilist1
.
begin
());
// i points to second element
CPPA_CHECK_EQUAL
(
i
->
value
,
2
);
i
=
ilist1
.
insert_after
(
i
,
new
iint
(
20
));
CPPA_CHECK_EQUAL
(
i
->
value
,
20
);
int
iarr2
[]
=
{
0
,
2
,
20
,
3
,
4
,
5
};
CPPA_CHECK
((
std
::
equal
(
begin
(
iarr2
),
end
(
iarr2
),
begin
(
ilist1
))));
auto
p
=
ilist1
.
take
();
CPPA_CHECK
(
ilist1
.
empty
());
auto
ilist2
=
iint_list
::
from
(
p
);
ilist2
.
emplace_front
(
1
);
// 1 0 2 20 3 4 5
i
=
ilist2
.
erase_after
(
ilist2
.
begin
());
// 1 2 20 3 4 5
CPPA_CHECK_EQUAL
(
i
->
value
,
2
);
ilist2
.
erase_after
(
i
);
// 1 2 3 4 5
CPPA_CHECK
((
std
::
equal
(
begin
(
iarr1
),
end
(
iarr1
),
begin
(
ilist2
))));
// five elements + two dummies
CPPA_CHECK_EQUAL
(
s_iint_instances
,
7
);
ilist2
.
remove_if
([](
const
iint
&
val
)
{
return
(
val
.
value
%
2
)
!=
0
;
});
// two elements + two dummies
CPPA_CHECK_EQUAL
(
s_iint_instances
,
4
);
int
iarr3
[]
=
{
2
,
4
};
CPPA_CHECK
((
std
::
equal
(
begin
(
iarr3
),
end
(
iarr3
),
begin
(
ilist2
))));
auto
xy
=
ilist2
.
take_after
(
ilist2
.
before_begin
());
CPPA_CHECK_EQUAL
(
xy
->
value
,
2
);
delete
xy
;
ilist2
.
clear
();
// two dummies
CPPA_CHECK_EQUAL
(
s_iint_instances
,
2
);
CPPA_CHECK
(
ilist2
.
empty
());
cppa
::
intrusive
::
single_reader_queue
<
iint
>
q
;
cppa
::
intrusive
::
single_reader_queue
<
iint
>
q
;
q
.
push_back
(
new
iint
(
1
));
q
.
push_back
(
new
iint
(
1
));
q
.
push_back
(
new
iint
(
2
));
q
.
push_back
(
new
iint
(
2
));
q
.
push_back
(
new
iint
(
3
));
q
.
push_back
(
new
iint
(
3
));
CPPA_CHECK_EQUAL
(
s_iint_instances
,
3
);
auto
x
=
q
.
pop
();
auto
x
=
q
.
pop
();
CPPA_CHECK_EQUAL
(
1
,
x
->
value
);
CPPA_CHECK_EQUAL
(
1
,
x
->
value
);
delete
x
;
delete
x
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment