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

#include <ProximRFEditPolicy.hh>

Inheritance diagram for ProximRFEditPolicy:
Inheritance graph
Collaboration diagram for ProximRFEditPolicy:
Collaboration graph

Public Member Functions

 ProximRFEditPolicy ()
 
virtual ~ProximRFEditPolicy ()
 
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 register files in the Proxim machine state window.

Definition at line 41 of file ProximRFEditPolicy.hh.

Constructor & Destructor Documentation

◆ ProximRFEditPolicy()

ProximRFEditPolicy::ProximRFEditPolicy ( )

The Constructor.

Definition at line 50 of file ProximRFEditPolicy.cc.

50  :
51  EditPolicy() {
52 }

◆ ~ProximRFEditPolicy()

ProximRFEditPolicy::~ProximRFEditPolicy ( )
virtual

The Destructor.

Definition at line 57 of file ProximRFEditPolicy.cc.

57  {
58 }

Member Function Documentation

◆ canHandle()

bool ProximRFEditPolicy::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 67 of file ProximRFEditPolicy.cc.

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

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

Here is the call graph for this function:

◆ getCommand()

ComponentCommand * ProximRFEditPolicy::getCommand ( Request request)
virtual

Creates command corresponding to a request.

@paran request Request to handle.

Returns
Null, if the request can't be handled.

Implements EditPolicy.

Definition at line 88 of file ProximRFEditPolicy.cc.

88  {
89 
90  Request::RequestType type = request->type();
91  if (type == Request::MODIFY_REQUEST) {
92  return new ProximShowRegistersCmd(host_);
93  } else if (type == Request::STATUS_REQUEST) {
94 
95  const RegisterFile* rf = dynamic_cast<const RegisterFile*>(
96  host_->model());
97 
98  assert(rf != NULL);
99  string status = ProximConstants::MACH_WIN_RF_LABEL + rf->name();
100  return new ProximComponentStatusCmd(status);
101 
102  } else if (type == Request::DETAILS_REQUEST) {
103 
104  const RegisterFile* rf = dynamic_cast<const RegisterFile*>(
105  host_->model());
106 
107  assert(rf != NULL);
108  return new ProximRFDetailsCmd(*rf);
109  }
110  return NULL;
111 }

References assert, Request::DETAILS_REQUEST, EditPolicy::host_, ProximConstants::MACH_WIN_RF_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
assert
#define assert(condition)
Definition: Application.hh:86
ProximShowRegistersCmd
Definition: ProximShowRegistersCmd.hh:45
Request::DETAILS_REQUEST
@ DETAILS_REQUEST
Detailed info request.
Definition: Request.hh:53
ProximConstants::MACH_WIN_RF_LABEL
static const std::string MACH_WIN_RF_LABEL
Label precing register file names in the machine state window.
Definition: ProximConstants.hh:214
EditPolicy::host_
EditPart * host_
Host EditPart of this EditPolicy.
Definition: EditPolicy.hh:74
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
Request::STATUS_REQUEST
@ STATUS_REQUEST
Status request.
Definition: Request.hh:52
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
ProximComponentStatusCmd
Definition: ProximComponentStatusCmd.hh:42
ProximRFDetailsCmd
Definition: ProximRFDetailsCmd.hh:46