far()
member of the XXXToUniversal points to the XXXPortHole; the ghostAsPort()
member points to the YYYFromUniversal object. Similarly, for the YYYFromUniveral object, far()
points to the YYYPortHole and ghostAsPort()
points to the XXXToUniversal object. These pairs of EventHorizons are created by the buildEventHorizons
member function of class Wormhole.
EventHorizon(PortHole* self);The constructor for EventHorizon takes one argument, representing (for derived classes that call this constructor from their own), "myself" as a PortHole (a pointer to the PortHole part of the object). The destructor is declared virtual and does nothing.
PortHole* asPort();This returns "myself as a PortHole".
PortHole* ghostAsPort();This returns a pointer to the "matching event horizon" as a porthole.
virtual void ghostConnect(EventHorizon& to );This connects another EventHorizon to myself and makes it my "ghost port".
virtual int isItInput() const;Say if I am an input or an output.
virtual int isItOutput() const;
virtual int onlyOne() const;Derived EventHorizon classes should redefine this method to return
TRUE
for domains in which only one particle may cross the event horizon boundary per execution. The default implementation returns FALSE
.
virtual void setEventHorizon(inOutType inOut, const char* portName,Sets parameters for the EventHorizon.
Wormhole* parentWormhole, Star* parentStar,
DataType type = FLOAT, unsigned numTokens = 1 );
double getTimeMark();Get and set the time mark. The time mark is an internal detail used for bookkeeping by schedulers.
void setTimeMark(double d);
virtual void initialize();These methods return a pointer to the scheduler that lives inside the wormhole, or outside the wormhole, respectively.
Scheduler *innerSched();
Scheduler *outerSched();
void moveFromGhost(EventHorizon& from, int numParticles);Move
numParticles
from the buffer of from,
another EventHorizon, to mine (the object on which this function is called). This is used to implement ToEventHorizon::transferData.
CircularBuffer* buffer();Access the myBuffer of the porthole.
EventHorizon* ghostPort;This is the peer event horizon.
Wormhole* wormhole;This points to the Wormhole I am a member of.
int tokenNew;TimeMark of the current data, which is necessary for interface of two domains. This may become a private member in future versions of Ptolemy.
double timeMark;