OpenASIP  2.0
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. More...
 

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 ||
68  type == Request::DETAILS_REQUEST) {
69  return true;
70  }
71 
72  return false;
73 }

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 }

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:
Request::type
RequestType type() const
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
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
TTAMachine::Socket
Definition: Socket.hh:53
Request::RequestType
RequestType
Data type for determining the type of a Request.
Definition: Request.hh:46
ProximConstants::MACH_WIN_SOCKET_LABEL
static const std::string MACH_WIN_SOCKET_LABEL
Label precing socket names in the machine state window.
Definition: ProximConstants.hh:212
EditPart::model
TTAMachine::MachinePart * model() const
Request::STATUS_REQUEST
@ STATUS_REQUEST
Status request.
Definition: Request.hh:52
ProximComponentStatusCmd
Definition: ProximComponentStatusCmd.hh:42
ProximSocketDetailsCmd
Definition: ProximSocketDetailsCmd.hh:46