+ implementation
This commit is contained in:
parent
0e18026fba
commit
87b4bfa795
10 changed files with 1446 additions and 0 deletions
29
include/refcnt/Displayable.hpp
Normal file
29
include/refcnt/Displayable.hpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* @file Displayable.hpp */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "refcnt/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 */
|
||||
Loading…
Add table
Add a link
Reference in a new issue