// $Revision: 1.11 $ // Copyright (C) 1995 Taligent, Inc. All rights reserved. #if 0 --------------------------------------------------------------------------- > Class: | TUniverseActorNote > Taxonomy Category: | ConcurrentGraphics | Universe Subsystem > Interface Category: | Sample. > Inherits From: | TNotification > Inherited By: | None. > Purpose: | This notification indicates that something has changed an actor's relationship with the universe (usually creation or destruction). Typically this notification is sent to objects connected via TAbstractActor::CreateUniverseAffectInterest. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | _Not_ multithread safe. > Resource Use: | TUniverseActorNote objects don't own the actor they specify, so they can't be streamed; FlattenPointer and Resurrect could produce copies of the original items instead of references to them. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseActorNote::Hash ; | virtual long Hash () const > Interface Category: | Sample. > Purpose: | Returns a hash value. > Calling Context: | Called by clients, typically a collection comparator. > Parameters: = Takes no parameters. > Return Value: | A hash value. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseActorNote::GetActor ; | virtual TAbstractActor * GetActor () const > Interface Category: | Sample. > Purpose: | Returns a pointer to the actor of interest. > Calling Context: | Called by TUniverseThread when it has been notified that an actor has been created or destroyed. > Parameters: = Takes no parameters. > Return Value: | A pointer to the actor of interest. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseActorNote::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. Always fails. TUniverseActorNote objects can't be streamed. > Calling Context: | Should never be called. > Parameters: = TStream & inputStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws TAssertionFailedException. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseActorNote::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. Always fails. TUniverseActorNote objects can't be streamed. > Calling Context: | Should never be called. > Parameters: = TStream & outputStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws TAssertionFailedException. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseActorNote::operator =; | TUniverseActorNote & operator =(const TUniverseActorNote & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TUniverseActorNote & note -Note to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseActorNote::~ TUniverseActorNote ; | virtual ~ TUniverseActorNote () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseActorNote::TUniverseActorNote ; | 1. TUniverseActorNote (const TInterest & interest, TAbstractActor * actor) | 2. TUniverseActorNote (TInterest * interestToAdopt, TAbstractActor * actor) | 3. TUniverseActorNote (const TUniverseActorNote & source) | 4. TUniverseActorNote () > Interface Category: | Sample. > Purpose: | 1. Copies interest and keeps a reference to the specified actor. | 2. Adopts interest and keeps a reference to the specified actor. | 3. Copy constructor. | 4. Default constructor. Used only for streaming. > Calling Context: | 1. Called by clients. | 2. Called by clients. | 3. Called to copy an object. | 4. Never called. TUniverseActorNote objects can't be streamed. > Parameters: = 1. const TInterest & interest -Interest to copy. = 1. TAbstractActor * actor -Actor of interest. Returned by GetActor. = 2. TInterest * interestToAdopt -Interest to adopt. = 2. TAbstractActor * actor -Actor of interest. Returned by GetActor. = 3. const TUniverseActorNote & source -Note to copy. = 4. Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseActorNote::IsEqual ; | virtual bool IsEqual (const MCollectible * other) const > Interface Category: | Sample. > Purpose: | Tests semantic equality of this and another object. > Calling Context: | Called by clients. Typically called by collection comparators. > Parameters: = const MCollectible * other -Object to compare this to. > Return Value: | Returns true if this is semantically equal to other. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TAbstractActor > Taxonomy Category: | ConcurrentGraphics | Universe Subsystem > Interface Category: | Sample. > Inherits From: | MMoving, MColliding, MRefreshable > Inherited By: | TExplodingActor > Purpose: | Abstract base class for moving, colliding, renderable objects managed by a TUniverse instance. Actors are multithread safe and contain an internal lock used to regulate data access by multiple threads. Actors also have a life/death mechanism by which an actor can add new actors to the universe and request its own destruction. Instances of TAbstractActor can also be polymorphically streamed. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | TExplodingActor. > Concurrency: | Multithread safe. > Resource Use: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::PreMove ; | virtual void PreMove (const TTime & interval) > Interface Category: | Sample. > Purpose: | MMoving override. This function acquires the internal data lock, protecting its data from other threads. This effectively blocks access by the refresh thread. > Calling Context: | Called by TMoverThread. > Parameters: = const TTime & interval -Amount of time that has elapsed since the last time this object was moved. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | This call should always be followed by a call to PostMove. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::PostMove ; | virtual void PostMove (const TTime & interval) > Interface Category: | Sample. > Purpose: | MMoving override. This function releases the internal data lock allowing other threads access. > Calling Context: | Called by TMoverThread. > Parameters: = const TTime & interval -Amount of time that has elapsed since the last time this object was moved. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | This call should always be preceded by a call to PreMove. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::PreRefresh ; | virtual void PreRefresh (const TTime & interval) > Interface Category: | Sample. > Purpose: | MRefreshable override. This function acquires the internal data lock, protecting its data from other threads. This effectively blocks access by the mover thread. > Calling Context: | Called by TRefreshThread. > Parameters: = const TTime & interval -Amount of time that has elapsed since the last time this object was moved. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::PostRefresh ; | virtual void PostRefresh (const TTime & interval) > Interface Category: | Sample. > Purpose: | MMoving override. This function releases the internal data lock allowing other threads access. > Calling Context: | Called by TRefreshThread. > Parameters: = const TTime & interval -Amount of time that has elapsed since the last time this object was moved. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::CreateUniverseAffectInterest ; | virtual TInterest * CreateUniverseAffectInterest () > Interface Category: | Sample. > Purpose: | Creates an interest for actor creation/destruction notification. A TUniverseActorNote is sent specifying the new/destroyed actor. > Calling Context: | Called by TUniverseThread. > Parameters: = Takes no parameters. > Return Value: | An interest for notification. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | Callers are responsible for deleting the interest. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::Lock ; | virtual void Lock () > Interface Category: | Sample. > Purpose: | Acquires internal data lock to control concurrent access to data. > Calling Context: | Called internally by PreMove and PreRefresh, and called by derived classes. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::Unlock ; | virtual void Unlock () > Interface Category: | Sample. > Purpose: | Releases internal data lock so other threads can access and modify this actor's data. > Calling Context: | Called by PostMove and PostRefresh as well as internally by derived classes when they are done modifying internal data. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::SelfDestruct ; | virtual void SelfDestruct () > Interface Category: | Sample. > Purpose: | Sends a TUniverseActorNote to all clients connected through CreateUniverseAffectInterest and marks actor as destroyed. IsDead will return true when this function returns. > Calling Context: | Called by derived classes. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | SelfDestruct can be called multiple times, but the notification is only sent out once (the first time). This is to ensure that an actor does not get deleted multiple times. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::RegisterOffspring ; | virtual void RegisterOffspring (TAbstractActor * living) > Interface Category: | Sample. > Purpose: | Sends a TUniverseActorNote to all clients connected through CreateUniverseAffectInterest. The specified actor will be inserted into the universe. > Calling Context: | Called by derived classes. > Parameters: = TAbstractActor * living -Actor to insert into the universe. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::CollisionCheckNeeded ; | virtual void CollisionCheckNeeded () > Interface Category: | Sample. > Purpose: | Sets flag so that collision checks are performed and behaviors are activated at the end of the next move phase (when PostMove is called). > Calling Context: | Called by derived classes. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::GetNotifier ; | virtual TNotifier & GetNotifier () const > Interface Category: | Sample. > Purpose: | MColliding override. Returns a reference to the notifier through which all notifications generated by this actor are sent. MColliding override. > Calling Context: | Called by MColliding base class and internally whenever a notification needs to be sent. > Parameters: = Takes no parameters. > Return Value: | A reference to the notifier used to send notifications for this actor. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & inStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & outStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::operator =; | TAbstractActor & operator =(const TAbstractActor & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TAbstractActor & source -Actor to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Data lock must be acquired on source actor before it is copied. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::~ TAbstractActor ; | virtual ~ TAbstractActor () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::TAbstractActor ; | 1. TAbstractActor () | 2. TAbstractActor (const TAbstractActor & source) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Copy constructor. > Calling Context: | 1. Called by the stream-in operators. | 2. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TAbstractActor & source -Actor to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::IsDead ; | virtual bool IsDead () const > Interface Category: | Sample. > Purpose: | Checks to see if an actor has requested that the universe destroy it. There is often a delay between when destruction is requested and when the TUniverseThread actually destroys an actor. This allows actors to _play_ _destroyed_ until they are actually destroyed. > Calling Context: | Called by TExplosionBehavior and internally to see if the actor needs to be moved or rendered. > Parameters: = Takes no parameters. > Return Value: | Returns true if actor has requested its own destruction (through a call to the SelfDestruct function). > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAbstractActor::IsA ; | virtual bool IsA (const TType & type) const > Interface Category: | Sample. > Purpose: | MColliding override. Provides the ability to check the type or inheritance of an object. > Calling Context: | Provided for use by TCollisionBehavior and its derived classes so they can connect to objects of a particular type. > Parameters: = const TType & type -Token equal to the name of the class to check for. > Return Value: | Returns true if object inherits from or is an instance of the specified class. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TActorEntry > Taxonomy Category: | ConcurrentGraphics | Universe Subsystem > Interface Category: | Sample. > Inherits From: | None. > Inherited By: | None. > Purpose: | Provides a simple wrapper to lock a TAbstractActor until execution leaves the scope of this object. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TActorEntry::TActorEntry ; | TActorEntry (TAbstractActor * actor) > Interface Category: | Sample. > Purpose: | When the object is constructed, the pointer passed in is locked. > Calling Context: | Called before trying to use the actor. > Parameters: = TAbstractActor * actor -A pointer to the actor that needs to be locked before use. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TActorEntry::~ TActorEntry ; | virtual ~ TActorEntry () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TUniverseThread > Taxonomy Category: | ConcurrentGraphics | Universe Subsystem > Interface Category: | Sample. > Inherits From: | TBoundThreadProgram > Inherited By: | None. > Purpose: | TUniverseThread handles actor creation and destruction notifications sent by TAbstractActor::RegisterOffspring and TAbstractActor::SelfDestruct. A universe thread has a queue in which it queues notifications for later processing. Notifications are processed in the order received. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | Multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseThread::TUniverseThread ; | TUniverseThread (TUniverse * universe) > Interface Category: | Sample. > Purpose: | Constructs a universe thread to handle the creation and destruction of actors in the specified universe. > Calling Context: | Called by TUniverse. > Parameters: = TUniverse * universe -The universe this thread interacts with. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseThread::Watch ; | virtual void Watch (TAbstractActor * interestToAdopt) > Interface Category: | Sample. > Purpose: | Informs thread that an actor has been added to the universe and it must handle creation/destruction notifications from that actor. > Calling Context: | Called by TUniverse when an actor is added to the universe. > Parameters: = TAbstractActor * interestToAdopt -Actor added to universe. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseThread::Ignore ; | virtual void Ignore (TAbstractActor & interestToAdopt) > Interface Category: | Sample. > Purpose: | Informs universe thread that an actor has been removed from the universe and it no longer needs to accept notifications from the specified actor. > Calling Context: | Called by TUniverse when an actor is removed from the universe. > Parameters: = TAbstractActor & interestToAdopt -Actor removed from universe. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseThread::IgnoreAll ; | virtual void IgnoreAll () > Interface Category: | Sample. > Purpose: | Causes the universe thread to ignore all notifications from actors. > Calling Context: | Called by TUniverse at destruction time. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseThread::BoundRun ; | virtual void BoundRun () > Interface Category: | Sample. > Purpose: | TBoundThreadProgram override. The main function of the thread. This function simply loops, reacting to notifications until terminated. > Calling Context: | Called by base class. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseThread::BoundExit ; | virtual void BoundExit () > Interface Category: | Sample. > Purpose: | TBoundThreadProgram override. This function causes the thread to terminate in an orderly manner. The queue is closed and emptied before termination of the thread. All notifications are processed. > Calling Context: | Called by base class in response to a Terminate call. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseThread::HandleNote ; | virtual void HandleNote (const TNotification & noteIn) > Interface Category: | Sample. > Purpose: | This function queues a notification for processing by the thread. The notification is copied and placed in the queue for later removal and processing by BoundRun. > Calling Context: | Called by the Notification framework in response to creation/destruction notification from actors. > Parameters: = const TNotification & noteIn -Notification to queue. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverseThread::~ TUniverseThread ; | virtual ~ TUniverseThread () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TUniverse > Taxonomy Category: | ConcurrentGraphics | Universe Subsystem > Interface Category: | Sample. > Inherits From: | None. > Inherited By: | None. > Purpose: | This class coordinates movement, refresh, and universe threads. It manipulates a collection of actors that interact through a set of TCollisionBehavior objects. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | Multithread safe. > Resource Use: | The universe only owns its actors when it is running. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::TUniverse ; | TUniverse (TGrafPort * refreshPort, TDequeOf < TAbstractActor > * actorsCollection, TDequeOf < TCollisionBehavior > * behaviorCollection, MRefreshable * background) > Interface Category: | Sample. > Purpose: | Constructor. The caller specifies a collection of actors, behaviors, a background, and a port onto the buffer to update. > Calling Context: | Called by TSimulationLevel. > Parameters: = TGrafPort * refreshPort -Port to render actors in. = TDequeOf < TAbstractActor > * actorsCollection -Actors to animate. = TDequeOf < TCollisionBehavior > * behaviorCollection -Behaviors governing the interactions between actors. = MRefreshable * background -Background rendered behind actors. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::AdoptActor ; | virtual void AdoptActor (TAbstractActor * actor) > Interface Category: | Sample. > Purpose: | Adds an actor to the universe's collection of actors. > Calling Context: | Called by clients and TUniverse thread when actors are created by other actors. > Parameters: = TAbstractActor * actor -Actor to add. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | Movement and refresh are suspended until this call completes. The actor is connected to all behaviors. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::OrphanActor ; | virtual TAbstractActor * OrphanActor (TAbstractActor & actor) > Interface Category: | Sample. > Purpose: | Removes an actor from the universe. The actor will no longer be moved or refreshed. > Calling Context: | Called by clients and TUniverseThread when an actor is destroyed. > Parameters: = TAbstractActor & actor -Actor to remove. > Return Value: | A pointer to the removed actor. If the actor was not in the universe, NIL is returned. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | Movement and refresh are suspended until this call completes. The actor is disconnected from all behaviors. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::Start ; | virtual void Start () > Interface Category: | Sample. > Purpose: | Starts movement and refresh. > Calling Context: | Called by TSimulationLevel when the Simulation presentation is activated. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | The universe owns all actors and behaviors it knows about until destroyed. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::Stop ; | virtual void Stop () > Interface Category: | Sample. > Purpose: | Stops movement and refresh. > Calling Context: | Called by TSimulationLevel when the Simulation presentation is deactivated. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::CreateRefreshInterest ; | virtual TInterest * CreateRefreshInterest () > Interface Category: | Sample. > Purpose: | Creates an interest for notification of buffer refresh. Notifications will be TSimulationRefreshNotification objects. > Calling Context: | Called by TSimulationLevel. > Parameters: = Takes no parameters. > Return Value: | An interest for notification of buffer refresh. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | The caller is responsible for disposing of the interest. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::CreateAdoptInterest ; | virtual TInterest * CreateAdoptInterest () > Interface Category: | Sample. > Purpose: | Creates an interest for notification when actors are added to the universe. Notifications will be TUniverseActorNote objects. > Calling Context: | Called by TSimulationLevel. > Parameters: = Takes no parameters. > Return Value: | An interest for notification when actors are added to the universe. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | Callers are responsible for disposing of the interest. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::CreateOrphanInterest ; | virtual TInterest * CreateOrphanInterest () > Interface Category: | Sample. > Purpose: | Creates an interest for notification of when actors are removed from the universe. Notifications will be TUniverseActorNote objects. > Calling Context: | Called by TSimulationLevel. > Parameters: = Takes no parameters. > Return Value: | An interest for notification of when actors are removed from the universe. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | Callers are responsible for disposing of the interest. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::Resume ; | virtual void Resume () > Interface Category: | Sample. > Purpose: | Resumes universe activity after a call to Pause. > Calling Context: | Called once for each call to Pause. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::Pause ; | virtual void Pause () > Interface Category: | Sample. > Purpose: | Stops all activity in the universe but the universe's internal clock continues to run. > Calling Context: | Called by TSimulationLevel::UseImage to stop refresh so the buffer may be drawn to the screen. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TUniverse::~ TUniverse ; | virtual ~ TUniverse () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif