JetByteTools::Socket::CNamedServerCollection Class Reference

Inherits JetByteTools::Socket::IServerControl.

Inheritance diagram for JetByteTools::Socket::CNamedServerCollection:

Inheritance graph
[legend]
Collaboration diagram for JetByteTools::Socket::CNamedServerCollection:

Collaboration graph
[legend]
List of all members.

Detailed Description

A class that implements a collection of named instances of IServerControl and that allows you to control all of the instances as one and also manipulate individual instances by name.


Public Member Functions

 CNamedServerCollection ()
 Creates an empty collection.
 ~CNamedServerCollection ()
void AddServer (const JetByteTools::Win32::_tstring &name, IServerControl *pServer)
 Adds an instance of IServerControl to the collection and takes ownership of the instance; it will be deleted when the collection is destroyed.
void AddServer (const JetByteTools::Win32::_tstring &name, IServerControl &server)
 Adds an instance of IServerControl to the collection and does not take ownership of the instance.
IServerControlRemoveServer (const JetByteTools::Win32::_tstring &name)
 Locates an instance of IServerControl by name and removes it from the collection and returns it. If the instance was owned by the collection then it is no longer owned by the collection and the caller now owns the instance. Returns 0 if an instance of the supplied name does not exist.
IServerControlGetServer (const JetByteTools::Win32::_tstring &name)
 Obtains a reference to an instance of IServerControl from the collection by name. If the named instance does not exist then an exception is thrown.
virtual void Start ()
virtual void StartAcceptingConnections ()
virtual void StopAcceptingConnections ()
virtual void InitiateShutdown ()
 Starts the shutdown process and returns immediately.
virtual void WaitForShutdownToComplete ()
 Initiates a shutdown (if one isn't already in progresss) and then waits for it to complete. Does not return until the shutdown has completed.


Constructor & Destructor Documentation

JetByteTools::Socket::CNamedServerCollection::CNamedServerCollection (  ) 

Creates an empty collection.

JetByteTools::Socket::CNamedServerCollection::~CNamedServerCollection (  ) 


Member Function Documentation

void JetByteTools::Socket::CNamedServerCollection::AddServer ( const JetByteTools::Win32::_tstring name,
IServerControl pServer 
)

Adds an instance of IServerControl to the collection and takes ownership of the instance; it will be deleted when the collection is destroyed.

void JetByteTools::Socket::CNamedServerCollection::AddServer ( const JetByteTools::Win32::_tstring name,
IServerControl server 
)

Adds an instance of IServerControl to the collection and does not take ownership of the instance.

IServerControl* JetByteTools::Socket::CNamedServerCollection::RemoveServer ( const JetByteTools::Win32::_tstring name  ) 

Locates an instance of IServerControl by name and removes it from the collection and returns it. If the instance was owned by the collection then it is no longer owned by the collection and the caller now owns the instance. Returns 0 if an instance of the supplied name does not exist.

IServerControl& JetByteTools::Socket::CNamedServerCollection::GetServer ( const JetByteTools::Win32::_tstring name  ) 

Obtains a reference to an instance of IServerControl from the collection by name. If the named instance does not exist then an exception is thrown.

void JetByteTools::Socket::CNamedServerCollection::Start (  )  [virtual]

Implements JetByteTools::Socket::IServerControl.

void JetByteTools::Socket::CNamedServerCollection::StartAcceptingConnections (  )  [virtual]

Implements JetByteTools::Socket::IServerControl.

void JetByteTools::Socket::CNamedServerCollection::StopAcceptingConnections (  )  [virtual]

Implements JetByteTools::Socket::IServerControl.

void JetByteTools::Socket::CNamedServerCollection::InitiateShutdown (  )  [virtual]

Starts the shutdown process and returns immediately.

Implements JetByteTools::Socket::IServerControl.

void JetByteTools::Socket::CNamedServerCollection::WaitForShutdownToComplete (  )  [virtual]

Initiates a shutdown (if one isn't already in progresss) and then waits for it to complete. Does not return until the shutdown has completed.

Implements JetByteTools::Socket::IServerControl.


Generated on Tue May 8 17:48:05 2007 for JetByte Socket Tools by  doxygen 1.5.2