Go to the documentation of this file.
110 string procName =
"Socket::setName";
131 const string procName =
"Socket::setDirection";
135 format text = textGenerator.
text(
167 const string procName =
"Socket::attachBus";
192 string errorMsg =
"Direction of the socket cannot be set.";
194 __FILE__, __LINE__, procName, errorMsg);
215 string procName =
"Socket::detachBus";
246 for (
int i = 0; i < segments; i++) {
268 string procName =
"Socket::port";
269 throw OutOfRange(__FILE__, __LINE__, procName);
279 PortTable::iterator iter =
ports_.begin();
280 while (iter !=
ports_.end()) {
282 (*iter)->detachSocket(*
this);
304 ConnectionTable::const_iterator iter =
busses_.begin();
305 while (iter !=
busses_.end()) {
306 if ((*iter)->bus() == &bus) {
313 string errorMsg =
"The requested Connection object does not exist in "
315 string procName =
"Socket::connection";
334 for (
int i = 0; i < segments; i++) {
352 ConnectionTable::const_iterator iter =
busses_.begin();
353 while (iter !=
busses_.end()) {
354 if ((*iter)->bus() == &bus) {
371 result.insert(conn->bus()->parentBus());
384 result.insert(conn->bus()->parentBus());
403 string procName =
"Socket::segment";
404 throw OutOfRange(__FILE__, __LINE__, procName);
480 ConnectionTable::const_iterator iter =
busses_.begin();
481 while (iter !=
busses_.end()) {
503 string procName =
"Socket::loadState";
517 for (
int childIndex = 0; childIndex < state->
childCount();
528 format text = textGenerator.
text(
532 __FILE__, __LINE__, procName, text.str());
540 bus = busNav.
item(busName);
542 format text = textGenerator.
text(
544 text % busName %
name();
546 __FILE__, __LINE__, procName, text.str());
552 format text = textGenerator.
text(
554 text %
name() % segmentName % busName;
556 __FILE__, __LINE__, procName, text.str());
563 __FILE__, __LINE__, procName);
569 __FILE__, __LINE__, procName, exception.
errorMessage());
582 format text = textGenerator.
text(
584 TXT_UNKNOWN_SOCKET_DIR_AND_SEGMENT_CONN);
586 __FILE__, __LINE__, procName, text.str());
595 __FILE__, __LINE__, procName, exception.
errorMessage());
Socket(const std::string &name)
virtual bool canConnect(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment)
void internalUnsetMachine()
virtual void setName(const std::string &name)
PortTable ports_
Contains all connections to ports.
const Connection & connection(const Segment &bus) const
std::set< Bus * > connectedBuses()
void attachSocket(Socket &socket)
Port * port(int index) const
void attachPort(Port &port)
virtual TCEString name() const
std::string stringAttribute(const std::string &name) const
virtual bool isRegistered() const
static const std::string OSVALUE_OUTPUT
ObjectState attribute value for output direction.
@ OUTPUT
Data goes from port to bus.
virtual void ensureRegistration(const Component &component) const
Direction direction_
Direction of the socket.
static void writeToErrorLog(const std::string fileName, const int lineNumber, const std::string functionName, const std::string message, const int neededVerbosity=0)
virtual ObjectState * saveState() const
static std::string socketDirectionSettingError(const TTAMachine::Socket &socket, TTAMachine::Socket::Direction, const MachineTester &tester)
virtual void loadState(const ObjectState *state)
@ TXT_SOCKET_REF_LOAD_ERR
static std::string socketSegmentConnectionError(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment, const MachineTester &tester)
Segment * segment(int index) const
virtual boost::format text(int textId)
Direction direction() const
virtual Segment * segment(int index) const
virtual ObjectState * saveState() const
void setName(const std::string &name)
void internalSetMachine(Machine &machine)
void detachSocket(Socket &socket)
#define assert(condition)
@ TXT_SET_DIR_SOCKET_NOT_REGISTERED
std::string dataPortWidth_
Dataport width.
const std::string & dataPortWidth() const
void detachPort(const Port &port)
void attachBus(Segment &bus)
static const std::string OSVALUE_UNKNOWN
ObjectState attribute value for unknown direction.
MachineTester & machineTester() const
virtual void unsetMachine()
virtual void loadState(const ObjectState *state)
virtual void setMachine(Machine &mach)
ObjectState * child(int index) const
void addChild(ObjectState *child)
virtual void setName(const std::string &name)
bool isConnectedTo(const Socket &socket) const
void removeConnection(const Connection *connection)
@ TXT_SOCKET_REF_LOAD_ERR_SEGMENT
void setDirection(Direction direction)
bool isConnectedTo(const Bus &bus) const
static const std::string OSNAME_SOCKET
ObjectState name for socket.
void detachBus(Segment &bus)
std::string errorMessage() const
static const std::string OSKEY_BUS
ObjectState attribute key for bus name.
static const std::string OSKEY_DIRECTION
ObjectState attribute key for socket direction.
virtual Machine * machine() const
virtual bool canSetDirection(const TTAMachine::Socket &socket, TTAMachine::Socket::Direction direction)
ConnectionTable busses_
Contains all connections to busses.
static const std::string OSKEY_SEGMENT
ObjectState attribute key for segment name.
virtual BusNavigator busNavigator() const
@ UNKNOWN
Unknown direction.
bool hasDataPortWidth() const
virtual void removeSocket(Socket &socket)
@ TXT_SOCKET_REF_LOAD_ERR_BUS
ComponentType * item(int index) const
ObjectState * saveState() const
static const std::string OSVALUE_INPUT
ObjectState attribute value for input direction.
static void abortProgram() __attribute__((noreturn))
virtual void addSocket(Socket &socket)
virtual int segmentCount() const
static const std::string OSNAME_CONNECTION
ObjectState name for Connection.
void setAttribute(const std::string &name, const std::string &value)
void setDataPortWidth(const std::string &width)
@ INPUT
Data goes from bus to port.