CODCommand Class

class CODCommand: public MvcCommand

This is the base class for all command objects in Objective Views. A command encapsulates an action that is performed on a set of components in a  CODModel object. Commands are implemented in derived classes that override the Execute and Unexecute methods. A pointer to the CODModel object is passed into the constructor  CODCommand. Command objects support several methods for adding and removing components. Pointers to the components affected by the command are stored in the m_setComponents member.

Defined in: OdCommand.h

See Also

CODModel

Class Members

 CODCommand(CODModel* pModel)

Constructor.

virtual  ~CODCommand()

Destructor.

CODModel*  m_pModel

The model the components are in.

CODComponentSet  m_setComponents

The components to perform the command on.

int m_nUpdateType

The type of update to be performed.

virtual BOOL  Unexecute()

Undo the command.

virtual sfl::MvcCommand*  Inverse() const

Create a command that is the inverse of this command.

virtual int  GetUpdateType() const

Gets the type of update to be performed.

virtual void  SetUpdateType(const int nUpdateType)

Sets the type of update to be performed.

virtual void  GetUpdateSet(CODComponentSet& setUpdate) const

Returns a list of components that are affected by this command.

CODComponentSet*  GetComponents()

Returns a pointer to the list of components directly acted upon by this command

virtual void  AddComponent(CODComponent* pComp)

Adds a component to the list of affected components.

virtual void  AddComponents(CODComponentSet* pCompSet)

Adds multiple components to the list of affected components.

virtual void  RemoveComponent(CODComponent* pComp)

Removes a component to the list of affected components.

virtual void  RemoveAllComponents()

Removes all of the components from the list of affected components.

CODModel*  GetModel()

Returns a pointer to the model the components are in.