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

#include <RootEditPart.hh>

Inheritance diagram for RootEditPart:
Inheritance graph
Collaboration diagram for RootEditPart:
Collaboration graph

Public Member Functions

 RootEditPart ()
 
virtual ~RootEditPart ()
 
EditPartcontents () const
 
void setContents (EditPart *contents)
 
- Public Member Functions inherited from EditPart
 EditPart ()
 
virtual ~EditPart ()
 
void putGarbage (std::set< EditPart * > &trashbag)
 
EditPartparent () const
 
void setParent (EditPart *parent)
 
TTAMachine::MachinePartmodel () const
 
void setModel (TTAMachine::MachinePart *model)
 
Figurefigure () const
 
void setFigure (Figure *figure)
 
EditPartfind (wxPoint point)
 
EditPartfind (const TTAMachine::MachinePart *model)
 
EditPartfindNearest (wxPoint point, const EditPart *exclude=NULL)
 
int findInRange (wxPoint point, float radius, std::vector< EditPart * > &found)
 
bool hasEditPartRecursive (const EditPart *part) const
 
bool selectable () const
 
bool selected () const
 
void setSelectable (bool selectable)
 
void setSelected (bool select)
 
void installEditPolicy (EditPolicy *editpolicy)
 
void addChild (EditPart *child)
 
int childCount () const
 
EditPartchild (unsigned int index) const
 
ComponentCommandperformRequest (Request *request) const
 
bool canHandle (Request *request) const
 

Private Member Functions

RootEditPartoperator= (RootEditPart &old)
 Assignment not allowed. More...
 
 RootEditPart (RootEditPart &old)
 Copying not allowed. More...
 
void collectTrash ()
 

Private Attributes

EditPartcontents_
 Contents EditPart which parents all EditParts in the View. More...
 

Additional Inherited Members

- Protected Attributes inherited from EditPart
EditPartparent_
 Parent of this EditPart. More...
 
Figurefigure_
 Figure of this EditPart. More...
 
TTAMachine::MachinePartmodel_
 Machine component corresponding to this EditPart. More...
 
bool selectable_
 Tells whether the EditPart is selectable or not. More...
 
bool selected_
 Tells whether the EditPart is selected or not. More...
 
bool garbageCollected_
 Helper member to prevent improper deletion. More...
 
std::vector< EditPolicy * > editPolicies_
 List of supported EditPolicies. More...
 
std::vector< EditPart * > children_
 List of children EditParts. More...
 

Detailed Description

The root EditPart of the whole processor view.

Contains contents EditPart.

Definition at line 44 of file RootEditPart.hh.

Constructor & Destructor Documentation

◆ RootEditPart() [1/2]

RootEditPart::RootEditPart ( )

The Constructor.

Definition at line 45 of file RootEditPart.cc.

45  : EditPart(), contents_(NULL) {
46 }

◆ ~RootEditPart()

RootEditPart::~RootEditPart ( )
virtual

The Destructor.

Collects garbage from the contents EditPart and deletes it all.

Definition at line 53 of file RootEditPart.cc.

53  {
54  collectTrash();
55 }

References collectTrash().

Here is the call graph for this function:

◆ RootEditPart() [2/2]

RootEditPart::RootEditPart ( RootEditPart old)
private

Copying not allowed.

Member Function Documentation

◆ collectTrash()

void RootEditPart::collectTrash ( )
private

Collects trash from the contents EditPart and deletes it.

Definition at line 73 of file RootEditPart.cc.

73  {
74 
75  if (contents_ != NULL) {
76 
77  set<EditPart*> trashbag;
78  contents_->putGarbage(trashbag);
79 
80  for (set<EditPart*>::iterator i = trashbag.begin();
81  i != trashbag.end(); i++) {
82  delete *i;
83  }
84 
85  }
86  garbageCollected_ = true;
87 }

References contents_, EditPart::garbageCollected_, and EditPart::putGarbage().

Referenced by setContents(), and ~RootEditPart().

Here is the call graph for this function:

◆ contents()

EditPart* RootEditPart::contents ( ) const

◆ operator=()

RootEditPart& RootEditPart::operator= ( RootEditPart old)
private

Assignment not allowed.

◆ setContents()

void RootEditPart::setContents ( EditPart contents)

Sets the contents EditPart of the whole view.

Parameters
contentsThe new contents EditPart.

Definition at line 63 of file RootEditPart.cc.

63  {
64  collectTrash();
66  garbageCollected_ = false;
67 }

References collectTrash(), contents(), contents_, and EditPart::garbageCollected_.

Referenced by MachineCanvas::updateMachine().

Here is the call graph for this function:

Member Data Documentation

◆ contents_

EditPart* RootEditPart::contents_
private

Contents EditPart which parents all EditParts in the View.

Definition at line 60 of file RootEditPart.hh.

Referenced by collectTrash(), and setContents().


The documentation for this class was generated from the following files:
EditPart::garbageCollected_
bool garbageCollected_
Helper member to prevent improper deletion.
Definition: EditPart.hh:102
RootEditPart::collectTrash
void collectTrash()
Definition: RootEditPart.cc:73
RootEditPart::contents
EditPart * contents() const
EditPart::EditPart
EditPart()
Definition: EditPart.cc:60
RootEditPart::contents_
EditPart * contents_
Contents EditPart which parents all EditParts in the View.
Definition: RootEditPart.hh:60
EditPart::putGarbage
void putGarbage(std::set< EditPart * > &trashbag)
Definition: EditPart.cc:87