aboutsummaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorAlex Gilday <alexander.gilday@arm.com>2018-03-21 13:54:09 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:16 +0000
commitc357c47be8a3f210f9eee9a05cc13f1051b036d3 (patch)
treea88ac857150da970a0862a3479b78c616d8aa1d3 /support
parent724079d6fce3bf6a05cd6c7b4884b132b27e9e90 (diff)
downloadComputeLibrary-c357c47be8a3f210f9eee9a05cc13f1051b036d3.tar.gz
COMPMID-1008: Fix Doxygen issues
Change-Id: Ie73d8771f85d1f5b059f3a56f1bbd73c98e94a38 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/124723 Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'support')
-rw-r--r--support/Mutex.h12
-rw-r--r--support/ToolchainSupport.h26
2 files changed, 33 insertions, 5 deletions
diff --git a/support/Mutex.h b/support/Mutex.h
index 6d0a387678..d70dd7595b 100644
--- a/support/Mutex.h
+++ b/support/Mutex.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -29,6 +29,7 @@
namespace arm_compute
{
#ifndef NO_MULTI_THREADING
+/** Wrapper of Mutex data-object */
using Mutex = std::mutex;
#else /* NO_MULTI_THREADING */
/** Wrapper implementation of Mutex data-object */
@@ -36,13 +37,20 @@ class Mutex
{
public:
/** Default constructor */
- Mutex() = default;
+ Mutex() = default;
+ /** Default destructor */
~Mutex() = default;
+ /** Lock */
void lock() {};
+ /** Unlock */
void unlock() {};
+ /** Try the lock.
+ *
+ * @return true.
+ */
bool try_lock()
{
return true;
diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h
index 56cbce8cc4..cb156f39c7 100644
--- a/support/ToolchainSupport.h
+++ b/support/ToolchainSupport.h
@@ -339,24 +339,37 @@ inline bool isfinite(half_float::half value)
namespace cpp14
{
/** make_unique is missing in CPP11. Re-implement it according to the standard proposal. */
+
+/**<Template for single object */
template <class T>
struct _Unique_if
{
- typedef std::unique_ptr<T> _Single_object;
+ typedef std::unique_ptr<T> _Single_object; /**< Single object type */
};
+/** Template for array */
template <class T>
struct _Unique_if<T[]>
{
- typedef std::unique_ptr<T[]> _Unknown_bound;
+ typedef std::unique_ptr<T[]> _Unknown_bound; /**< Array type */
};
+/** Template for array with known bounds (to throw an error).
+ *
+ * @note this is intended to never be hit.
+ */
template <class T, size_t N>
struct _Unique_if<T[N]>
{
- typedef void _Known_bound;
+ typedef void _Known_bound; /**< Should never be used */
};
+/** Construct a single object and return a unique pointer to it.
+ *
+ * @param[in] args Constructor arguments.
+ *
+ * @return a unique pointer to the new object.
+ */
template <class T, class... Args>
typename _Unique_if<T>::_Single_object
make_unique(Args &&... args)
@@ -364,6 +377,12 @@ make_unique(Args &&... args)
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
+/** Construct an array of objects and return a unique pointer to it.
+ *
+ * @param[in] n Array size
+ *
+ * @return a unique pointer to the new array.
+ */
template <class T>
typename _Unique_if<T>::_Unknown_bound
make_unique(size_t n)
@@ -372,6 +391,7 @@ make_unique(size_t n)
return std::unique_ptr<T>(new U[n]());
}
+/** It is invalid to attempt to make_unique an array with known bounds. */
template <class T, class... Args>
typename _Unique_if<T>::_Known_bound
make_unique(Args &&...) = delete;