OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
CopyComponent Class Reference

#include <CopyComponent.hh>

Inheritance diagram for CopyComponent:
Inheritance graph
Collaboration diagram for CopyComponent:
Collaboration graph

Public Member Functions

 CopyComponent (EditPart *editPart)
 
 ~CopyComponent ()
 
bool Do ()
 
bool Undo ()
 
- Public Member Functions inherited from ComponentCommand
 ComponentCommand ()
 
virtual ~ComponentCommand ()
 
wxWindow * parentWindow ()
 
void setParentWindow (wxWindow *window)
 

Private Attributes

EditParteditPart_
 Component to copy. More...
 

Detailed Description

Command for copying components to the clipboard.

Definition at line 42 of file CopyComponent.hh.

Constructor & Destructor Documentation

◆ CopyComponent()

CopyComponent::CopyComponent ( EditPart editPart)

The Constructor.

Parameters
editPartFunction unit to delete.

Definition at line 46 of file CopyComponent.cc.

46  : editPart_(editPart) {
47 }

◆ ~CopyComponent()

CopyComponent::~CopyComponent ( )

The Destructor.

Definition at line 53 of file CopyComponent.cc.

53  {
54 }

Member Function Documentation

◆ Do()

bool CopyComponent::Do ( )
virtual

Executes the command.

Returns
true, if the command was succesfully executed, false otherwise.

Implements ComponentCommand.

Definition at line 63 of file CopyComponent.cc.

63  {
64  Component* component = dynamic_cast<Component*>(editPart_->model());
65  assert (component != NULL);
67  clipboard->setContents(component->saveState(), component->machine());
68  return true;
69 }

References assert, editPart_, ProDeClipboard::instance(), TTAMachine::Component::machine(), EditPart::model(), TTAMachine::Component::saveState(), and ProDeClipboard::setContents().

Here is the call graph for this function:

◆ Undo()

bool CopyComponent::Undo ( )

Undoing this command is not possible, returns always false.

Returns
Always false.

Definition at line 78 of file CopyComponent.cc.

78  {
79  return false;
80 }

Member Data Documentation

◆ editPart_

EditPart* CopyComponent::editPart_
private

Component to copy.

Definition at line 52 of file CopyComponent.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
TTAMachine::Component::saveState
virtual ObjectState * saveState() const
Definition: MachinePart.cc:189
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::Component
Definition: MachinePart.hh:90
EditPart::model
TTAMachine::MachinePart * model() const
ProDeClipboard::setContents
void setContents(ObjectState *contents, const TTAMachine::Machine *sourceMachine)
Definition: ProDeClipboard.cc:88
ProDeClipboard
Definition: ProDeClipboard.hh:47
TTAMachine::Component::machine
virtual Machine * machine() const
CopyComponent::editPart_
EditPart * editPart_
Component to copy.
Definition: CopyComponent.hh:52
ProDeClipboard::instance
static ProDeClipboard * instance()
Definition: ProDeClipboard.cc:62