[
https://issues.apache.org/jira/browse/MESOS-2238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14361700#comment-14361700
]
Akanksha Agrawal edited comment on MESOS-2238 at 3/14/15 10:26 AM:
-------------------------------------------------------------------
Unique pointers should be used when we want only one pointer to point to a
particular resource and owned in case we want to point multiple pointers to
point to a resource. Here as dominic said we should go for unique pointers
only. But should all the owned pointers also be replaced by unique pointers?
was (Author: akanksha08):
Unique pointers should be used when we want to only one pointer to point to a
particular resource and owned in case we want to point multiple pointers to
point to a resource. Here as dominic said we should go for unique pointers
only. But should all the owned pointers also be replaced by unique pointers?
> Use Owned<> for Process pointers in wrapper classes
> ---------------------------------------------------
>
> Key: MESOS-2238
> URL: https://issues.apache.org/jira/browse/MESOS-2238
> Project: Mesos
> Issue Type: Improvement
> Reporter: Alexander Rukletsov
> Assignee: Akanksha Agrawal
> Labels: easyfix, newbie
>
> A common pattern in our code (see e.g. {{Isolator}}, {{DockerContainerizer}},
> {{Allocator}}) is to wrap Process-based class into a non Process-one.
> However, our code base is inconsistent about how we store the pointer to the
> underlying class: somewhere we wrap it into {{Owned<>}} (see e.g.
> {{Isolator}}, {{DockerContainerizer}}), somewhere it is a raw pointer (see
> e.g. {{Allocator}}, {{ExternalContainerizer}}).
> Using {{Owned<>}} for this particular case is preferable, since it hints the
> reader about the correct semantics and intention. For consistency reason,
> sweep through the code base and replace raw pointers with its {{Owned<>}}
> counterpart.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)