anatomist  5.0.5
3D neuroimaging data viewer
anatomist::Processor Class Reference

The command processor receives commands to manage and execute. More...

#include <anatomist/processor/Processor.h>

Inheritance diagram for anatomist::Processor:
Collaboration diagram for anatomist::Processor:

Classes

class  Memo
 

Public Member Functions

 Processor ()
 
virtual ~Processor ()
 
void execute (Command *c)
 Give a command to execute. More...
 
Commandexecute (const std::string &cname, const std::string &params="", CommandContext *cc=0)
 build and execute a command More...
 
Commandexecute (const std::string &cname, carto::Object params=carto::none(), CommandContext *cc=0)
 build and execute a command More...
 
bool undo ()
 Undo last done command. More...
 
bool redo ()
 Redo last undone command. More...
 
void allowExecWhileIdle (bool)
 
bool execWhileIdle () const
 
bool idle () const
 
- Public Member Functions inherited from anatomist::Observable
 Observable ()
 Construct an Observable with zero observers. More...
 
virtual ~Observable ()
 does nothing More...
 
void addObserver (Observer *observer)
 Adds an observer to the set of observers for this object. More...
 
void deleteObserver (Observer *observer)
 Deletes an observer from the set of observers of this object. More...
 
void deleteObservers ()
 Clears the observer list so that this object no longer has any observers (doesn't call any observer method - see notifyUnregisterObservers() for this ) More...
 
int countObservers () const
 Returns the number of observers of this object. More...
 
virtual void notifyObservers (void *arg=0)
 If this object has changed, as indicated by the hasChanged method, then notify all of its observers. More...
 
virtual void notifyUnregisterObservers ()
 Notifies observable destruction to all observers and unregisters them. More...
 
bool hasChanged () const
 Tests if this object has changed. More...
 
bool obsHasChanged (int) const
 only valid during an Observer::update() More...
 
bool obsHasChanged (const std::string &) const
 only valid during an Observer::update() More...
 
void setChanged () const
 Indicates that this object has changed. More...
 
- Public Member Functions inherited from carto::SharedObject
 SharedObject ()
 
 SharedObject (const SharedObject &x)
 
virtual ~SharedObject ()
 
SharedObjectoperator= (const SharedObject &)
 
bool testDeletable ()
 
bool tryDelete ()
 
- Public Member Functions inherited from carto::WeakObject
void attachWeakPtr (weak_ptr< T > &) const
 
void detachWeakPtr (weak_ptr< T > &) const
 
void attachWeakPtr (weak_shared_ptr< T > &) const
 
void detachWeakPtr (weak_shared_ptr< T > &) const
 
virtual ~WeakObject ()
 
- Public Member Functions inherited from carto::RCObject
 RCObject ()
 
 RCObject (const RCObject &)
 
RCObjectoperator= (const RCObject &)
 
virtual ~RCObject ()
 

Additional Inherited Members

- Public Types inherited from carto::RCObject
typedef int RefCounterType
 
- Protected Member Functions inherited from anatomist::Observable
void clearChanged () const
 Indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change. More...
 
void obsSetChanged (int, bool=true) const
 int-based change flags (use enums to address them) More...
 
void obsSetChanged (const std::string &, bool=true) const
 string-based change flags More...
 
- Protected Member Functions inherited from carto::SharedObject
void disableRefCount ()
 
- Protected Member Functions inherited from carto::WeakObject
 WeakObject ()
 
 WeakObject (const WeakObject &)
 
WeakObjectoperator= (const WeakObject &)
 

Detailed Description

The command processor receives commands to manage and execute.

\ Commands can be later undone and redone. From the moment a command is pushed to the processor, the processor becomes the owner of the command and manages its lifecycle. \ the Command Processor has no knowledge of the concrete subclasses of Command and accesses them through the standard Command interface.

See also
Command

Definition at line 66 of file Processor.h.

Constructor & Destructor Documentation

◆ Processor()

anatomist::Processor::Processor ( )

◆ ~Processor()

virtual anatomist::Processor::~Processor ( )
virtual

Member Function Documentation

◆ allowExecWhileIdle()

void anatomist::Processor::allowExecWhileIdle ( bool  )

◆ execute() [1/3]

void anatomist::Processor::execute ( Command c)

Give a command to execute.

Parameters
ccommand to execute

◆ execute() [2/3]

Command* anatomist::Processor::execute ( const std::string &  cname,
const std::string &  params = "",
CommandContext cc = 0 
)

build and execute a command

Parameters
cnameis the command type (syntactic attribute)
paramsis a string formatted as a python dictionary
ccIO and ID namespace for command execution
Returns
the executed command

◆ execute() [3/3]

Command* anatomist::Processor::execute ( const std::string &  cname,
carto::Object  params = carto::none(),
CommandContext cc = 0 
)

build and execute a command

Parameters
cnameis the command type (syntactic attribute)
paramsis a python dictionary carto::Object
ccIO and ID namespace for command execution
Returns
the executed command

◆ execWhileIdle()

bool anatomist::Processor::execWhileIdle ( ) const

◆ idle()

bool anatomist::Processor::idle ( ) const

◆ redo()

bool anatomist::Processor::redo ( )

Redo last undone command.

◆ undo()

bool anatomist::Processor::undo ( )

Undo last done command.


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