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

#include <ProDeBridgeEditPolicy.hh>

Inheritance diagram for ProDeBridgeEditPolicy:
Inheritance graph
Collaboration diagram for ProDeBridgeEditPolicy:
Collaboration graph

Public Member Functions

 ProDeBridgeEditPolicy ()
 
virtual ~ProDeBridgeEditPolicy ()
 
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

ProDeBridgeEditPolicyoperator= (ProDeBridgeEditPolicy &old)
 Assignment not allowed.
 
 ProDeBridgeEditPolicy (ProDeBridgeEditPolicy &old)
 Copying not allowed.
 

Additional Inherited Members

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

Detailed Description

Determines how a bridge 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 ProDeBridgeEditPolicy.hh.

Constructor & Destructor Documentation

◆ ProDeBridgeEditPolicy() [1/2]

ProDeBridgeEditPolicy::ProDeBridgeEditPolicy ( )

The Constructor.

Definition at line 52 of file ProDeBridgeEditPolicy.cc.

52 : EditPolicy() {
53}

◆ ~ProDeBridgeEditPolicy()

ProDeBridgeEditPolicy::~ProDeBridgeEditPolicy ( )
virtual

The Destructor.

Definition at line 58 of file ProDeBridgeEditPolicy.cc.

58 {
59}

◆ ProDeBridgeEditPolicy() [2/2]

ProDeBridgeEditPolicy::ProDeBridgeEditPolicy ( ProDeBridgeEditPolicy old)
private

Copying not allowed.

Member Function Documentation

◆ canHandle()

bool ProDeBridgeEditPolicy::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 101 of file ProDeBridgeEditPolicy.cc.

101 {
102 Request::RequestType type = request->type();
103 if (type == Request::MODIFY_REQUEST ||
104 type == Request::DELETE_REQUEST ||
105 type == Request::STATUS_REQUEST) {
106 return true;
107 } else {
108 return false;
109 }
110}
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
RequestType type() const

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

Here is the call graph for this function:

◆ getCommand()

ComponentCommand * ProDeBridgeEditPolicy::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 68 of file ProDeBridgeEditPolicy.cc.

68 {
69
70 Request::RequestType type = request->type();
71
72 if (type == Request::MODIFY_REQUEST) {
73 ModifyBridgeCmd* modifyCmd = new ModifyBridgeCmd(host_);
74 return modifyCmd;
75
76 } else if (type == Request::DELETE_REQUEST) {
77 DeleteBridgeCmd* deleteCmd = new DeleteBridgeCmd(host_);
78 return deleteCmd;
79
80 } else if (type == Request::STATUS_REQUEST) {
82 Bridge* bridge = dynamic_cast<Bridge*>(host_->model());
83 format fmt = generator->text(ProDeTextGenerator::STATUS_BRIDGE);
84 fmt % bridge->name();
85 SetStatusTextCmd* statusCmd = new SetStatusTextCmd(fmt.str());
86 return statusCmd;
87
88 } else {
89 return NULL;
90 }
91}
TTAMachine::MachinePart * model() const
EditPart * host_
Host EditPart of this EditPolicy.
Definition EditPolicy.hh:74
static ProDeTextGenerator * instance()
@ STATUS_BRIDGE
Status line template for bridges.
virtual TCEString name() const
virtual boost::format text(int textId)

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

Here is the call graph for this function:

◆ operator=()

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

Assignment not allowed.


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