diff options
Diffstat (limited to 'include/lldb/Host/Predicate.h')
-rw-r--r-- | include/lldb/Host/Predicate.h | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/include/lldb/Host/Predicate.h b/include/lldb/Host/Predicate.h index ae6c99155fe0..4f386dc1dd0b 100644 --- a/include/lldb/Host/Predicate.h +++ b/include/lldb/Host/Predicate.h @@ -9,13 +9,17 @@ #ifndef liblldb_Predicate_h_ #define liblldb_Predicate_h_ -#if defined(__cplusplus) +// C Includes +#include <stdint.h> +#include <time.h> + +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/lldb-defines.h" #include "lldb/Host/Mutex.h" #include "lldb/Host/Condition.h" -#include <stdint.h> -#include <time.h> //#define DB_PTHREAD_LOG_EVENTS @@ -29,7 +33,6 @@ typedef enum eBroadcastNever, ///< No broadcast will be sent when the value is modified. eBroadcastAlways, ///< Always send a broadcast when the value is modified. eBroadcastOnChange ///< Only broadcast if the value changes when the value is modified. - } PredicateBroadcastType; //---------------------------------------------------------------------- @@ -46,7 +49,6 @@ template <class T> class Predicate { public: - //------------------------------------------------------------------ /// Default constructor. /// @@ -81,10 +83,7 @@ public: /// /// Destroy the condition, mutex, and T objects. //------------------------------------------------------------------ - ~Predicate () - { - } - + ~Predicate() = default; //------------------------------------------------------------------ /// Value get accessor. @@ -205,7 +204,7 @@ public: /// The bits we are waiting to be set in \a m_value. /// /// @param[in] abstime - /// If non-NULL, the absolute time at which we should stop + /// If non-nullptr, the absolute time at which we should stop /// waiting, else wait an infinite amount of time. /// /// @return @@ -214,7 +213,7 @@ public: /// occurred. //------------------------------------------------------------------ T - WaitForSetValueBits (T bits, const TimeValue *abstime = NULL) + WaitForSetValueBits(T bits, const TimeValue *abstime = nullptr) { int err = 0; // pthread_cond_timedwait() or pthread_cond_wait() will atomically @@ -255,7 +254,7 @@ public: /// The bits we are waiting to be reset in \a m_value. /// /// @param[in] abstime - /// If non-NULL, the absolute time at which we should stop + /// If non-nullptr, the absolute time at which we should stop /// waiting, else wait an infinite amount of time. /// /// @return @@ -263,7 +262,7 @@ public: /// unrecoverable error occurs. //------------------------------------------------------------------ T - WaitForResetValueBits (T bits, const TimeValue *abstime = NULL) + WaitForResetValueBits(T bits, const TimeValue *abstime = nullptr) { int err = 0; @@ -306,7 +305,7 @@ public: /// The value we want \a m_value to be equal to. /// /// @param[in] abstime - /// If non-NULL, the absolute time at which we should stop + /// If non-nullptr, the absolute time at which we should stop /// waiting, else wait an infinite amount of time. /// /// @param[out] timed_out @@ -318,7 +317,7 @@ public: /// @li \b false otherwise //------------------------------------------------------------------ bool - WaitForValueEqualTo (T value, const TimeValue *abstime = NULL, bool *timed_out = NULL) + WaitForValueEqualTo(T value, const TimeValue *abstime = nullptr, bool *timed_out = nullptr) { int err = 0; // pthread_cond_timedwait() or pthread_cond_wait() will atomically @@ -366,7 +365,7 @@ public: /// returned. /// /// @param[in] abstime - /// If non-NULL, the absolute time at which we should stop + /// If non-nullptr, the absolute time at which we should stop /// waiting, else wait an infinite amount of time. /// /// @param[out] timed_out @@ -378,7 +377,9 @@ public: /// @li \b false otherwise //------------------------------------------------------------------ bool - WaitForValueEqualToAndSetValueTo (T wait_value, T new_value, const TimeValue *abstime = NULL, bool *timed_out = NULL) + WaitForValueEqualToAndSetValueTo(T wait_value, T new_value, + const TimeValue *abstime = nullptr, + bool *timed_out = nullptr) { int err = 0; // pthread_cond_timedwait() or pthread_cond_wait() will atomically @@ -408,7 +409,6 @@ public: return false; } - //------------------------------------------------------------------ /// Wait for \a m_value to not be equal to \a value. /// @@ -430,7 +430,7 @@ public: /// The new value if \b true is returned. /// /// @param[in] abstime - /// If non-NULL, the absolute time at which we should stop + /// If non-nullptr, the absolute time at which we should stop /// waiting, else wait an infinite amount of time. /// /// @return @@ -438,7 +438,7 @@ public: /// @li \b false otherwise //------------------------------------------------------------------ bool - WaitForValueNotEqualTo (T value, T &new_value, const TimeValue *abstime = NULL) + WaitForValueNotEqualTo(T value, T &new_value, const TimeValue *abstime = nullptr) { int err = 0; // pthread_cond_timedwait() or pthread_cond_wait() will atomically @@ -473,7 +473,6 @@ protected: Condition m_condition; ///< The pthread condition variable to use for signaling that data available or changed. private: - //------------------------------------------------------------------ /// Broadcast if needed. /// @@ -500,11 +499,9 @@ private: m_condition.Broadcast(); } - DISALLOW_COPY_AND_ASSIGN(Predicate); }; } // namespace lldb_private -#endif // #if defined(__cplusplus) -#endif // #ifndef liblldb_Predicate_h_ +#endif // liblldb_Predicate_h_ |