frepple::CommandMoveOperationPlan Class Reference

This class represents the command of moving an operationplan to a new date and/or resizing it. More...

#include <model.h>

Inheritance diagram for frepple::CommandMoveOperationPlan:
frepple::utils::Command

List of all members.

Public Member Functions

 CommandMoveOperationPlan (OperationPlan *opplanptr, Date newDate, bool startOrEnd=true, double newQty=-1.0)
void execute ()
string getDescription () const
OperationPlangetOperationPlan () const
void setDate (Date newdate)
void setQuantity (double newqty)
void undo ()
bool undoable () const
 ~CommandMoveOperationPlan ()

Detailed Description

This class represents the command of moving an operationplan to a new date and/or resizing it.

Definition at line 4886 of file model.h.


Constructor & Destructor Documentation

frepple::CommandMoveOperationPlan::CommandMoveOperationPlan ( OperationPlan opplanptr,
Date  newDate,
bool  startOrEnd = true,
double  newQty = -1.0 
)

Constructor.
Unlike most other commands the constructor already executes the change.

Parameters:
opplanptr Pointer to the operationplan being moved.
newDate New date of the operationplan.
startOrEnd Specifies whether the new date is the start (=false) or end date (=true). By default we use the end date.
newQty New quantity of the operationplan.The default is -1, which indicates to leave the quantity unchanged.

Definition at line 446 of file model/actions.cpp.

frepple::CommandMoveOperationPlan::~CommandMoveOperationPlan (  )  [inline]

Definition at line 4903 of file model.h.


Member Function Documentation

void frepple::CommandMoveOperationPlan::execute (  )  [inline, virtual]

This method is used to actually execute the action.
A couple of notes on how this method should be implemented by the subclasses:

  • Calling the method multiple times is harmless and results in the same state change as calling it only once.

Implements frepple::utils::Command.

Definition at line 4900 of file model.h.

string frepple::CommandMoveOperationPlan::getDescription (  )  const [virtual]

Reimplemented from frepple::utils::Command.

Definition at line 502 of file model/actions.cpp.

OperationPlan* frepple::CommandMoveOperationPlan::getOperationPlan (  )  const [inline]

Definition at line 4904 of file model.h.

void frepple::CommandMoveOperationPlan::setDate ( Date  newdate  ) 

Set another date for the operationplan.

Parameters:
newdate New start- or end date.

Definition at line 474 of file model/actions.cpp.

void frepple::CommandMoveOperationPlan::setQuantity ( double  newqty  ) 

Set another quantity for the operationplan.

Parameters:
newqty New quantity.

Definition at line 488 of file model/actions.cpp.

void frepple::CommandMoveOperationPlan::undo (  )  [virtual]

This method is undoing the state change of the execute() method.
Reversing the action is not possible for all commands. Command subclasses should override the undo() and undoable() method in case they are reversible.
A couple of notes on how this method should be implemented by the subclasses:

  • Calling the undo() method is harmless if the execute() hasn't been called yet.
  • Calling the undo() method multiple times is harmless and results in the same state change as calling it only once.

Reimplemented from frepple::utils::Command.

Definition at line 464 of file model/actions.cpp.

bool frepple::CommandMoveOperationPlan::undoable (  )  const [inline, virtual]

Returns true if the execution of this command can be undone.

Reimplemented from frepple::utils::Command.

Definition at line 4902 of file model.h.


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

Generated on 25 Feb 2010 for frePPLe by  doxygen 1.6.1