Space Comps
 All Classes Files Functions Variables
Public Member Functions | List of all members
Node Class Reference

The Node class contains a Position for a Particle in the MultiQueue. More...

#include <node.h>

Public Member Functions

 Node (Particle *part, Position *pos)
 Constructs a Node for the given Particle containing the Position. More...
 
NodegetNext ()
 Retruns the next Node in the MultiQueue. More...
 
NodegetNextForParticle ()
 Returns the next Node in the MultiQueue for this Particle. More...
 
NodegetPrevious ()
 Returns the Previous Node in the MultiQueue. More...
 
NodegetPreviousForParticle ()
 Returns the Prevoius Node in the MultiQueue for this Particle. More...
 
void setNext (Node *n)
 Sets this Node's next pointer to the given Node. More...
 
void setNextForParticle (Node *n)
 Sets this Node's pointer to the next Node with the same Particle. More...
 
void setPrevious (Node *n)
 Sets this Node's prevoius pointer to the given Node. More...
 
void setPreviousForParticle (Node *n)
 Sets this Node's pointer to the prevoius Node for this Particle. More...
 
ParticlegetParticle ()
 Returns the Particle associated with the Position in this Node. More...
 
PositiongetPosition ()
 Returns the Position this Node is holding. More...
 

Detailed Description

The Node class contains a Position for a Particle in the MultiQueue.

The Node holds a Position for a Particle, and contains pointers to the previous Node and next Node in the MultiQueue, as well as pointers to the prevoius and next Nodes that are instances of the given Particle.

Constructor & Destructor Documentation

Node::Node ( Particle part,
Position pos 
)

Constructs a Node for the given Particle containing the Position.

This sets the appropriate pointers for the next and previous Nodes in the Queue, and for the next and prevoius Nodes related to the given Particle.

Parameters
partThe Particle this Node and Position relate to.
posThe Position this Node is storing

Member Function Documentation

Node * Node::getNext ( )

Retruns the next Node in the MultiQueue.

Returns
The next Node in the MultiQueue or Null.
Node * Node::getNextForParticle ( )

Returns the next Node in the MultiQueue for this Particle.

Returns
The next Node for this Particle in MultiQueue or Null.
Particle * Node::getParticle ( )

Returns the Particle associated with the Position in this Node.

Returns
The Particle associated with this Node.
Position * Node::getPosition ( )

Returns the Position this Node is holding.

Returns
The Position this Node stores.
Node * Node::getPrevious ( )

Returns the Previous Node in the MultiQueue.

Returns
The previous Node in the MultiQueue or Null.
Node * Node::getPreviousForParticle ( )

Returns the Prevoius Node in the MultiQueue for this Particle.

Returns
The Prevous Node for this Particle in the MultiQueue or Null.
void Node::setNext ( Node n)

Sets this Node's next pointer to the given Node.

Parameters
nthe node we are setting to be next after this Node.
void Node::setNextForParticle ( Node n)

Sets this Node's pointer to the next Node with the same Particle.

Parameters
nthe Node to set to be next after this Node for the Particle.
void Node::setPrevious ( Node n)

Sets this Node's prevoius pointer to the given Node.

Parameters
nthe Node we are setting to be before this Node.
void Node::setPreviousForParticle ( Node n)

Sets this Node's pointer to the prevoius Node for this Particle.

Parameters
nthe Node to set to be before this Node for the Particle.

The documentation for this class was generated from the following files: