OpenASIP  2.0
Public Member Functions | List of all members
ProximFUEditPolicy Class Reference

#include <ProximFUEditPolicy.hh>

Inheritance diagram for ProximFUEditPolicy:
Inheritance graph
Collaboration diagram for ProximFUEditPolicy:
Collaboration graph

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

Edit policy for proxim machine window function units.

Definition at line 41 of file ProximFUEditPolicy.hh.

Constructor & Destructor Documentation

◆ ProximFUEditPolicy()

ProximFUEditPolicy::ProximFUEditPolicy ( )

The Constructor.

Definition at line 47 of file ProximFUEditPolicy.cc.

47  :
48  EditPolicy() {
49 }

◆ ~ProximFUEditPolicy()

ProximFUEditPolicy::~ProximFUEditPolicy ( )
virtual

The Destructor.

Definition at line 55 of file ProximFUEditPolicy.cc.

55  {
56 }

Member Function Documentation

◆ canHandle()

bool ProximFUEditPolicy::canHandle ( Request request) const
virtual

Tells whether this EditPolicy can handle request of the given type.

Parameters
Requestto be handled.
Returns
True, if the editpolicy can handle give request type.

Implements EditPolicy.

Definition at line 65 of file ProximFUEditPolicy.cc.

65  {
66 
67  Request::RequestType type = request->type();
68  if (type == Request::MODIFY_REQUEST ||
69  type == Request::STATUS_REQUEST ||
70  type == Request::DETAILS_REQUEST) {
71 
72  return true;
73  }
74 
75  return false;
76 }

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

Here is the call graph for this function:

◆ getCommand()

ComponentCommand * ProximFUEditPolicy::getCommand ( Request request)
virtual

Returns command correspoding to the request type.

Parameters
requestRequest to handle.
Returns
NULL, if the request can't be handled.

Implements EditPolicy.

Definition at line 86 of file ProximFUEditPolicy.cc.

86  {
87 
88  Request::RequestType type = request->type();
89 
90  if (type == Request::MODIFY_REQUEST) {
91  return new ProximShowPortsCmd(host_);
92  } else if (type == Request::STATUS_REQUEST) {
93  const FunctionUnit* fu = dynamic_cast<const FunctionUnit*>(
94  host_->model());
95  assert(fu != NULL);
96  std::string status = ProximConstants::MACH_WIN_FU_LABEL + fu->name();
97  return new ProximComponentStatusCmd(status);
98  } else if (type == Request::DETAILS_REQUEST) {
99  const FunctionUnit* fu = dynamic_cast<const FunctionUnit*>(
100  host_->model());
101  assert(fu != NULL);
102  return new ProximFUDetailsCmd(*fu);
103  }
104 
105  return NULL;
106 }

References assert, Request::DETAILS_REQUEST, EditPolicy::host_, ProximConstants::MACH_WIN_FU_LABEL, EditPart::model(), Request::MODIFY_REQUEST, TTAMachine::Component::name(), Request::STATUS_REQUEST, and Request::type().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
Request::type
RequestType type() const
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
ProximFUDetailsCmd
Definition: ProximFUDetailsCmd.hh:46
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
Request::DETAILS_REQUEST
@ DETAILS_REQUEST
Detailed info request.
Definition: Request.hh:53
EditPolicy::host_
EditPart * host_
Host EditPart of this EditPolicy.
Definition: EditPolicy.hh:74
ProximShowPortsCmd
Definition: ProximShowPortsCmd.hh:45
EditPolicy::EditPolicy
EditPolicy()
Definition: EditPolicy.cc:41
Request::RequestType
RequestType
Data type for determining the type of a Request.
Definition: Request.hh:46
EditPart::model
TTAMachine::MachinePart * model() const
Request::MODIFY_REQUEST
@ MODIFY_REQUEST
Modfify request.
Definition: Request.hh:48
ProximConstants::MACH_WIN_FU_LABEL
static const std::string MACH_WIN_FU_LABEL
Label precing function unit names in the machine state window.
Definition: ProximConstants.hh:206
Request::STATUS_REQUEST
@ STATUS_REQUEST
Status request.
Definition: Request.hh:52
ProximComponentStatusCmd
Definition: ProximComponentStatusCmd.hh:42