This is the abstract class from which route-engine classes must be derived to work with the server. It was developed so that my partner could easily integrate his code with the server.
//-------------Abstract Class Specifies routeEngine capabilities---------------
class routeEngine
{
public:
virtual int restart(int mode) = 0;
// forces engine to reload its files and restart
// returns success, mode is currently undefined
virtual int getRoute( unsigned char* route, int length ) = 0;
// finds a route through the network
// (*route) contains the request definition in its first (length) bytes
// the returned route is found in the first (return int) bytes of route
// after execution.
// sizeof(route) is always 256
virtual int setNetwork( unsigned char* network, int length ) = 0;
// tells the engine the network definition
// the definition is contained in the first (length) bytes
// of (*network)
// returns success
virtual int getNetwork( unsigned char* network, int length ) = 0;
// stores the network defnition in the first (return int) bytes
// of (*network)
// (length) is the maximum number of bytes to store in (*network)
// this is usually sizeof(network)
virtual int setWeight( unsigned char start, unsigned char end, unsigned
char line, unsigned char weight ) = 0;
// tells the engine the network weighting (weight) between (start)
// and (end) nodes on line (line). If (start) is 1, then (weight) holds
// the line change penalty.
// returns success
virtual unsigned char getWeight( unsigned char start, unsigned char
end, unsigned char line ) = 0;
// returns the weight between (start) and (end) on (line)
// if (start) is 1 then returns the line change penalty.
};