mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
base: add 'Volatile_object::print' method
The method prints the message "<unconstructed>" if the object is not available. Otherwise, it prints the encapsulated object.
This commit is contained in:
parent
a27cbfd371
commit
35fa67768f
@ -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("<unconstructed>");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user