Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
CommandQueue Class Reference

A structure for managing commands. More...

#include <commandQueue.h>

List of all members.

Public Member Functions

 CommandQueue ()
 Defaut Constructor.
 CommandQueue (unsigned int max_size)
 Constructor.
void execute (CommandPtr)
 Executes a command. If the command has an undo function, then adds the command to the queue.
unsigned int setMaxSize (unsigned int size)
void undo ()
 Undoes the last command by poping the tail of the queue, invoke the undo function of the command.
 ~CommandQueue ()
 Destructor.

Static Public Attributes

static const unsigned int DEFAULT_MAX_SIZE_ = 200
 The default maximal size of the depth limit.

Private Member Functions

 CommandQueue (const CommandQueue &)
 Copy constructor - object is non-copyable.
void enforceDequeLimit ()
 Enforces the depth limit of the command queue. If the depth is larger than the depth limit, a deque operation will be invoked.
CommandQueueoperator= (const CommandQueue &)
 Equal operator - object is non-copyable.

Private Attributes

std::deque< CommandPtrcommand_deque_
 The internal representation of this object.
unsigned int depth_limit_
 The depth limit of the command queue.

Detailed Description

A structure for managing commands.

A command queue object provides a dequeue of commands as well as operations to manipulate the commands in the queue. Operations include executing and undoing the commands in the queue. A command queue object is non-copyable.

Definition at line 53 of file commandQueue.h.


Constructor & Destructor Documentation

Defaut Constructor.

Creates a command queue object and makes its depth limit be the default value.

Definition at line 44 of file commandQueue.cpp.

CommandQueue::CommandQueue ( unsigned int  max_size)

Constructor.

Create a command queue with specified depth limit.

Parameters:
max_sizethe value to be used to set the depth limit of this object.

Definition at line 48 of file commandQueue.cpp.

Destructor.

Definition at line 68 of file commandQueue.h.

CommandQueue::CommandQueue ( const CommandQueue ) [inline, private]

Copy constructor - object is non-copyable.

Definition at line 99 of file commandQueue.h.


Member Function Documentation

void CommandQueue::enforceDequeLimit ( ) [private]

Enforces the depth limit of the command queue. If the depth is larger than the depth limit, a deque operation will be invoked.

Definition at line 53 of file commandQueue.cpp.

void CommandQueue::execute ( CommandPtr  command_ptr)

Executes a command. If the command has an undo function, then adds the command to the queue.

Parameters:
command_ptra shared pointer pointing to a command object whose execute function will be invoked by this object.

Definition at line 61 of file commandQueue.cpp.

CommandQueue& CommandQueue::operator= ( const CommandQueue ) [inline, private]

Equal operator - object is non-copyable.

Definition at line 106 of file commandQueue.h.

unsigned int CommandQueue::setMaxSize ( unsigned int  size)

Changes the command history limit.

If the passed size is smaller than the current size then the oldest commands are removed (their undo functions are not called).

Parameters:
sizeThe new maximum number of commands that may exist in this queue for undo purposes.
Returns:
The actual maximum size set. It may happen that the passed value is too large and cannot be set.

Definition at line 84 of file commandQueue.cpp.

Undoes the last command by poping the tail of the queue, invoke the undo function of the command.

Definition at line 74 of file commandQueue.cpp.


Member Data Documentation

The internal representation of this object.

Definition at line 117 of file commandQueue.h.

const unsigned int CommandQueue::DEFAULT_MAX_SIZE_ = 200 [static]

The default maximal size of the depth limit.

Definition at line 95 of file commandQueue.h.

unsigned int CommandQueue::depth_limit_ [private]

The depth limit of the command queue.

Definition at line 120 of file commandQueue.h.


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


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:38:49