Top Up Prev Next Bottom Contents Index Search

10.3 Class Domain


The Domain class represents the information that Ptolemy needs to know about a particular domain so that it can create galaxies, wormholes, nodes, event horizons, and such for that domain. For each domain, the designer creates a derived class of Domain and one prototype object. Thus the Domain class has two main parts: a static interface, which manages access to the list of Domain objects, and a set of virtual functions, which provides the standard interface for each domain to describe its requirements.

10.3.1 Domain virtual functions

virtual Star& newWorm (Galaxy& innerGal, Target* innerTarget = 0); 
This function creates a new wormhole with the given inner galaxy and inner target. The default implementation returns an error. XXXDomain might override this as follows:

Star& XXXDomain::newWorm(Galaxy& innerGal,Target* innerTarget)  { 
LOG\_NEW; return *new XXXWormhole(innerGal,innerTarget);
}
virtual EventHorizon& newFrom(); 
virtual EventHorizon& newTo();
These functions create event horizon objects to represent the XXXfromUniversal and XXXtoUniversal functions. The default implementations return an error. XXXDomain might override these as

EventHorizon& XXXDomain::newFrom() { 
LOG_NEW; return *new XXXfromUniversal;
}
EventHorizon& XXXDomain::newTo() {
LOG_NEW; return *new XXXtoUniversal;
}
virtual Geodesic& newGeo(int multi=FALSE); 
This function creates a new geodesic for point-to-point connection or a "node" suitable for multi-point connections.

virtual int isGalWorm(); 
This function returns FALSE by default. If overridden by a function that returns TRUE, a wormhole will be created around every galaxy for this domain.

virtual const char* requiredTarget(); 
If non-null, this method returns requirement for targets for use with this domain.



Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.