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

#include <ProximIUEditPolicy.hh>

Inheritance diagram for ProximIUEditPolicy:
Inheritance graph
Collaboration diagram for ProximIUEditPolicy:
Collaboration graph

Public Member Functions

 ProximIUEditPolicy ()
 
virtual ~ProximIUEditPolicy ()
 
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 immediate units in the Proxim machine state window.

Definition at line 41 of file ProximIUEditPolicy.hh.

Constructor & Destructor Documentation

◆ ProximIUEditPolicy()

ProximIUEditPolicy::ProximIUEditPolicy ( )

The Constructor.

Definition at line 49 of file ProximIUEditPolicy.cc.

49  :
50  EditPolicy() {
51 }

◆ ~ProximIUEditPolicy()

ProximIUEditPolicy::~ProximIUEditPolicy ( )
virtual

The Destructor.

Definition at line 56 of file ProximIUEditPolicy.cc.

56  {
57 }

Member Function Documentation

◆ canHandle()

bool ProximIUEditPolicy::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 66 of file ProximIUEditPolicy.cc.

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

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

Here is the call graph for this function:

◆ getCommand()

ComponentCommand * ProximIUEditPolicy::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 86 of file ProximIUEditPolicy.cc.

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

References assert, Request::DETAILS_REQUEST, EditPolicy::host_, ProximConstants::MACH_WIN_IU_LABEL, EditPart::model(), 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
ProximIUDetailsCmd
Definition: ProximIUDetailsCmd.hh:46
assert
#define assert(condition)
Definition: Application.hh:86
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
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
ProximConstants::MACH_WIN_IU_LABEL
static const std::string MACH_WIN_IU_LABEL
Label precing immediate unit names in the machine state window.
Definition: ProximConstants.hh:218
Request::STATUS_REQUEST
@ STATUS_REQUEST
Status request.
Definition: Request.hh:52
ProximComponentStatusCmd
Definition: ProximComponentStatusCmd.hh:42
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50