From 35fa67768fd5f42a8506ae73bea9dbfe4ae0301f Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 2 Nov 2016 15:48:25 +0100 Subject: [PATCH] base: add 'Volatile_object::print' method The method prints the message "" if the object is not available. Otherwise, it prints the encapsulated object. --- repos/base/include/util/volatile_object.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/repos/base/include/util/volatile_object.h b/repos/base/include/util/volatile_object.h index 16f2142a35..a29da3a166 100644 --- a/repos/base/include/util/volatile_object.h +++ b/repos/base/include/util/volatile_object.h @@ -142,6 +142,14 @@ class Genode::Volatile_object MT const *operator -> () const { _check_constructed(); return _const_ptr(); } MT &operator * () { _check_constructed(); return *_ptr(); } + + void print(Output &out) const + { + if (_constructed) + _const_ptr()->print(out); + else + out.out_string(""); + } };