Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MULTI_CMD Class Reference

Perform multiple commands at once. More...

#include <command.H>

Inheritance diagram for MULTI_CMD:

Inheritance graph
[legend]
Collaboration diagram for MULTI_CMD:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void Own () const
void Free () const
int Lock ()
void Unlock ()
int Unique () const
Run-Time Type Id
 DEFINE_RTTI_METHODS3 ("MULTI_CMD", MULTI_CMD *, COMMAND, CCOMMAND *)
COMMAND List Operations
CLIST< COMMANDptr > & commands () const
bool is_empty () const
void add (CCOMMANDptr &cmd)
void rem (CCOMMANDptr &cmd)
COMMANDptr pop ()
CCOMMANDptrlast () const
Command Virtual Methods
virtual bool doit ()
 Execute the command.
virtual bool undoit ()
 Undo the command.
virtual bool clear ()
 After doit() and undoit() were called, restore things to the way they were before (may be a no-op for most derived classes).
Diagnostic
virtual void print () const

Protected Attributes

LIST< COMMANDptr > _commands
bool _is_done
 true if doit() was executed most recently.
bool _is_undone
 true if undoit() was executed most recently.

Detailed Description

Perform multiple commands at once.

Definition at line 273 of file command.H.


Member Function Documentation

void MULTI_CMD::add CCOMMANDptr cmd  )  [inline]
 

Definition at line 290 of file command.H.

References _commands.

bool MULTI_CMD::clear  )  [virtual]
 

After doit() and undoit() were called, restore things to the way they were before (may be a no-op for most derived classes).

Reimplemented from COMMAND.

Definition at line 108 of file command.C.

References _commands, ARRAY< T >::clear(), COMMAND::clear(), and ARRAY< T >::num().

CLIST<COMMANDptr>& MULTI_CMD::commands  )  const [inline]
 

Definition at line 287 of file command.H.

References _commands.

MULTI_CMD::DEFINE_RTTI_METHODS3 "MULTI_CMD"  ,
MULTI_CMD ,
COMMAND  ,
CCOMMAND
 

COMMAND::DEFINE_RTTI_METHODS_BASE "COMMAND"  ,
CCOMMAND
[inherited]
 

bool MULTI_CMD::doit  )  [virtual]
 

Execute the command.

Returns:
true on success. If the command is already done, this is a no-op and still returns true.

Reimplemented from COMMAND.

Definition at line 89 of file command.C.

References _commands, COMMAND::doit(), and ARRAY< T >::num().

void REFcounter::Free  )  const [inline, inherited]
 

Definition at line 76 of file ref.H.

References REFcounter::_mutex, REFcounter::_u, and REF_ME.

bool COMMAND::is_clear  )  const [inline, inherited]
 

Neither doit() nor undoit() have been called.

Definition at line 91 of file command.H.

References COMMAND::_is_done, and COMMAND::_is_undone.

bool COMMAND::is_done  )  const [inline, inherited]
 

doit() was called most recently.

Definition at line 94 of file command.H.

References COMMAND::_is_done.

Referenced by COMMAND::clear().

bool MULTI_CMD::is_empty  )  const [inline]
 

Definition at line 288 of file command.H.

References _commands, and ARRAY< T >::empty().

bool COMMAND::is_undone  )  const [inline, inherited]
 

undoit() was called most recently, after doit().

Definition at line 97 of file command.H.

References COMMAND::_is_undone.

CCOMMANDptr& MULTI_CMD::last  )  const [inline]
 

Definition at line 294 of file command.H.

References _commands, and ARRAY< T >::last().

int REFcounter::Lock  )  [inline, inherited]
 

Definition at line 105 of file ref.H.

References REFcounter::_mutex, and REFcounter::_u.

Referenced by REFlock::REFlock().

void REFcounter::Own  )  const [inline, inherited]
 

Definition at line 59 of file ref.H.

References REFcounter::_mutex, REFcounter::_u, and REF_ME.

COMMANDptr MULTI_CMD::pop  )  [inline]
 

Definition at line 292 of file command.H.

References _commands, and ARRAY< T >::pop().

virtual void MULTI_CMD::print  )  const [inline, virtual]
 

Reimplemented from COMMAND.

Definition at line 310 of file command.H.

References _commands, and ARRAY< T >::num().

void MULTI_CMD::rem CCOMMANDptr cmd  )  [inline]
 

Definition at line 291 of file command.H.

References _commands.

bool MULTI_CMD::undoit  )  [virtual]
 

Undo the command.

Returns:
true on success. If the command is already undone, this is a no-op and still returns true.

Reimplemented from COMMAND.

Definition at line 98 of file command.C.

References _commands, ARRAY< T >::num(), and COMMAND::undoit().

int REFcounter::Unique  )  const [inline, inherited]
 

Definition at line 115 of file ref.H.

References REFcounter::_mutex, and REFcounter::_u.

void REFcounter::Unlock  )  [inline, inherited]
 

Definition at line 111 of file ref.H.

References REFcounter::_mutex, and REFcounter::_u.

Referenced by REFlock::~REFlock().


Member Data Documentation

LIST<COMMANDptr> MULTI_CMD::_commands [protected]
 

Definition at line 321 of file command.H.

Referenced by add(), clear(), commands(), doit(), is_empty(), last(), pop(), print(), rem(), and undoit().

bool COMMAND::_is_done [protected, inherited]
 

true if doit() was executed most recently.

Definition at line 129 of file command.H.

Referenced by COMMAND::clear(), COMMAND::doit(), COMMAND::is_clear(), COMMAND::is_done(), and COMMAND::undoit().

bool COMMAND::_is_undone [protected, inherited]
 

true if undoit() was executed most recently.

Definition at line 130 of file command.H.

Referenced by COMMAND::clear(), COMMAND::doit(), COMMAND::is_clear(), COMMAND::is_undone(), and COMMAND::undoit().


The documentation for this class was generated from the following files:
Generated on Mon Sep 18 11:46:44 2006 for jot by  doxygen 1.4.4