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

VOS::Site Class Reference

A site is the root of any collection of Vobjects. More...

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

Inheritance diagram for VOS::Site:

VOS::MetaObject VOS::Vobject VOS::RefCounted VOS::LocalSite VOS::RemoteSite VOS::LocalSocketSite VOS::RemoteSocketSite VOS::RemoteStreamSite List of all members.

Public Member Functions

Static Public Member Functions

Public Attributes

Static Public Attributes

Protected Member Functions

Protected Attributes


Detailed Description

A site is the root of any collection of Vobjects.

It is a normal Vobject itself, but also supports a number of other methods. Think of sites as the connecting lines across which a Vobject may exchange messages with another Vobject on another host across the Internet.

Definition at line 104 of file site.hh.


Constructor & Destructor Documentation

VOS::Site::Site  )  [protected]
 

VOS::Site::Site MetaObject superobject  )  [protected]
 

virtual VOS::Site::~Site  )  [virtual]
 


Member Function Documentation

virtual void VOS::Site::addHostAlias const string &  h  )  [virtual]
 

Add a host alias to this site.

A host alias is a legal name by which this site may be refered to.

Parameters:
h the host alias in the form "hostname:port"

Referenced by VOS::AsyncConnect::operator()().

virtual void VOS::Site::addMessageBlock MessageBlock m  )  [virtual]
 

Save a message block template for later retrival and execution.

Parameters:
m the message block

virtual void VOS::Site::addNotification NotifyEvent ev  )  [pure virtual]
 

Implemented in VOS::LocalSite, and VOS::RemoteSite.

void VOS::Site::addSite Site s  )  [static]
 

Add a site to the master table of known sites.

Parameters:
s the site to be added

Referenced by VOS::RemoteStreamSite::runScript().

MetaObject* VOS::Site::createMetaObject const char *  name = 0  )  [inline]
 

Create an object with no types.

Definition at line 174 of file site.hh.

virtual MetaObject* VOS::Site::createMetaObject const char *  name,
const deque< string > &  typelist
[pure virtual]
 

Same as the other createMetaObject method, but takes a deque of type strings rather than a variable list of strings.

See also:
createMetaObject(const char*, const char*, ...)

Implemented in VOS::LocalSite, and VOS::RemoteSite.

virtual MetaObject* VOS::Site::createMetaObject const char *  name,
const char *  firstType,
... 
[pure virtual]
 

Create a new MetaObject on this site.

Parameters:
name Request this name for the new object. If name is 0, empty or contains a name already in use, a new name will be generated.
type0,... Type strings indicating type extentions to be included with the new objects. The list of type strings must be terminated by a 0.
For example:
           // Create an example object with two types: 3D cube and Hypercard.
           vRef<MetaObject> obj1 = site.createMetaObject("example", "object3D:cube", typeid(Hypercard).name(), 0);

           // Create another example object with no types. Because the same
           // name an the previos object ("example") is specified, this object will be
           // renamed when created, probably to "example1" or something similiar.
           vRef<MetaObject> obj2 = site.createMetaObject("example" , 0);

Implemented in VOS::LocalSite, and VOS::RemoteSite.

template<class T>
T* VOS::Site::createMetaObjectT const char *  name = 0  )  [inline]
 

Create a new metaobject with one type, and cast it to that type.

Parameters:
T Desired MetaObject subclass
name If given, site-name of the new object

Definition at line 169 of file site.hh.

string VOS::Site::detectHostname int  fd,
unsigned char  ipaddr[4]
[static]
 

void VOS::Site::doSitePeering LocalSite ls,
RemoteSite rs,
bool  isspooftest,
bool  waitforhello
[static]
 

Referenced by VOS::RemoteStreamSite::runScript().

Site& VOS::Site::findSite const string &  s  )  throw (NoSuchSiteError) [static]
 

Find a site by its host alias.

Will contact remote sites as necessary.

Parameters:
s the site host alias (in the form "host:port")
Returns:
the site matching that host alias. NOTE YOU MUST CALL release() WHEN DONE OR USE A vRef<>
Exceptions:
NoSuchSiteError if the site is not found or could not be contacted

virtual void VOS::Site::flushIncomingBuffers  )  [pure virtual]
 

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

Implemented in VOS::LocalSite, VOS::LocalSocketSite, VOS::RemoteSite, VOS::RemoteSocketSite, and VOS::RemoteStreamSite.

virtual void VOS::Site::flushNotifications  )  [pure virtual]
 

Implemented in VOS::LocalSite, and VOS::RemoteSite.

void VOS::Site::freeHostEnt struct hostent *  hp  )  [static]
 

virtual string VOS::Site::generateUniqueName  )  [virtual]
 

Generate random and unique numerical name. (Used by the createMetaObject methods).

const map<string,Site*>& VOS::Site::getAllSites  )  [static]
 

Get the current table of known sites, which maps host aliases to sites.

Returns:
the site table

LocalSite* VOS::Site::getDefaultPeer  )  [static]
 

Get the local site with which new remote sites will peered.

Returns:
the default peer. NOTE YOU MUST CALL release() WHEN DONE OR USE A vRef<>

virtual bool VOS::Site::getGreeted  )  [virtual]
 

Referenced by VOS::AsyncConnect::connect().

virtual set<string>& VOS::Site::getHostAliases  )  [virtual]
 

Get a list of host alias.

Returns:
the set of host valid host aliases.

struct hostent* VOS::Site::gethostbyaddr_locked const char *  addr,
int  len,
int  type
[static]
 

struct hostent* VOS::Site::gethostbyname_locked const char *  addr  )  [static]
 

virtual MessageBlock* VOS::Site::getMessageBlock const string &  s  )  throw (NoSuchMessageBlockError) [virtual]
 

Retrive a saved message block template.

Parameters:
s the name of the message block.
Returns:
The message block, or 0 if not found. NOTE YOU MUST CALL release() WHEN DONE OR USE A vRef<>

virtual const deque<MessageFilter*>& VOS::Site::getMessageFilters  )  [virtual]
 

virtual Site& VOS::Site::getSite  )  [virtual]
 

Get the site this object resides on.

Returns:
the site object. NOTE YOU MUST CALL release() WHEN DONE OR USE A rREF() BLOCK

Reimplemented from VOS::MetaObject.

Reimplemented in VOS::LocalSite, and VOS::RemoteSite.

virtual const string VOS::Site::getType  )  [virtual]
 

Returns:
the specific MOS type name that represents the MOS interface this object is supplying.

Reimplemented from VOS::MetaObject.

virtual bool VOS::Site::hasHostAlias const string &  h  )  [virtual]
 

Tests for the existance of a given host alias.

Parameters:
h the host alias
Returns:
true if h is a legal host alias, false if not

struct hostent* VOS::Site::hostent_deepcopy struct hostent *  hp  )  [static]
 

virtual void VOS::Site::insertMessageFilter int  pos,
MessageFilter mf
[virtual]
 

Referenced by VOS::RemoteSocketSite::enableOutgoing(), and VOS::RemoteSocketSite::suppressOutgoing().

virtual bool VOS::Site::isConnected  )  [pure virtual]
 

Implemented in VOS::LocalSite, VOS::RemoteSite, VOS::RemoteSocketSite, and VOS::RemoteStreamSite.

virtual void VOS::Site::lockNotificationFlush  )  [pure virtual]
 

Implemented in VOS::LocalSite, and VOS::RemoteSite.

virtual void VOS::Site::removeHostAlias const string &  h  )  [virtual]
 

Remove a host alias of this site.

Parameters:
h the host alias in the form "hostname:port"

virtual void VOS::Site::removeMessageBlock MessageBlock m  )  [virtual]
 

Remove a saved message block template.

Parameters:
m the message block

virtual void VOS::Site::removeMessageFilter MessageFilter m  )  [virtual]
 

virtual void VOS::Site::removeMessageFilter int  pos  )  [virtual]
 

Referenced by VOS::RemoteSocketSite::enableOutgoing().

void VOS::Site::removeSite Site s  )  [static]
 

Remove a site from the master table of known sites.

Parameters:
s the site to remove

virtual void VOS::Site::sendMessage MessageBlock m  )  [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.

Reimplemented from VOS::MetaObject.

Reimplemented in VOS::LocalSite, VOS::RemoteSite, VOS::RemoteSocketSite, and VOS::RemoteStreamSite.

virtual void VOS::Site::sendMessage Message m  )  [virtual]
 

Sends a message 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.

Reimplemented from VOS::MetaObject.

Reimplemented in VOS::LocalSite, VOS::LocalSocketSite, VOS::RemoteSite, VOS::RemoteSocketSite, and VOS::RemoteStreamSite.

Referenced by VOS::RemoteVobject::sendMessage().

void VOS::Site::setDefaultPeer LocalSite localsite  )  [static]
 

Set the local site with which new remote sites will peered.

Parameters:
localsite the default peer

virtual void VOS::Site::setGreeted bool  g  )  [virtual]
 

Referenced by VOS::RemoteSite::RemoteSite().

virtual void VOS::Site::setURL const URL u  )  [pure virtual]
 

Set the base URL ("vop://host:port") that this site will use.

Parameters:
u some URL.

Implemented in VOS::LocalSite, and VOS::RemoteSite.

virtual void VOS::Site::trapOutgoingReply Message m  )  [virtual]
 

virtual string VOS::Site::uniqueName const char *  base  )  [virtual]
 

Generate unique object name by appending successive integers to the given base (if necesary).

(Used by the createMetaObject methods).

virtual void VOS::Site::unlockNotificationFlush  )  [pure virtual]
 

Implemented in VOS::LocalSite, and VOS::RemoteSite.


Member Data Documentation

set<int> VOS::Site::allOpenSockets [static]
 

All sockets open to this process.

Used so that the process, if desired, can sleep on select(), blocking indefinitely, and wake up when data comes in from any open socket.

Definition at line 135 of file site.hh.

Referenced by VOS::RemoteSocketSite::excise(), and VOS::LocalSocketSite::getFDset().

MessageContext VOS::Site::defaultContext
 

Definition at line 129 of file site.hh.

deque<MessageFilter*> VOS::Site::messagefilters [protected]
 

Definition at line 121 of file site.hh.

Referenced by VOS::RemoteSocketSite::sendMessage().


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