Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/QNX4/Train/Railway.hpp

Go to the documentation of this file.
00001 #ifndef __J2K__Train__Railway_HPP__
00002 #define __J2K__Train__Railway_HPP__
00003 
00004 #include <j2k/Fred/Basic.hpp>
00005 #include <j2k/Fred/Boolean.hpp>
00006 #include <j2k/Fred/StdTypes.hpp>
00007 #include <j2k/Fred/QNX/System.hpp>
00008 
00009 #include <j2k/Fred/QNX/Train/Track.hpp>
00010 #include <j2k/Fred/QNX/Train/Train.hpp>
00011 
00012 #define  NTRAINS   3   // * This is the number of trains (do not modify)
00013 
00014 
00015 /*
00016                           . - - - - - .
00017                         /               \
00018             . - - - - -*- - - - - - - - -*- - - - - .
00019           /           [1]               [2]            \
00020         /                                               \
00021       /                                                   \
00022      |                                                     |
00023      |                                                     |
00024      |                                                     |
00025      |                                                     |
00026       \                                                   /
00027         \                                               /
00028           \           [4]               [3]           /
00029             . - - - - -*- - - - - - - - -*- - - - - .
00030                        \               /
00031                          . - - - - - .
00032 
00033 */
00034 
00035 
00036 class Railway
00037 {
00038 private:
00039   Track track;
00040 
00041   // Declare this, so we don't worry about Train ID
00042   Train train[ NTRAINS+1 ];
00043 
00044   void setOneTrainPerTrack();     // * DEBUG CODE!!!  Do not document!
00045   void displaySegmentsOccupied();
00046 
00047 public:
00048   void autoPositionTrains();      // * Get the train position
00049   void switchTrack(int ID, int P);
00050   void showCurrentGeometry();
00051   void setTrainVelocity(int ID, int V);
00052   int  getTrainPosition(int ID);
00053   void initTrains();
00054 
00055   Railway();
00056 };
00057 
00058 #endif

Generated on Sun Oct 14 18:46:42 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001