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
bab3a108
Commit
bab3a108
authored
Mar 27, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intrusive::iterator -> intrusive::forward_iterator
parent
092a6db1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
34 deletions
+37
-34
Makefile.am
Makefile.am
+1
-1
cppa.files
cppa.files
+1
-1
cppa/intrusive/forward_iterator.hpp
cppa/intrusive/forward_iterator.hpp
+29
-27
cppa/intrusive/singly_linked_list.hpp
cppa/intrusive/singly_linked_list.hpp
+6
-5
No files found.
Makefile.am
View file @
bab3a108
...
@@ -147,7 +147,7 @@ nobase_library_include_HEADERS = \
...
@@ -147,7 +147,7 @@ nobase_library_include_HEADERS = \
cppa/fsm_actor.hpp
\
cppa/fsm_actor.hpp
\
cppa/get.hpp
\
cppa/get.hpp
\
cppa/group.hpp
\
cppa/group.hpp
\
cppa/intrusive/iterator.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/singly_linked_list.hpp
\
cppa/intrusive_ptr.hpp
\
cppa/intrusive_ptr.hpp
\
...
...
cppa.files
View file @
bab3a108
...
@@ -253,6 +253,6 @@ cppa/match.hpp
...
@@ -253,6 +253,6 @@ cppa/match.hpp
cppa/partial_function.hpp
cppa/partial_function.hpp
src/partial_function.cpp
src/partial_function.cpp
cppa/intrusive/singly_linked_list.hpp
cppa/intrusive/singly_linked_list.hpp
cppa/intrusive/iterator.hpp
cppa/intrusive/
forward_
iterator.hpp
unit_testing/test__intrusive_containers.cpp
unit_testing/test__intrusive_containers.cpp
examples/dancing_kirby.cpp
examples/dancing_kirby.cpp
cppa/intrusive/iterator.hpp
→
cppa/intrusive/
forward_
iterator.hpp
View file @
bab3a108
...
@@ -39,7 +39,7 @@ namespace cppa { namespace intrusive {
...
@@ -39,7 +39,7 @@ namespace cppa { namespace intrusive {
* @brief A forward iterator for intrusive lists.
* @brief A forward iterator for intrusive lists.
*/
*/
template
<
class
T
>
template
<
class
T
>
class
iterator
// : std::iterator<forward_iterator_tag, T>
class
forward_iterator
{
{
public:
public:
...
@@ -52,20 +52,20 @@ class iterator // : std::iterator<forward_iterator_tag, T>
...
@@ -52,20 +52,20 @@ class iterator // : std::iterator<forward_iterator_tag, T>
typedef
ptrdiff_t
difference_type
;
typedef
ptrdiff_t
difference_type
;
typedef
std
::
forward_iterator_tag
iterator_category
;
typedef
std
::
forward_iterator_tag
iterator_category
;
inline
iterator
(
T
*
ptr
)
:
m_ptr
(
ptr
)
{
}
inline
forward_
iterator
(
T
*
ptr
)
:
m_ptr
(
ptr
)
{
}
iterator
(
iterator
const
&
)
=
default
;
forward_iterator
(
forward_
iterator
const
&
)
=
default
;
iterator
&
operator
=
(
iterator
const
&
)
=
default
;
forward_iterator
&
operator
=
(
forward_
iterator
const
&
)
=
default
;
inline
iterator
&
operator
++
()
inline
forward_
iterator
&
operator
++
()
{
{
m_ptr
=
m_ptr
->
next
;
m_ptr
=
m_ptr
->
next
;
return
*
this
;
return
*
this
;
}
}
inline
iterator
operator
++
(
int
)
inline
forward_
iterator
operator
++
(
int
)
{
{
iterator
tmp
{
*
this
};
forward_
iterator
tmp
{
*
this
};
m_ptr
=
m_ptr
->
next
;
m_ptr
=
m_ptr
->
next
;
return
tmp
;
return
tmp
;
}
}
...
@@ -97,91 +97,93 @@ class iterator // : std::iterator<forward_iterator_tag, T>
...
@@ -97,91 +97,93 @@ class iterator // : std::iterator<forward_iterator_tag, T>
};
};
/**
/**
* @relates iterator
* @relates
forward_
iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
==
(
iterator
<
T
>
const
&
lhs
,
iterator
<
T
>
const
&
rhs
)
inline
bool
operator
==
(
forward_iterator
<
T
>
const
&
lhs
,
forward_iterator
<
T
>
const
&
rhs
)
{
{
return
lhs
.
ptr
()
==
rhs
.
ptr
();
return
lhs
.
ptr
()
==
rhs
.
ptr
();
}
}
/**
/**
* @relates iterator
* @relates
forward_
iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
==
(
iterator
<
T
>
const
&
lhs
,
T
const
*
rhs
)
inline
bool
operator
==
(
forward_
iterator
<
T
>
const
&
lhs
,
T
const
*
rhs
)
{
{
return
lhs
.
ptr
()
==
rhs
;
return
lhs
.
ptr
()
==
rhs
;
}
}
/**
/**
* @relates iterator
* @relates
forward_
iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
==
(
T
const
*
lhs
,
iterator
<
T
>
const
&
rhs
)
inline
bool
operator
==
(
T
const
*
lhs
,
forward_
iterator
<
T
>
const
&
rhs
)
{
{
return
lhs
==
rhs
.
ptr
();
return
lhs
==
rhs
.
ptr
();
}
}
/**
/**
* @relates iterator
* @relates
forward_
iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
==
(
iterator
<
T
>
const
&
lhs
,
decltype
(
nullptr
))
inline
bool
operator
==
(
forward_
iterator
<
T
>
const
&
lhs
,
decltype
(
nullptr
))
{
{
return
lhs
.
ptr
()
==
nullptr
;
return
lhs
.
ptr
()
==
nullptr
;
}
}
/**
/**
* @relates iterator
* @relates
forward_
iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
==
(
decltype
(
nullptr
),
iterator
<
T
>
const
&
rhs
)
inline
bool
operator
==
(
decltype
(
nullptr
),
forward_
iterator
<
T
>
const
&
rhs
)
{
{
return
rhs
.
ptr
()
==
nullptr
;
return
rhs
.
ptr
()
==
nullptr
;
}
}
/**
/**
* @relates iterator
* @relates
forward_
iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
!=
(
iterator
<
T
>
const
&
lhs
,
iterator
<
T
>
const
&
rhs
)
inline
bool
operator
!=
(
forward_iterator
<
T
>
const
&
lhs
,
forward_iterator
<
T
>
const
&
rhs
)
{
{
return
!
(
lhs
==
rhs
);
return
!
(
lhs
==
rhs
);
}
}
/**
/**
* @relates iterator
* @relates
forward_
iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
!=
(
iterator
<
T
>
const
&
lhs
,
T
const
*
rhs
)
inline
bool
operator
!=
(
forward_
iterator
<
T
>
const
&
lhs
,
T
const
*
rhs
)
{
{
return
!
(
lhs
==
rhs
);
return
!
(
lhs
==
rhs
);
}
}
/**
/**
* @relates iterator
* @relates
forward_
iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
!=
(
T
const
*
lhs
,
iterator
<
T
>
const
&
rhs
)
inline
bool
operator
!=
(
T
const
*
lhs
,
forward_
iterator
<
T
>
const
&
rhs
)
{
{
return
!
(
lhs
==
rhs
);
return
!
(
lhs
==
rhs
);
}
}
/**
/**
* @relates iterator
* @relates
forward_
iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
!=
(
iterator
<
T
>
const
&
lhs
,
decltype
(
nullptr
))
inline
bool
operator
!=
(
forward_
iterator
<
T
>
const
&
lhs
,
decltype
(
nullptr
))
{
{
return
!
(
lhs
==
nullptr
);
return
!
(
lhs
==
nullptr
);
}
}
/**
/**
* @relates iterator
* @relates
forward_
iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
!=
(
decltype
(
nullptr
),
iterator
<
T
>
const
&
rhs
)
inline
bool
operator
!=
(
decltype
(
nullptr
),
forward_
iterator
<
T
>
const
&
rhs
)
{
{
return
!
(
nullptr
==
rhs
);
return
!
(
nullptr
==
rhs
);
}
}
...
...
cppa/intrusive/singly_linked_list.hpp
View file @
bab3a108
...
@@ -35,13 +35,14 @@
...
@@ -35,13 +35,14 @@
#include <utility>
#include <utility>
#include "cppa/config.hpp"
#include "cppa/config.hpp"
#include "cppa/intrusive/iterator.hpp"
#include "cppa/intrusive/
forward_
iterator.hpp"
namespace
cppa
{
namespace
intrusive
{
namespace
cppa
{
namespace
intrusive
{
/**
/**
* @brief A singly linked list similar to std::forward_list
* @brief A singly linked list similar to std::forward_list
* but intrusive and with push_back() support.
* but intrusive and with push_back() support.
* @tparam T A class providing a @p next pointer and a default constructor.
*/
*/
template
<
class
T
>
template
<
class
T
>
class
singly_linked_list
class
singly_linked_list
...
@@ -60,8 +61,8 @@ class singly_linked_list
...
@@ -60,8 +61,8 @@ class singly_linked_list
typedef
value_type
*
pointer
;
typedef
value_type
*
pointer
;
typedef
value_type
const
*
const_pointer
;
typedef
value_type
const
*
const_pointer
;
typedef
::
cppa
::
intrusive
::
iterator
<
value_type
>
iterator
;
typedef
forward_iterator
<
value_type
>
iterator
;
typedef
::
cppa
::
intrusive
::
iterator
<
value_type
const
>
const_iterator
;
typedef
forward_iterator
<
value_type
const
>
const_iterator
;
singly_linked_list
()
:
m_head
(),
m_tail
(
&
m_head
)
{
}
singly_linked_list
()
:
m_head
(),
m_tail
(
&
m_head
)
{
}
...
@@ -158,7 +159,7 @@ class singly_linked_list
...
@@ -158,7 +159,7 @@ class singly_linked_list
}
}
/**
/**
* @brief Inserts @p what after @p
i
.
* @brief Inserts @p what after @p
pos
.
* @returns An iterator to the inserted element.
* @returns An iterator to the inserted element.
*/
*/
iterator
insert_after
(
iterator
pos
,
pointer
what
)
iterator
insert_after
(
iterator
pos
,
pointer
what
)
...
@@ -326,7 +327,7 @@ class singly_linked_list
...
@@ -326,7 +327,7 @@ class singly_linked_list
}
}
/**
/**
* @brief Removes all elements for which predicate @p returns @p true.
* @brief Removes all elements for which predicate @p
p
returns @p true.
*/
*/
template
<
typename
UnaryPredicate
>
template
<
typename
UnaryPredicate
>
void
remove_if
(
UnaryPredicate
p
)
void
remove_if
(
UnaryPredicate
p
)
...
...
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