OpenASIP 2.2
Loading...
Searching...
No Matches
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.
 

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 ||
70 return true;
71 }
72
73 return false;
74}
RequestType
Data type for determining the type of a Request.
Definition Request.hh:46
@ DETAILS_REQUEST
Detailed info request.
Definition Request.hh:53
@ STATUS_REQUEST
Status request.
Definition Request.hh:52
RequestType type() const

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}
#define assert(condition)
TTAMachine::MachinePart * model() const
EditPart * host_
Host EditPart of this EditPolicy.
Definition EditPolicy.hh:74
static const std::string MACH_WIN_BUS_LABEL
Label precing bus names in the machine state window.
virtual TCEString name() const
Bus * parentBus() const

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: