anatomist  5.1.2
3D neuroimaging data viewer
anatomist::CommandWriter Class Reference

CommandWriter is a helper class logging commands into a history file. More...

#include <anatomist/processor/Writer.h>

Inheritance diagram for anatomist::CommandWriter:
Collaboration diagram for anatomist::CommandWriter:

Public Member Functions

Constructors and Destructor
 CommandWriter ()
 Create a CommandWriter. More...
 
 CommandWriter (const std::string &filename)
 Create a CommandWriter to log commands. More...
 
virtual ~CommandWriter ()
 does nothing More...
 
File
void open (const std::string &filename)
 Attach to a file. More...
 
int operator! () const
 Create a CommandWriter to log commands. More...
 
- Public Member Functions inherited from anatomist::Observer
virtual ~Observer ()
 
- Public Member Functions inherited from anatomist::Serializer
 Serializer ()
 does nothing More...
 
virtual ~Serializer ()
 does nothing More...
 
int serialize (void *ptr)
 Generate a unique ID to serialize a pointer. More...
 

Command logging

virtual void update (const Observable *observable, void *arg)
 Log a command into the stream associated with the CommandWriter. More...
 

Additional Inherited Members

- Protected Member Functions inherited from anatomist::Observer
virtual void cleanupObserver ()
 call this function from inherited classes destructors. More...
 
virtual void registerObservable (Observable *)
 only called by Observable: don't use this function directly More...
 
virtual void unregisterObservable (Observable *)
 Called when an observable is destroyed, only called by Observable: don't use this function directly. More...
 
const std::set< Observable * > & observed () const
 
- Protected Attributes inherited from anatomist::Serializer
std::map< void *, int > _ptr2id
 Pointer to ID lookup table. More...
 
int _id
 Current ID: begin from 0 and increment with every new pointer. More...
 

Detailed Description

CommandWriter is a helper class logging commands into a history file.

Definition at line 61 of file Writer.h.

Constructor & Destructor Documentation

◆ CommandWriter() [1/2]

anatomist::CommandWriter::CommandWriter ( )

Create a CommandWriter.

◆ CommandWriter() [2/2]

anatomist::CommandWriter::CommandWriter ( const std::string &  filename)

Create a CommandWriter to log commands.

Parameters
filenamename of the file to log commands into

◆ ~CommandWriter()

virtual anatomist::CommandWriter::~CommandWriter ( )
virtual

does nothing

Member Function Documentation

◆ open()

void anatomist::CommandWriter::open ( const std::string &  filename)

Attach to a file.

Parameters
filenamename of the file to log commands into

◆ operator!()

int anatomist::CommandWriter::operator! ( ) const

Create a CommandWriter to log commands.

Parameters
filenamename of the file to log commands into

◆ update()

virtual void anatomist::CommandWriter::update ( const Observable observable,
void *  arg 
)
virtual

Log a command into the stream associated with the CommandWriter.

Parameters
observableobserved Processor
argcast back to a Processor::Memo to retrieve the command to log

Implements anatomist::Observer.


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