UltraScan III
List of all members | Classes | Public Member Functions | Private Slots | Private Attributes
US_WindowMessage Class Reference

Connect with window(s) for control messages. More...

#include "us_window_message.h"

Inheritance diagram for US_WindowMessage:
Inheritance graph
[legend]
Collaboration diagram for US_WindowMessage:
Collaboration graph
[legend]

Classes

class  Interpreter
 Interpreter definition. More...
 

Public Member Functions

 US_WindowMessage (QObject *=0)
 Generic constructor for the US_WindowMessage class. More...
 
 ~US_WindowMessage ()
 A destructor. More...
 
int findAllInterps (void)
 Function to issue a "winfo interps" command and populate an internal list of all interpreters. More...
 
int findAllInterps (QList< Interpreter > &)
 Function to issue a "winfo interps" command, populate an internal list of all interpreters, and return a copy. More...
 
int findLiveInterps ()
 Function to populate an internal list of active RasMol interpreters. More...
 
int findLiveInterps (QList< Interpreter > &)
 Function to return the list of active RasMol interpreters. More...
 
int zombieList (QStringList &)
 Function to return any list of zombie interpreters. More...
 
ulong addInterp (const QString)
 Function to add a new interpreter identified by the name of the file displayed in its window. More...
 
int interpIDs (QList< ulong > &)
 Function to return the list of active interpreter IDs. More...
 
int interpNames (QStringList &)
 Function to return the list of active interpreter names. More...
 
int interpFiles (QStringList &)
 Function to return a list of active interpreter file names. More...
 
ulong interpId (const QString)
 Function to return the interp ID for a given file name. More...
 
ulong interpIdByName (const QString)
 Function to return the interp ID for a given interp name. More...
 
QString interpName (const ulong)
 Function to return the interp name for a given ID. More...
 
QString interpName (const QString)
 Function to return the interp name for a given file name. More...
 
QString interpFileName (const ulong)
 Function to return the file name for a given ID. More...
 
QString interpFileName (const QString)
 Function to return the file name for a given interp name. More...
 
int sendMessage (const ulong, const QString)
 Function to send a message to an interpreter as identified by an ID number. More...
 
int sendMessage (const QString, const QString)
 Function to send a message to an interpreter as identified by an interpreter name. More...
 
QString sendQuery (const ulong, const QString)
 Function to send a query command to an interpreter, as identified by an ID number, and return the response. More...
 
QString sendQuery (const QString, const QString)
 Function to send a query command to an interpreter, as identified by an interpreter name, and return the response. More...
 
bool isLive (Interpreter &)
 Function to flag whether an interpreter is live. More...
 
QString lastSendResult (void)
 Function to return a status/error message from the last interpreter send action. More...
 

Private Slots

int fill_interps (int, char *, QList< Interpreter > &)
 

Private Attributes

QList< Interpreterall_interps
 List of all interpreters. More...
 
QList< Interpreterlive_interps
 List of active interpreters. More...
 
QList< ulonginterp_ids
 List of active interpreter IDs. More...
 
QStringList interp_names
 List of active interpreter names. More...
 
QStringList file_names
 List of active interpreter file names. More...
 
QStringList zombie_list
 List of zombie interpreter strings. More...
 
int dbg_level
 Debug level value. More...
 

Detailed Description

Connect with window(s) for control messages.

This class provides a connection to external windows, such as those created by Rasmol, so that control messages may be sent to a specific window.

Definition at line 19 of file us_window_message.h.

Constructor & Destructor Documentation

US_WindowMessage::US_WindowMessage ( QObject *  parent = 0)

Generic constructor for the US_WindowMessage class.

Definition at line 34 of file us_window_message.cpp.

US_WindowMessage::~US_WindowMessage ( )
inline

A destructor.

Definition at line 45 of file us_window_message.h.

Member Function Documentation

ulong US_WindowMessage::addInterp ( const QString  filename)

Function to add a new interpreter identified by the name of the file displayed in its window.

Parameters
filenameFile name to associate with the last added interp.
Returns
Interpreter ID of this added interpreter.

Definition at line 117 of file us_window_message.cpp.

int US_WindowMessage::fill_interps ( int  nchar,
char *  wiresult,
QList< Interpreter > &  intrps 
)
privateslot

Definition at line 342 of file us_window_message.cpp.

int US_WindowMessage::findAllInterps ( void  )

Function to issue a "winfo interps" command and populate an internal list of all interpreters.

Returns
Count of interpreters found

Definition at line 41 of file us_window_message.cpp.

int US_WindowMessage::findAllInterps ( QList< Interpreter > &  interps)

Function to issue a "winfo interps" command, populate an internal list of all interpreters, and return a copy.

Parameters
interpsReference to interpreters list populated herein.
Returns
Count of interpreters found

Definition at line 59 of file us_window_message.cpp.

int US_WindowMessage::findLiveInterps ( )

Function to populate an internal list of active RasMol interpreters.

Returns
Count of interpreters found

Definition at line 67 of file us_window_message.cpp.

int US_WindowMessage::findLiveInterps ( QList< Interpreter > &  interps)

Function to return the list of active RasMol interpreters.

Parameters
interpsReference to interpreters list populated herein.
Returns
Count of interpreters found

Definition at line 95 of file us_window_message.cpp.

QString US_WindowMessage::interpFileName ( const ulong  id)

Function to return the file name for a given ID.

Parameters
idID number for which to return a file name.
Returns
File name corresponding to given ID.

Definition at line 258 of file us_window_message.cpp.

QString US_WindowMessage::interpFileName ( const QString  iname)

Function to return the file name for a given interp name.

Parameters
inameInterpreter name for which to return a file name.
Returns
File name corresponding to given interp name.

Definition at line 275 of file us_window_message.cpp.

int US_WindowMessage::interpFiles ( QStringList &  fnames)

Function to return a list of active interpreter file names.

Parameters
fnamesReference to interpreter file names list for return.
Returns
Count of interpreters found

Definition at line 178 of file us_window_message.cpp.

ulong US_WindowMessage::interpId ( const QString  filename)

Function to return the interp ID for a given file name.

Parameters
filenameFile name for which to return the ID.
Returns
ID number corresponding to given file name.

Definition at line 190 of file us_window_message.cpp.

ulong US_WindowMessage::interpIdByName ( const QString  iname)

Function to return the interp ID for a given interp name.

Parameters
inameInterpreter name for which to return the ID.
Returns
ID number corresponding to given interp name.

Definition at line 207 of file us_window_message.cpp.

int US_WindowMessage::interpIDs ( QList< ulong > &  ids)

Function to return the list of active interpreter IDs.

Parameters
idsReference to interpreter IDs list for return.

Definition at line 154 of file us_window_message.cpp.

QString US_WindowMessage::interpName ( const ulong  id)

Function to return the interp name for a given ID.

Parameters
idInterpreter ID for which to return the name.
Returns
Interpreter name corresponding to given ID.

Definition at line 224 of file us_window_message.cpp.

QString US_WindowMessage::interpName ( const QString  filename)

Function to return the interp name for a given file name.

Parameters
filenameFile name for which to return the interp name.
Returns
Interpreter name corresponding to given file name.

Definition at line 241 of file us_window_message.cpp.

int US_WindowMessage::interpNames ( QStringList &  names)

Function to return the list of active interpreter names.

Parameters
namesReference to interpreter names list for return.
Returns
Count of interpreters found

Definition at line 166 of file us_window_message.cpp.

bool US_WindowMessage::isLive ( Interpreter interp)

Function to flag whether an interpreter is live.

Parameters
interpInterpreter to evaluate.
Returns
Flag: true if interpreter is live.

Definition at line 324 of file us_window_message.cpp.

QString US_WindowMessage::lastSendResult ( void  )

Function to return a status/error message from the last interpreter send action.

Returns
Error message from last send attempt.

Definition at line 335 of file us_window_message.cpp.

int US_WindowMessage::sendMessage ( const ulong  id,
const QString  wmsg 
)

Function to send a message to an interpreter as identified by an ID number.

Parameters
idID number of interpreter to contact.
wmsgWindow message to send to the interpreter window.
Returns
Status flag of send (0=OK).

Definition at line 292 of file us_window_message.cpp.

int US_WindowMessage::sendMessage ( const QString  iname,
const QString  wmsg 
)

Function to send a message to an interpreter as identified by an interpreter name.

Parameters
inameName of interpreter to contact.
wmsgWindow message to send to the interpreter window.
Returns
Status flag of send (0=OK).

Definition at line 299 of file us_window_message.cpp.

QString US_WindowMessage::sendQuery ( const ulong  id,
const QString  wmsg 
)

Function to send a query command to an interpreter, as identified by an ID number, and return the response.

Parameters
idID number of interpreter to contact.
wmsgWindow message to send to the interpreter window.
Returns
Response string.

Definition at line 306 of file us_window_message.cpp.

QString US_WindowMessage::sendQuery ( const QString  iname,
const QString  wmsg 
)

Function to send a query command to an interpreter, as identified by an interpreter name, and return the response.

Parameters
inameName of interpreter to contact.
wmsgWindow message to send to the interpreter window.
Returns
Response string.

Definition at line 315 of file us_window_message.cpp.

int US_WindowMessage::zombieList ( QStringList &  zlist)

Function to return any list of zombie interpreters.

Parameters
zlistReference for return of zombies list
Returns
Count of zombie interpreters

Definition at line 105 of file us_window_message.cpp.

Member Data Documentation

QList< Interpreter > US_WindowMessage::all_interps
private

List of all interpreters.

Definition at line 163 of file us_window_message.h.

int US_WindowMessage::dbg_level
private

Debug level value.

Definition at line 171 of file us_window_message.h.

QStringList US_WindowMessage::file_names
private

List of active interpreter file names.

Definition at line 168 of file us_window_message.h.

QList< ulong > US_WindowMessage::interp_ids
private

List of active interpreter IDs.

Definition at line 166 of file us_window_message.h.

QStringList US_WindowMessage::interp_names
private

List of active interpreter names.

Definition at line 167 of file us_window_message.h.

QList< Interpreter > US_WindowMessage::live_interps
private

List of active interpreters.

Definition at line 164 of file us_window_message.h.

QStringList US_WindowMessage::zombie_list
private

List of zombie interpreter strings.

Definition at line 169 of file us_window_message.h.


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