Model Railroad System  2.2.2
Functions | Variables
TimeTableSystemTcl

Tcl Helper functions. More...

Functions

TimeTableSystem * NewCreateTimeTable (const char *name, int timescale, int timeinterval)
 Tcl constructor to create a new TimeTable. More...
 
TimeTableSystem * OldCreateTimeTable (const char *filename, char **outmessage)
 Tcl constructor to create a time table system from an existing file. More...
 
int ForEveryStation (Tcl_Interp *interp, TimeTableSystem *timetable, Tcl_Obj *variable, Tcl_Obj *body)
 Tcl looping construct for Stations. More...
 
int ForEveryCab (Tcl_Interp *interp, TimeTableSystem *timetable, Tcl_Obj *variable, Tcl_Obj *body)
 Tcl looping construct for Cabs. More...
 
int ForEveryTrain (Tcl_Interp *interp, TimeTableSystem *timetable, Tcl_Obj *variable, Tcl_Obj *body)
 Tcl looping construct for Trains. More...
 
int ForEveryNote (Tcl_Interp *interp, TimeTableSystem *timetable, Tcl_Obj *variable, Tcl_Obj *body)
 Tcl looping construct for notes. More...
 
int ForEveryPrintOption (Tcl_Interp *interp, TimeTableSystem *timetable, Tcl_Obj *variable, Tcl_Obj *body)
 Tcl looping construct for print options. More...
 
int TT_StringListToList (Tcl_Interp *interp, const char *stringList)
 Tcl function to convert a serialized string list to a Tcl list. More...
 
int TT_ListToStringListString (Tcl_Interp *interp, Tcl_Obj *list)
 Tcl function to convert a Tcl list to a serialized string list. More...
 

Variables

apply int Tcl_Result { int TTSupport::ForEveryStation }
 

Detailed Description

Tcl Helper functions.

These are top level Tcl support functions for the TimeTableSystem class. They are only available from Tcl, C++ programs have other API functions, including overloaded constructors and iterator methods.

Author
Robert Heller <heller@deepsoft.com>

Function Documentation

◆ ForEveryCab()

int ForEveryCab ( Tcl_Interp *  interp,
TimeTableSystem *  timetable,
Tcl_Obj *  variable,
Tcl_Obj *  body 
)

Tcl looping construct for Cabs.

Tcl looping construct that loops over the cabs in timetable, setting variable to the Cab pointer and evaluates body.

Parameters
timetableThe time table object.
variableThe loop variable.
bodyThe body script.
Returns
An empty string.

◆ ForEveryNote()

int ForEveryNote ( Tcl_Interp *  interp,
TimeTableSystem *  timetable,
Tcl_Obj *  variable,
Tcl_Obj *  body 
)

Tcl looping construct for notes.

Tcl looping construct that loops over the notes in timetable, setting variable to the note string and evaluates body.

Parameters
timetableThe time table object.
variableThe loop variable.
bodyThe body script.
Returns
An empty string.

◆ ForEveryPrintOption()

int ForEveryPrintOption ( Tcl_Interp *  interp,
TimeTableSystem *  timetable,
Tcl_Obj *  variable,
Tcl_Obj *  body 
)

Tcl looping construct for print options.

Tcl looping construct that loops over the stations in timetable, setting variable to the print option key and evaluates body.

Parameters
timetableThe time table object.
variableThe loop variable.
bodyThe body script.
Returns
An empty string.

◆ ForEveryStation()

int ForEveryStation ( Tcl_Interp *  interp,
TimeTableSystem *  timetable,
Tcl_Obj *  variable,
Tcl_Obj *  body 
)

Tcl looping construct for Stations.

Tcl looping construct that loops over the stations in timetable, setting variable to the Station pointer and evaluates body.

Parameters
timetableThe time table object.
variableThe loop variable.
bodyThe body script.
Returns
An empty string.

◆ ForEveryTrain()

int ForEveryTrain ( Tcl_Interp *  interp,
TimeTableSystem *  timetable,
Tcl_Obj *  variable,
Tcl_Obj *  body 
)

Tcl looping construct for Trains.

Tcl looping construct that loops over the stations in timetable, setting variable to the Train pointer and evaluates body.

Parameters
timetableThe time table object.
variableThe loop variable.
bodyThe body script.
Returns
An empty string.

◆ NewCreateTimeTable()

TimeTableSystem* NewCreateTimeTable ( const char *  name,
int  timescale,
int  timeinterval 
)

Tcl constructor to create a new TimeTable.

Tcl constructor to create a new TimeTable. Calls the new time table constructor.

Parameters
nameThe name of the time table system.
timescaleNumber of time units per 24 hours. There are 1440 minutes in 24 hours.
timeintervalThe tick frequency in time units.
Returns
A TimeTableSystem object.

◆ OldCreateTimeTable()

TimeTableSystem* OldCreateTimeTable ( const char *  filename,
char **  outmessage 
)

Tcl constructor to create a time table system from an existing file.

Tcl constructor to create a time table system from an existing file. The file is read in and the class is properly initialized from the data in the file.

Parameters
filenameThe name of the file to load.
Returns
A TimeTableSystem object.

◆ TT_ListToStringListString()

int TT_ListToStringListString ( Tcl_Interp *  interp,
Tcl_Obj *  list 
)

Tcl function to convert a Tcl list to a serialized string list.

Used to convert Tcl lists to a form that the C++ code can deal with portably.

Parameters
listA Tcl list.
Returns
A serialized string list.

◆ TT_StringListToList()

int TT_StringListToList ( Tcl_Interp *  interp,
const char *  stringList 
)

Tcl function to convert a serialized string list to a Tcl list.

Used to convert serialized C++ string lists to a Tcl list.

Parameters
stringListA serialized string list.
Returns
A Tcl list.

Variable Documentation

◆ Tcl_Result

apply int Tcl_Result { int TTSupport::ForEveryStation }