From c46f51fb454cffb0b01eb297e18e394da8e710b4 Mon Sep 17 00:00:00 2001 From: X512 Date: Thu, 10 Dec 2020 03:02:39 +0900 Subject: [PATCH] BReference: add IsSet method Change-Id: Ibc34dbde3b81faecdc7fe66a2c07fc33d7871ce2 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3487 Reviewed-by: Adrien Destugues --- headers/os/support/Referenceable.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/headers/os/support/Referenceable.h b/headers/os/support/Referenceable.h index 5a4fff7a6e..e7ab5d67a4 100644 --- a/headers/os/support/Referenceable.h +++ b/headers/os/support/Referenceable.h @@ -91,6 +91,11 @@ public: } } + bool IsSet() const + { + return fObject != NULL; + } + Type* Get() const { return fObject; @@ -197,6 +202,11 @@ public: fReference.Unset(); } + bool IsSet() const + { + return fReference.IsSet(); + } + const Type* Get() const { return fReference.Get();