OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ProximSocketEditPolicy Class Reference

#include <ProximSocketEditPolicy.hh>

Inheritance diagram for ProximSocketEditPolicy:
Inheritance graph
Collaboration diagram for ProximSocketEditPolicy:
Collaboration graph

Public Member Functions

 ProximSocketEditPolicy ()
 
virtual ~ProximSocketEditPolicy ()
 
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 sockets.

Definition at line 41 of file ProximSocketEditPolicy.hh.

Constructor & Destructor Documentation

◆ ProximSocketEditPolicy()

ProximSocketEditPolicy::ProximSocketEditPolicy ( )

The Constructor.

Definition at line 46 of file ProximSocketEditPolicy.cc.

46 :
47 EditPolicy() {
48}

◆ ~ProximSocketEditPolicy()

ProximSocketEditPolicy::~ProximSocketEditPolicy ( )
virtual

The Destructor.

Definition at line 54 of file ProximSocketEditPolicy.cc.

54 {
55}

Member Function Documentation

◆ canHandle()

bool ProximSocketEditPolicy::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 64 of file ProximSocketEditPolicy.cc.

64 {
65
66 Request::RequestType type = request->type();
67 if (type == Request::STATUS_REQUEST ||
69 return true;
70 }
71
72 return false;
73}
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 * ProximSocketEditPolicy::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 83 of file ProximSocketEditPolicy.cc.

83 {
84
85 Request::RequestType type = request->type();
86
87 const Socket* socket = dynamic_cast<Socket*>(host_->model());
88 assert(socket != NULL);
89
90 if (type == Request::STATUS_REQUEST) {
91 std::string status = ProximConstants::MACH_WIN_SOCKET_LABEL +
92 socket->name();
93 return new ProximComponentStatusCmd(status);
94 } else if (type == Request::DETAILS_REQUEST) {
95 return new ProximSocketDetailsCmd(*socket);
96 }
97 return NULL;
98}
#define assert(condition)
TTAMachine::MachinePart * model() const
EditPart * host_
Host EditPart of this EditPolicy.
Definition EditPolicy.hh:74
static const std::string MACH_WIN_SOCKET_LABEL
Label precing socket names in the machine state window.
virtual TCEString name() const

References assert, Request::DETAILS_REQUEST, EditPolicy::host_, ProximConstants::MACH_WIN_SOCKET_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: