Skip to content

Commit

Permalink
iox-eclipse-iceoryx#218 Add documentation to unique_ptr.
Browse files Browse the repository at this point in the history
Signed-off-by: Ithier Jeff (CC-AD/EYF1) <[email protected]>
  • Loading branch information
orecham committed Aug 5, 2020
1 parent 2f5a499 commit 6fbede0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions iceoryx_utils/include/iceoryx_utils/cxx/unique_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,20 @@ class unique_ptr{
unique_ptr(function_ref<void(ptr_t const)> deleter) noexcept;

///
/// @brief unique_ptr Creates a unique pointer.
/// @details A delete must always be provided as no heap is used. The unique_ptr needs to know how to delete
/// the object when the reference is out of scope.
/// @param ptr The raw pointer to the object to take ownership of.
/// @param deleter The deleter function for cleaning up the object.
/// @brief unique_ptr Creates a unique pointer that takes ownership of an object.
/// @details A deleter must always be provided as no heap is used. The unique_ptr needs to know how to delete
/// the managed object when the reference is out of scope.
/// @param ptr The raw pointer to the object to be managed.
/// @param deleter The deleter function for cleaning up the managed object.
///
unique_ptr(ptr_t ptr, const function_ref<void(ptr_t const)> deleter) noexcept;

///
/// @brief unique_ptr Creates an empty unique pointer that points to a specific memory location.
/// @details The managed object is initially undefined thus must be defined before accessing.
/// @param allocation The allocation of memory where managed object will reside once created.
/// @param deleter The deleter function for cleaning up the managed object.
///
unique_ptr(void* allocation, const function_ref<void(ptr_t const)> deleter) noexcept;

// Not copy-able to ensure uniqueness.
Expand Down

0 comments on commit 6fbede0

Please sign in to comment.