OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
SocketPortConnCmd Class Reference

#include <SocketPortConnCmd.hh>

Inheritance diagram for SocketPortConnCmd:
Inheritance graph
Collaboration diagram for SocketPortConnCmd:
Collaboration graph

Public Member Functions

 SocketPortConnCmd (TTAMachine::Socket *socket, TTAMachine::Port *port)
 
virtual ~SocketPortConnCmd ()
 
virtual bool Do ()
 
- Public Member Functions inherited from ComponentCommand
 ComponentCommand ()
 
virtual ~ComponentCommand ()
 
wxWindow * parentWindow ()
 
void setParentWindow (wxWindow *window)
 

Private Attributes

TTAMachine::Socketsocket_
 Socket to connect. More...
 
TTAMachine::Portport_
 Port to connect. More...
 

Detailed Description

Command for connecting/disconencting ports to sockets.

Definition at line 46 of file SocketPortConnCmd.hh.

Constructor & Destructor Documentation

◆ SocketPortConnCmd()

SocketPortConnCmd::SocketPortConnCmd ( TTAMachine::Socket socket,
TTAMachine::Port port 
)

The Constructor.

Parameters
portPort to connect/disconnect.
socketSocket to connect/disconnect.

Definition at line 45 of file SocketPortConnCmd.cc.

45  :
47  socket_(socket), port_(port) {
48 }

◆ ~SocketPortConnCmd()

SocketPortConnCmd::~SocketPortConnCmd ( )
virtual

The Destructor.

Definition at line 54 of file SocketPortConnCmd.cc.

54  {
55 }

Member Function Documentation

◆ Do()

bool SocketPortConnCmd::Do ( )
virtual

Executes the command.

Returns
true, if the command was succesfully executed, false otherwise.

Implements ComponentCommand.

Definition at line 64 of file SocketPortConnCmd.cc.

64  {
65 
66  if (port_->isConnectedTo(*socket_)) {
67  try {
69  } catch (Exception& e) {
70  return false;
71  }
72  } else {
73  try {
75  } catch (Exception& e) {
76  return false;
77  }
78  }
79 
80  return true;
81 }

References TTAMachine::Port::attachSocket(), TTAMachine::Port::detachSocket(), TTAMachine::Port::isConnectedTo(), port_, and socket_.

Here is the call graph for this function:

Member Data Documentation

◆ port_

TTAMachine::Port* SocketPortConnCmd::port_
private

Port to connect.

Definition at line 56 of file SocketPortConnCmd.hh.

Referenced by Do().

◆ socket_

TTAMachine::Socket* SocketPortConnCmd::socket_
private

Socket to connect.

Definition at line 54 of file SocketPortConnCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
ComponentCommand::ComponentCommand
ComponentCommand()
Definition: ComponentCommand.cc:38
TTAMachine::Port::attachSocket
virtual void attachSocket(Socket &socket)
Definition: Port.cc:191
TTAMachine::Port::detachSocket
virtual void detachSocket(Socket &socket)
Definition: Port.cc:237
Exception
Definition: Exception.hh:54
TTAMachine::Port::isConnectedTo
virtual bool isConnectedTo(const Socket &socket) const
Definition: Port.cc:393
SocketPortConnCmd::socket_
TTAMachine::Socket * socket_
Socket to connect.
Definition: SocketPortConnCmd.hh:54
SocketPortConnCmd::port_
TTAMachine::Port * port_
Port to connect.
Definition: SocketPortConnCmd.hh:56