xo-umbrella2/xo-refcnt/include/xo/refcnt/Displayable.hpp
Roland Conybeare dafaad4b1e git subrepo clone git@github.com:Rconybea/xo-refcnt.git xo-refcnt
subrepo:
  subdir:   "xo-refcnt"
  merged:   "bad785bd"
upstream:
  origin:   "git@github.com:Rconybea/xo-refcnt.git"
  branch:   "main"
  commit:   "bad785bd"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 22:18:44 -04:00

29 lines
750 B
C++

/* @file Displayable.hpp */
#pragma once
#include "Refcounted.hpp"
namespace xo {
namespace ref {
class Displayable : public Refcount {
public:
/* write some kind of human-readable representation on stream */
virtual void display(std::ostream & os) const = 0;
std::string display_string() const;
}; /*Displayable*/
/* see also
* operator<<(std::ostream &, intrusive_ptr<T> const &)
* in [Refcounted.hpp]
*/
inline std::ostream &
operator<<(std::ostream &os, Displayable const & x) {
x.display(os);
return os;
} /*operator<<*/
} /*namespace ref*/
} /*namespace xo*/
/* end Displayable.hpp */