Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
49816e50
Commit
49816e50
authored
Jun 13, 2011
by
Michal 'vorner' Vaner
Browse files
[trac977] Prefer shared ptrs
They will be needed in future, so we don't want to change the interface then.
parent
463a593e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/acl/acl.h
View file @
49816e50
...
...
@@ -17,7 +17,8 @@
#include
"check.h"
#include
<vector>
#include
<memory>
#include
<boost/shared_ptr.hpp>
namespace
isc
{
namespace
acl
{
...
...
@@ -73,11 +74,11 @@ public:
/**
* \brief Pointer to the check.
*
* We use
auto_ptr here, as it provides protection against memory lea
ks
*
in case of exceptions, while being a lot more lightweight than
*
boost::shared_ptr (which seems unneeded here, at last for now
).
* We use
the shared pointer, because we are not able to copy the chec
ks
.
*
However, we might need to copy the entries (when we concatenate ACLs
*
together in future
).
*/
typedef
st
d
::
auto
_ptr
<
Check
<
Context
>
>
CheckPtr
;
typedef
boo
st
::
shared
_ptr
<
Check
<
Context
>
>
CheckPtr
;
/**
* \brief The actual main function that decides.
*
...
...
@@ -98,8 +99,7 @@ public:
* but we may need more when we start implementing some kind optimisations,
* including replacements, reorderings and removals.
*
* \param check The check to test if the thing matches. The ACL steals
* ownership of the pointer (which is implicit from the auto_ptr).
* \param check The check to test if the thing matches.
* \param action The action to return when the thing matches this check.
*/
void
append
(
CheckPtr
check
,
const
Action
&
action
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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