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

#include <ProximBusEditPolicy.hh>

Inheritance diagram for ProximBusEditPolicy:
Inheritance graph
Collaboration diagram for ProximBusEditPolicy:
Collaboration graph

Public Member Functions

 ProximBusEditPolicy ()
 
virtual ~ProximBusEditPolicy ()
 
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 state window buses.

Definition at line 41 of file ProximBusEditPolicy.hh.

Constructor & Destructor Documentation

◆ ProximBusEditPolicy()

ProximBusEditPolicy::ProximBusEditPolicy ( )

The Constructor.

Definition at line 47 of file ProximBusEditPolicy.cc.

47  :
48  EditPolicy() {
49 }

◆ ~ProximBusEditPolicy()

ProximBusEditPolicy::~ProximBusEditPolicy ( )
virtual

The Destructor.

Definition at line 55 of file ProximBusEditPolicy.cc.

55  {
56 }

Member Function Documentation

◆ canHandle()

bool ProximBusEditPolicy::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 ProximBusEditPolicy.cc.

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

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

Here is the call graph for this function:

◆ getCommand()

ComponentCommand * ProximBusEditPolicy::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 84 of file ProximBusEditPolicy.cc.

84  {
85 
86  Request::RequestType type = request->type();
87 
88  const Bus* bus = dynamic_cast<const Bus*>(host_->model());
89  if (bus == NULL) {
90  const Segment* segment = dynamic_cast<const Segment*>(host_->model());
91  assert(segment != NULL);
92  bus = segment->parentBus();
93  }
94 
95  assert(bus != NULL);
96 
97  if (type == Request::STATUS_REQUEST) {
98  std::string status = ProximConstants::MACH_WIN_BUS_LABEL + bus->name();
99  return new ProximComponentStatusCmd(status);
100  } else if (type == Request::DETAILS_REQUEST) {
101  return new ProximBusDetailsCmd(*bus);
102  }
103  return NULL;
104 }

References assert, Request::DETAILS_REQUEST, EditPolicy::host_, ProximConstants::MACH_WIN_BUS_LABEL, EditPart::model(), TTAMachine::Component::name(), TTAMachine::Segment::parentBus(), 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
TTAMachine::Segment
Definition: Segment.hh:54
TTAMachine::Bus
Definition: Bus.hh:53
assert
#define assert(condition)
Definition: Application.hh:86
ProximConstants::MACH_WIN_BUS_LABEL
static const std::string MACH_WIN_BUS_LABEL
Label precing bus names in the machine state window.
Definition: ProximConstants.hh:216
Request::DETAILS_REQUEST
@ DETAILS_REQUEST
Detailed info request.
Definition: Request.hh:53
TTAMachine::Segment::parentBus
Bus * parentBus() const
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::STATUS_REQUEST
@ STATUS_REQUEST
Status request.
Definition: Request.hh:52
ProximComponentStatusCmd
Definition: ProximComponentStatusCmd.hh:42
ProximBusDetailsCmd
Definition: ProximBusDetailsCmd.hh:46