Main Page   Class Hierarchy   Compound List   File List   Compound Members  

SmartSockets::Utilities Class Reference

#include <tutil.h>

List of all members.

Static Public Methods

void parseCommandFile (const char *file) throw (UtilitiesException)
void parseCommandString (const char *command_string) throw ()
void parseTypedCommandString (const char *command_string) throw ()
const char * getSocketDir () throw ()
const char * getVersionName () throw ()
int4 getVersionNumber () throw ()
void initThreads () throw (UtilitiesException)
bool isThreadEnabled () throw ()
void out (const char *format_str,...) throw ()


Detailed Description

A non-instantiable class with static methods for various SmartSockets utility options


Member Function Documentation

const char* SmartSockets::Utilities::getSocketDir   throw () [static]
 

Returns the directory name where all SmartSockets local sockets are located. For Windows systems, this does not apply. On UNIX, this is usually the directory /tmp/rtworks. On OpenVMS, this is usually the directory RTSOCKETS: [SOCKETS.node] where node is the node name of the computer. TutGetSocketDir also uses mkdir to create the directory if it does not already exist. When running SmartSockets, it is often necessary to create files (such as UNIX domain sockets) that are world-readable and world-writable. To avoid forcing users to create world-writable directories under their own home directory, getSocketDir() is used instead.

Warning:
The string returned by this method points to read-only storage and should not be modified.
Returns:
the socket directory SmartSockets uses.

const char* SmartSockets::Utilities::getVersionName   throw () [static]
 

Retrieves the current version number of SmartSockets as a string of the form Version a.bc mm/dd/yy status, where a is the major release number, b is the minor release number, c is an optional maintenance release number, mm/dd/yy is an optional date, and status is an optional status string.

Warning:
The string returned by this method points to read-only storage and should not be modified.
Returns:
SmartSockets version name.

int4 SmartSockets::Utilities::getVersionNumber   throw () [static]
 

Returns an integer that represents the software version number. SmartSockets Version X.Y would have a version number of XY0 . For example, version 3.0 corresponds to version number 300.

Returns:
SmartSockets version number.

void SmartSockets::Utilities::initThreads   throw (UtilitiesException) [static]
 

Initializes the thread API and turns on internal thread synchronization calls within the utility and IPC libraries. Programs that call SmartSockets API functions from more than one thread must first call this function, even if they do not use any of the other thread API functions. This protects the integrity of the library's internal data structures.

Single-threaded programs do not need to call initThreads, and indeed should avoid doing so for optimum performance. The added overhead of internal thread synchronization calls is not needed for single-threaded programs.

Exceptions:
UtilitiesException  if the operating system does not support threads

bool SmartSockets::Utilities::isThreadEnabled   throw () [inline, static]
 

Determines whether or not initThreads has been called.

void SmartSockets::Utilities::out const char *    format_str,
...   
throw () [static]
 

This method can be used to print information to the user Simillar to the printf and TutOut in SmartSockets.

void SmartSockets::Utilities::parseCommandFile const char *    file throw (UtilitiesException) [static]
 

Submits a file to the process' command interface for execution. Each line of the file is executed with parseCommandString().

Parameters:
file  is the command file to be parsed. This method does not search for file_name in any directories such as the SmartSockets standard directory, but simply uses file_name verbatim.
Warning:
This method reads the file one line at a time using the fgets C function. Multi-line comments, multi-line commands, and commands longer than 4,094 characters are not allowed.
Exceptions:
UtilitiesException  if an error occurs reading the file.

void SmartSockets::Utilities::parseCommandString const char *    command_string throw () [static]
 

Submits a string to the command interface for execution. If there is a syntax error in command_string, a message is displayed on standard out. If the command is successfully executed, and the Command_Feedback option is set to always , command feedback is displayed on the output window. If Command_Feedback is set to never, or interactive, no feedback is generated.

Parameters:
command_string  is the command string to be parsed.

void SmartSockets::Utilities::parseTypedCommandString const char *    command_string throw () [static]
 

Submits a string to the command interface for execution. This method behaves exactly like parseCommandString(), except for the feedback of successful commands. Unlike parseCommandString() -- which will not write any feedback to standard out if the 'Command_feedback' option is set to 'interactive' -- this method will provide positive feedback if the option 'Command_Feedback' is set to 'interactive'.

If there is a syntax error in command_string, a message is displayed on standard out. If the command is successfully executed, and the Command_Feedback option is set to always or interactive, command feedback is displayed on the output window. If Command_Feedback is set to never, no feedback is generated. To submit a non-interactive string to the command interface use the method parseCommandString().

Parameters:
command_string  is the typed command string to be parsed.


The documentation for this class was generated from the following file:
Generated on Fri Jul 14 15:05:56 2006 by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001