Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

VOS::RemoteStreamSite Class Reference

A simulated remote site using a file for input instead of a network socket. More...

#include <vos/corelibs/vos/remotestreamsite.hh>

Inheritance diagram for VOS::RemoteStreamSite:

VOS::RemoteSite VOS::Site VOS::RemoteMetaObject VOS::ChildChangeListener VOS::ParentChangeListener VOS::TypeChangeListener VOS::MetaObject VOS::MetaObject VOS::RemoteVobject VOS::Vobject VOS::Vobject VOS::VobjectImplementation VOS::RefCounted VOS::RefCounted VOS::Vobject VOS::ObjectExciseListener VOS::RefCounted List of all members.

Public Member Functions

Static Public Member Functions

Protected Member Functions

Protected Attributes


Detailed Description

A simulated remote site using a file for input instead of a network socket.

Definition at line 42 of file remotestreamsite.hh.


Constructor & Destructor Documentation

RemoteStreamSite::RemoteStreamSite FILE *  readfd,
FILE *  writefd
 

Definition at line 36 of file remotestreamsite.cc.

Referenced by runScript().

RemoteStreamSite::~RemoteStreamSite  )  [virtual]
 

Definition at line 44 of file remotestreamsite.cc.


Member Function Documentation

void RemoteStreamSite::flushIncomingBuffers  )  [virtual]
 

Flush any incoming buffers (eg read any data waiting in sockets).

Implements VOS::RemoteSite.

Definition at line 118 of file remotestreamsite.cc.

virtual void VOS::RemoteStreamSite::flushOutgoingBuffers const char *  data = 0,
unsigned int  sz = 0
[inline, virtual]
 

Implements VOS::RemoteSite.

Definition at line 63 of file remotestreamsite.hh.

void RemoteStreamSite::handleDisconnection  )  [virtual]
 

Definition at line 103 of file remotestreamsite.cc.

Referenced by flushIncomingBuffers().

bool RemoteStreamSite::isConnected  )  [virtual]
 

Implements VOS::RemoteSite.

Definition at line 208 of file remotestreamsite.cc.

virtual bool VOS::RemoteStreamSite::isLocal  )  [inline, virtual]
 

Return true if this object is local, false if not.

Returns:
whether it is local

Reimplemented from VOS::RemoteMetaObject.

Definition at line 65 of file remotestreamsite.hh.

virtual bool VOS::RemoteStreamSite::isRemote  )  [inline, virtual]
 

Return true if this object is remote, false if not.

Returns:
whether it is remote

Reimplemented from VOS::RemoteMetaObject.

Definition at line 66 of file remotestreamsite.hh.

int RemoteStreamSite::readStream char *  data,
unsigned int  datasize
[protected, virtual]
 

Definition at line 50 of file remotestreamsite.cc.

Referenced by flushIncomingBuffers().

bool RemoteStreamSite::runScript const string &  filename,
LocalSite ls,
Message lastmessage = 0
[static]
 

Runs a script file (a session of VOS messages.) The reason why this is in RemoteStreamSite is because it works by creating a temporary "fake" site from which the messages will originate.

Parameters:
filename The script file to load. If the filename ends in ".gz", it will be automatically decompressed with gzip!
ls the local site which will receive the script messages
lastmessage an optional final message that will be sent to the local site right before the script is completed.
Note:
If you are opening a gzipped file, "gunzip" is called using popen() which calls the shell. This means that untrusted filenames should not be passed into this function!
Returns:
true if the script loaded successfully, false if there was an error. Does not report syntax errors in the script, however.

Definition at line 151 of file remotestreamsite.cc.

void RemoteStreamSite::sendMessage MessageBlock mb  )  [virtual]
 

Sends a block of messages to the object.

This may trigger immediate processing of the message if the object is local.

Parameters:
m A pointer to the message which is being sent. Its reference count will be increased as necssary.

Implements VOS::RemoteSite.

Definition at line 82 of file remotestreamsite.cc.

void RemoteStreamSite::sendMessage Message m  )  [virtual]
 

Exceptions:
SiteConnectionError 

Implements VOS::RemoteSite.

Definition at line 60 of file remotestreamsite.cc.

int RemoteStreamSite::writeStream const char *  data,
unsigned int  datasize
[protected, virtual]
 

Definition at line 55 of file remotestreamsite.cc.

Referenced by sendMessage().


Member Data Documentation

bool VOS::RemoteStreamSite::isScript [protected]
 

Definition at line 48 of file remotestreamsite.hh.

Referenced by handleDisconnection(), and isConnected().

MessageBlock* VOS::RemoteStreamSite::partialMessage [protected]
 

Definition at line 50 of file remotestreamsite.hh.

Referenced by flushIncomingBuffers(), and ~RemoteStreamSite().

bool VOS::RemoteStreamSite::pretendIsLocal [protected]
 

Definition at line 47 of file remotestreamsite.hh.

FILE* VOS::RemoteStreamSite::readingFILE [protected]
 

Definition at line 45 of file remotestreamsite.hh.

Referenced by flushIncomingBuffers(), handleDisconnection(), and readStream().

FILE* VOS::RemoteStreamSite::writingFILE [protected]
 

Definition at line 46 of file remotestreamsite.hh.

Referenced by handleDisconnection(), isConnected(), sendMessage(), and writeStream().


The documentation for this class was generated from the following files:
Generated on Tue Aug 12 03:56:06 2003 for Interreality Project - VOS by doxygen 1.3.2