|
STK++ 1.0
|
Interface Base class for Steps. More...
#include <STK_IStep.h>


Public Member Functions | |
| IStep (String const &name, Real const &x, Real const &y) | |
| constructor | |
| virtual | ~IStep () |
| destructor. | |
| String const & | name () const |
| get the name of this IStep | |
| Real const & | getXLocation () const |
| get the X location of the IStep | |
| Real const & | getYLocation () const |
| get the Y location of the IStep | |
| std::list< Connection * > & | getIncomingConnections () |
| get the list of the incoming connections | |
| std::list< Connection * > & | getOutgoingConnections () |
| get the list of the outgoing connections | |
| void | removeConnection (Connection *connection) |
| remove a connection to this Step. | |
| void | addConnection (Connection *connection) |
| Add a connection to this Step. | |
| virtual bool | isPropertySet (String const &id) const |
Implementation of the pure virtual method isPropertySet defined in IPropertySource | |
| virtual const String * | getPropertyValue (String const &id) const |
Implementation of the pure virtual method getPropertyValue defined in IPropertySource | |
Protected Attributes | |
| String | name_ |
| Name of this step. | |
| Real | xLocation_ |
| X Location of this Step. | |
| Real | yLocation_ |
| Y Location of this Step. | |
| std::list< Connection * > | incomingConnections_ |
| List of the incoming connections. | |
| std::list< Connection * > | outgoingConnections_ |
| List of the outgoing connections. | |
Static Private Attributes | |
| static const String | ID_STEP_SOURCE_CONNECTIONS = "Step.SourceConnection" |
| Property ID to use when the list of outgoing connections is modified. | |
| static const String | ID_STEP_TARGET_CONNECTIONS = "Step.TargetConnection" |
| Property ID to use when the list of incoming connections is modified. | |
| static const String | ID_STEP_XLOCATION = "Step.xLocation" |
| Property ID for the X location property value. | |
| static const String | ID_STEP_YLOCATION = "Step.yLocation" |
| Property ID for the Y location property value. | |
| static const PropertyDescriptor | sourceConnectionsDescriptor_ |
| Descriptor of the source connections property. | |
| static const PropertyDescriptor | targetConnectionsDescriptor_ |
| Descriptor of the target connections property. | |
| static const PropertyDescriptor | heightDescriptor_ |
| Descriptor of the height property. | |
| static const PropertyDescriptor | widthDescriptor_ |
| Descriptor of the width property. | |
| static const PropertyDescriptor | xLocationDescriptor_ |
| Descriptor of the x location property. | |
| static const PropertyDescriptor | yLocationDescriptor_ |
| Descriptor of the y location property. | |
Interface Base class for Steps.
A Step is an executable process in a whole Program. It is represented as a graphical box with a given (height, width) and a X location and Y location in the canvas.
Each step manage a set of incoming and outgoing connections to other steps. These connections are added and removed locally. If a step is a the source of a Connection and this connection is removed, he is responsible to the destruction of the Connection. It is also responsible to signal to the target of the connection that the Connection has been released.
Definition at line 80 of file STK_IStep.h.
constructor
Definition at line 71 of file STK_IStep.cpp.
: name_(name) , xLocation_(x) , yLocation_(y) , incomingConnections_() , outgoingConnections_() { ;}
| STK::IStep::~IStep | ( | ) | [virtual] |
destructor.
Definition at line 80 of file STK_IStep.cpp.
References incomingConnections_, and outgoingConnections_.
{
std::list<Connection*>::iterator it;
// remove outgoing connections
for (it=outgoingConnections_.begin(); it!=outgoingConnections_.end(); it++)
{
delete *it;
}
outgoingConnections_.clear();
// incoming connections will be released by the sources
incomingConnections_.clear();
}
| String const& STK::IStep::name | ( | ) | const [inline] |
get the name of this IStep
Definition at line 140 of file STK_IStep.h.
References name_.
Referenced by STK::Connection::getPropertyValue().
{ return name_;}
| Real const& STK::IStep::getXLocation | ( | ) | const [inline] |
get the X location of the IStep
Definition at line 147 of file STK_IStep.h.
References xLocation_.
{ return xLocation_;}
| Real const& STK::IStep::getYLocation | ( | ) | const [inline] |
get the Y location of the IStep
Definition at line 154 of file STK_IStep.h.
References yLocation_.
{ return yLocation_;}
| std::list<Connection*>& STK::IStep::getIncomingConnections | ( | ) | [inline] |
get the list of the incoming connections
Definition at line 161 of file STK_IStep.h.
References incomingConnections_.
Referenced by STK::GProgram::removeStep().
{ return incomingConnections_;}
| std::list<Connection*>& STK::IStep::getOutgoingConnections | ( | ) | [inline] |
get the list of the outgoing connections
Definition at line 168 of file STK_IStep.h.
References outgoingConnections_.
{ return outgoingConnections_;}
| void STK::IStep::removeConnection | ( | Connection * | connection | ) |
remove a connection to this Step.
| connection | The connection to remove |
Definition at line 99 of file STK_IStep.cpp.
References STK::Connection::getSource(), STK::Connection::getTarget(), incomingConnections_, and outgoingConnections_.
Referenced by STK::Connection::disconnect(), and STK::GProgram::removeStep().
{
// check if it is an outgoing connection
if (connection->getSource() == this)
{
// remove Connection from the outgoing list of connection
outgoingConnections_.remove(connection);
// release memory
delete connection;
connection = (Connection*)NULL;
return;
}
// check if it is an incoming connection
if (connection->getTarget() == this)
{
incomingConnections_.remove(connection);
}
return;
}

| void STK::IStep::addConnection | ( | Connection * | connection | ) |
Add a connection to this Step.
| connection | The connection to add |
Definition at line 123 of file STK_IStep.cpp.
References STK::Connection::getSource(), STK::Connection::getTarget(), incomingConnections_, and outgoingConnections_.
Referenced by STK::GProgram::addConnection(), and STK::Connection::reconnect().
{
std::list<Connection*>::iterator it;
// check if it is an outgoing connection
if (connection->getSource() == this)
{
// check if the connection is already present
for (it=outgoingConnections_.begin(); it!=outgoingConnections_.end(); it++)
{
if (*it == connection) return;
}
// add connection
outgoingConnections_.push_back(connection);
return;
}
// check if it is an incoming connection
if (connection->getTarget() == this)
{
// check if the connection is already present
for (it=incomingConnections_.begin(); it!=incomingConnections_.end(); it++)
{
if (*it == connection) return;
}
incomingConnections_.push_back(connection);
}
}

| bool STK::IStep::isPropertySet | ( | String const & | id | ) | const [virtual] |
Implementation of the pure virtual method isPropertySet defined in IPropertySource
| id | the id of the property |
true if id is a valid IStep id property. Implements STK::IPropertySource.
Definition at line 156 of file STK_IStep.cpp.
References ID_STEP_SOURCE_CONNECTIONS, ID_STEP_TARGET_CONNECTIONS, ID_STEP_XLOCATION, and ID_STEP_YLOCATION.
{
if ( (id==ID_STEP_SOURCE_CONNECTIONS)
||(id==ID_STEP_TARGET_CONNECTIONS)
||(id==ID_STEP_XLOCATION)
||(id==ID_STEP_YLOCATION)
)
{ return true;}
return false;
}
Implementation of the pure virtual method getPropertyValue defined in IPropertySource
| id | the id of the property |
NA Implements STK::IPropertySource.
Definition at line 175 of file STK_IStep.cpp.
{
return NULL;
}
const String STK::IStep::ID_STEP_SOURCE_CONNECTIONS = "Step.SourceConnection" [static, private] |
Property ID to use when the list of outgoing connections is modified.
Definition at line 84 of file STK_IStep.h.
Referenced by isPropertySet().
const String STK::IStep::ID_STEP_TARGET_CONNECTIONS = "Step.TargetConnection" [static, private] |
Property ID to use when the list of incoming connections is modified.
Definition at line 87 of file STK_IStep.h.
Referenced by isPropertySet().
const String STK::IStep::ID_STEP_XLOCATION = "Step.xLocation" [static, private] |
Property ID for the X location property value.
Definition at line 90 of file STK_IStep.h.
Referenced by isPropertySet().
const String STK::IStep::ID_STEP_YLOCATION = "Step.yLocation" [static, private] |
Property ID for the Y location property value.
Definition at line 93 of file STK_IStep.h.
Referenced by isPropertySet().
const PropertyDescriptor STK::IStep::sourceConnectionsDescriptor_ [static, private] |
Descriptor of the source connections property.
Definition at line 96 of file STK_IStep.h.
const PropertyDescriptor STK::IStep::targetConnectionsDescriptor_ [static, private] |
Descriptor of the target connections property.
Definition at line 99 of file STK_IStep.h.
const PropertyDescriptor STK::IStep::heightDescriptor_ [static, private] |
Descriptor of the height property.
Definition at line 102 of file STK_IStep.h.
const PropertyDescriptor STK::IStep::widthDescriptor_ [static, private] |
Descriptor of the width property.
Definition at line 105 of file STK_IStep.h.
const PropertyDescriptor STK::IStep::xLocationDescriptor_ [static, private] |
Descriptor of the x location property.
Definition at line 108 of file STK_IStep.h.
const PropertyDescriptor STK::IStep::yLocationDescriptor_ [static, private] |
Descriptor of the y location property.
Definition at line 111 of file STK_IStep.h.
String STK::IStep::name_ [protected] |
Real STK::IStep::xLocation_ [protected] |
Real STK::IStep::yLocation_ [protected] |
std::list<Connection*> STK::IStep::incomingConnections_ [protected] |
List of the incoming connections.
Definition at line 124 of file STK_IStep.h.
Referenced by addConnection(), getIncomingConnections(), removeConnection(), and ~IStep().
std::list<Connection*> STK::IStep::outgoingConnections_ [protected] |
List of the outgoing connections.
Definition at line 127 of file STK_IStep.h.
Referenced by addConnection(), getOutgoingConnections(), removeConnection(), and ~IStep().