Go to the documentation of this file.
35 #include <boost/format.hpp>
74 destinationSegment_(NULL) {
76 const string procName =
"Segment::Segment";
109 sourceSegment_(NULL),
110 destinationSegment_(NULL) {
153 const string procName =
"Segment::setName";
193 string procName =
"Segment::attachSocket";
195 __FILE__, __LINE__, procName, errorMsg);
212 string procName =
"Segment::detachSocket";
232 Socket* socket = (*iter)->socket();
252 ConnectionTable::const_iterator iter =
connections_.begin();
254 if ((*iter)->socket() == &socket) {
276 ConnectionTable::const_iterator iter =
connections_.begin();
278 if ((*iter)->socket() == &socket) {
302 string procName =
"Segment::connection";
303 throw OutOfRange(__FILE__, __LINE__, procName);
322 string procName =
"Segment::moveBefore";
359 string procName =
"Segment::moveAfter";
449 string procName =
"Segment::loadState";
470 const string procName =
"Segment::loadStateWithoutReferences";
482 this->name() !=
name) {
488 __FILE__, __LINE__, procName, exception.
errorMessage());
virtual bool canConnect(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment)
const Connection & connection(const Segment &bus) const
void setName(const std::string &name)
Segment * destinationSegment_
Destination segment.
void attachSocket(Socket &socket)
std::string stringAttribute(const std::string &name) const
virtual void ensureRegistration(const Component &component) const
static const std::string OSKEY_NAME
ObjectState attribute key for segment name.
static std::string socketSegmentConnectionError(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment, const MachineTester &tester)
ConnectionTable connections_
Contains all the connections to sockets.
virtual Segment * segment(int index) const
void moveAfter(Segment &segment)
virtual void loadState(const ObjectState *state)
static const std::string OSNAME_SEGMENT
ObjectState name for Segment.
void detachSocket(Socket &socket)
virtual void addSegment(Segment &segment)
#define assert(condition)
int connectionCount() const
void attachBus(Segment &bus)
MachineTester & machineTester() const
bool isConnectedTo(const Socket &socket) const
static bool isValidComponentName(const std::string &name)
virtual bool hasSegment(const std::string &name) const
Segment * sourceSegment_
Source segment.
const Connection & connection(const Socket &socket) const
bool isConnectedTo(const Bus &bus) const
bool hasSourceSegment() const
virtual ObjectState * saveState() const
void detachBus(Segment &bus)
std::string errorMessage() const
bool hasDestinationSegment() const
virtual void removeSegment(Segment &segment)
virtual Machine * machine() const
void moveBefore(Segment &segment)
Bus * parent_
The parent bus.
std::string name_
Name of the segment.
static const std::string OSKEY_DESTINATION
ObjectState attribute key for destination segment name.
Segment(const std::string &name, Bus &parent)
void removeConnection(const Connection *connection)
virtual int segmentCount() const
void loadStateWithoutReferences(const ObjectState *state)
void setAttribute(const std::string &name, const std::string &value)