OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
ProDeFUEditPolicy Class Reference

#include <ProDeFUEditPolicy.hh>

Inheritance diagram for ProDeFUEditPolicy:
Inheritance graph
Collaboration diagram for ProDeFUEditPolicy:
Collaboration graph

Public Member Functions

 ProDeFUEditPolicy ()
 
virtual ~ProDeFUEditPolicy ()
 
virtual ComponentCommandgetCommand (Request *request)
 
virtual bool canHandle (Request *request) const
 
- Public Member Functions inherited from EditPolicy
 EditPolicy ()
 
virtual ~EditPolicy ()
 
EditParthost () const
 
void setHost (EditPart *host)
 

Private Member Functions

ProDeFUEditPolicyoperator= (ProDeFUEditPolicy &old)
 Assignment not allowed.
 
 ProDeFUEditPolicy (ProDeFUEditPolicy &old)
 Copying not allowed.
 

Additional Inherited Members

- Protected Attributes inherited from EditPolicy
EditParthost_
 Host EditPart of this EditPolicy.
 

Detailed Description

Determines how a function unit EditPart acts when a Request is performed on it.

Converts a given Request to a Command if the EditPolicy supports the Request.

Definition at line 49 of file ProDeFUEditPolicy.hh.

Constructor & Destructor Documentation

◆ ProDeFUEditPolicy() [1/2]

ProDeFUEditPolicy::ProDeFUEditPolicy ( )

The Constructor.

Definition at line 53 of file ProDeFUEditPolicy.cc.

53 : EditPolicy() {
54}

◆ ~ProDeFUEditPolicy()

ProDeFUEditPolicy::~ProDeFUEditPolicy ( )
virtual

The Destructor.

Definition at line 59 of file ProDeFUEditPolicy.cc.

59 {
60}

◆ ProDeFUEditPolicy() [2/2]

ProDeFUEditPolicy::ProDeFUEditPolicy ( ProDeFUEditPolicy old)
private

Copying not allowed.

Member Function Documentation

◆ canHandle()

bool ProDeFUEditPolicy::canHandle ( Request request) const
virtual

Tells whether this EditPolicy is able to handle a certain type of Request.

Parameters
requestRequest to be asked if it can be handled.
Returns
True if the Request can be handled, false otherwise.

Implements EditPolicy.

Definition at line 107 of file ProDeFUEditPolicy.cc.

107 {
108 Request::RequestType type = request->type();
109 if (type == Request::MODIFY_REQUEST ||
110 type == Request::DELETE_REQUEST ||
111 type == Request::COPY_REQUEST ||
112 type == Request::STATUS_REQUEST) {
113 return true;
114 } else {
115 return false;
116 }
117}
RequestType
Data type for determining the type of a Request.
Definition Request.hh:46
@ STATUS_REQUEST
Status request.
Definition Request.hh:52
@ MODIFY_REQUEST
Modfify request.
Definition Request.hh:48
@ DELETE_REQUEST
Delete request.
Definition Request.hh:49
@ COPY_REQUEST
Copy request.
Definition Request.hh:51
RequestType type() const

References Request::COPY_REQUEST, Request::DELETE_REQUEST, Request::MODIFY_REQUEST, Request::STATUS_REQUEST, and Request::type().

Here is the call graph for this function:

◆ getCommand()

ComponentCommand * ProDeFUEditPolicy::getCommand ( Request request)
virtual

Returns the Command corresponding to the type of the Request.

Parameters
requestRequest to be handled.
Returns
NULL if the Request cannot be handled.

Implements EditPolicy.

Definition at line 69 of file ProDeFUEditPolicy.cc.

69 {
70
71 Request::RequestType type = request->type();
72
73 if (type == Request::MODIFY_REQUEST) {
74 ModifyFUCmd* modifyCmd = new ModifyFUCmd(host_);
75 return modifyCmd;
76
77 } else if (type == Request::DELETE_REQUEST) {
78 DeleteFUCmd* deleteCmd = new DeleteFUCmd(host_);
79 return deleteCmd;
80
81 } else if (type == Request::COPY_REQUEST) {
82 CopyComponent* copyCmd = new CopyComponent(host_);
83 return copyCmd;
84
85 } else if (type == Request::STATUS_REQUEST) {
86
88 FunctionUnit* fu = dynamic_cast<FunctionUnit*>(host_->model());
89 format fmt = generator->text(ProDeTextGenerator::STATUS_FUNCTION_UNIT);
90 fmt % fu->name();
91 SetStatusTextCmd* statusCmd = new SetStatusTextCmd(fmt.str());
92 return statusCmd;
93
94 } else {
95 return NULL;
96 }
97}
TTAMachine::MachinePart * model() const
EditPart * host_
Host EditPart of this EditPolicy.
Definition EditPolicy.hh:74
static ProDeTextGenerator * instance()
@ STATUS_FUNCTION_UNIT
Status line template for FUs.
virtual TCEString name() const
virtual boost::format text(int textId)

References Request::COPY_REQUEST, Request::DELETE_REQUEST, EditPolicy::host_, ProDeTextGenerator::instance(), EditPart::model(), Request::MODIFY_REQUEST, TTAMachine::Component::name(), ProDeTextGenerator::STATUS_FUNCTION_UNIT, Request::STATUS_REQUEST, Texts::TextGenerator::text(), and Request::type().

Here is the call graph for this function:

◆ operator=()

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

Assignment not allowed.


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