Redefines cerr and cout as attributes of the class. More...

#include <OwnStream.h>

Inheritance diagram for OwnStream:
Reference::Able Reference::HeapTracked

Public Member Functions

 OwnStream ()
 Default constructor. More...
 
 OwnStream (const OwnStream &)
 Copy constructor. More...
 
const OwnStreamoperator= (const OwnStream &)
 Assignment operator.
 
virtual void set_cout (std::ostream &) const
 Set cout.
 
virtual void set_cerr (std::ostream &) const
 Set cerr.
 
- Public Member Functions inherited from Reference::Able
 Able ()
 Default constructor.
 
 Able (const Able &)
 Copy constructor.
 
Ableoperator= (const Able &)
 Assignment operator.
 
virtual ~Able ()
 Destructor.
 
unsigned get_reference_count () const
 Returns the number of references there are to this.
 
- Public Member Functions inherited from Reference::HeapTracked
 HeapTracked ()
 Default constructor.
 
 HeapTracked (const HeapTracked &)
 Copy constructor.
 
HeapTrackedoperator= (const HeapTracked &)
 Assignment operator.
 
virtual ~HeapTracked ()
 Destructor.
 
bool __is_on_heap () const
 Return true if this instance is found in heap addresses.
 

Protected Attributes

std::ostream cout
 
std::ostream cerr
 

Additional Inherited Members

- Static Public Member Functions inherited from Reference::Able
static size_t get_instance_count ()
 Returns the current number instances in existence.
 
- Static Public Member Functions inherited from Reference::HeapTracked
static void * operator new (size_t size, void *ptr=0)
 Records the addresses of new instances allocated on the heap.
 
static void operator delete (void *location, void *ptr)
 Placement delete overload to match the placement new overload.
 
static void operator delete (void *location)
 Regular delete overload.
 
static size_t get_heap_queue_size ()
 Return the number of heap addresses awaiting processing.
 
- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 Add the address of a reference to this object. More...
 
void __dereference (bool auto_delete=true) const
 Remove the address of a reference to this object. More...
 

Detailed Description

Redefines cerr and cout as attributes of the class.

Useful in multi-threaded applications: by simply inheriting this class, cerr and cout can be redirected to different files for different threads, or on an instance-by-instance basis.

Constructor & Destructor Documentation

◆ OwnStream() [1/2]

OwnStream::OwnStream ( )

Default constructor.

Constructor.

◆ OwnStream() [2/2]

OwnStream::OwnStream ( const OwnStream copy)

Copy constructor.

Constructor.


The documentation for this class was generated from the following files:

Generated using doxygen 1.8.17