Server
API Reference Guide
Product Documentation:

Rogue Wave Server
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlsMvComponentFactory Class Reference

This class is the factory class used to create instances of the IlsMvComponent class. More...

#include <ilserver/mvcomp.h>

Inheritance diagram for IlsMvComponentFactory:
IlsSwComponentFactory

Public Member Functions

 IlsMvComponentFactory ()
 Constructor. More...
 
virtual ~IlsMvComponentFactory ()
 Destructor. More...
 
virtual const char * getHostName ()
 Ysed by Rogue Wave Server when a component connects to a server. More...
 
virtual const char * getInetId ()
 Used by Rogue Wave Server when a component connects to a server. More...
 
virtual long getProcessId ()
 Used by Rogue Wave Server when a component connects to a server. More...
 
virtual long getUserId ()
 Used by Rogue Wave Server when a component connects to a server. More...
 
virtual IlsMvValuegetUserInfo (int &argc)
 Called by a Server component when the connection to a server is established. More...
 
virtual const char * getUserName ()
 Used by Rogue Wave Server when a component connects to a server. More...
 
virtual IlsMvComponentnewInstance ()
 Called by the Instanciate() function on the class singleton to create a new instance of an IlsMvComponent class or subclass. More...
 

Static Public Member Functions

static IlsMvComponentFactoryGetSingleton ()
 Returns a reference to the component factory. More...
 
static IlsMvComponentFactoryGetSingletonPtr ()
 Returns a pointer to the class singleton. More...
 
static IlsMvComponentInstanciate ()
 Called by Rogue Wave Server to create a new instance of the IlsMvComponent class. More...
 
static IlsMvComponentFactorySetSingleton (IlsMvComponentFactory *s)
 Declares the object pointed to by s as the component factory singleton. More...
 

Detailed Description

This class is the factory class used to create instances of the IlsMvComponent class.

Library: mvserver
and mvcomp

Any component of a dynamic view server, either distributed or linked, is implemented by an instance of the IlsMvComponent type or of one of its subtypes.

By subclassing IlsMvComponentFactory and overriding the newInstance() function, you can create your own subtype of IlsMvComponent. See IlsMvEndPointFactory to have more details about the factory chain of components.

See also
IlsMvComponent IlsMvEndPointFactory

Constructor & Destructor Documentation

◆ IlsMvComponentFactory()

IlsMvComponentFactory::IlsMvComponentFactory ( )

Constructor.

The construction of an IlsMvComponentFactory object is triggered either by the function GetSingleton() or by the construction of a subtype object.

◆ ~IlsMvComponentFactory()

virtual IlsMvComponentFactory::~IlsMvComponentFactory ( )
virtual

Destructor.

The destruction of the singleton is automatically performed at process exit.

Member Function Documentation

◆ getHostName()

virtual const char* IlsMvComponentFactory::getHostName ( )
virtual

Ysed by Rogue Wave Server when a component connects to a server.

This function returns the name of the host running the component. It can be overridden.

◆ getInetId()

virtual const char* IlsMvComponentFactory::getInetId ( )
virtual

Used by Rogue Wave Server when a component connects to a server.

This function returns the IP address of the host on the Internet. It can be overridden.

◆ getProcessId()

virtual long IlsMvComponentFactory::getProcessId ( )
virtual

Used by Rogue Wave Server when a component connects to a server.

This function returns the component process identifier. It can be overridden.

◆ GetSingleton()

static IlsMvComponentFactory& IlsMvComponentFactory::GetSingleton ( )
static

Returns a reference to the component factory.

If no factory has been declared yet, an instance of IlsMvComponentFactory is automatically created. It is declared as the class singleton using the SetSingleton() member function and returned as the result of this function.

Returns
reference to the component factory singleton

◆ GetSingletonPtr()

static IlsMvComponentFactory* IlsMvComponentFactory::GetSingletonPtr ( )
static

Returns a pointer to the class singleton.

If no singleton has been declared yet, it returns the null pointer.

Returns
a pointer to the component factory singleton

◆ getUserId()

virtual long IlsMvComponentFactory::getUserId ( )
virtual

Used by Rogue Wave Server when a component connects to a server.

This function returns the user identifier. It can be overridden.

◆ getUserInfo()

virtual IlsMvValue* IlsMvComponentFactory::getUserInfo ( int &  argc)
virtual

Called by a Server component when the connection to a server is established.

The function returns an array of IlsMvValue objects which are then assigned to the corresponding IlsMvUser instance on the server side.

See the member functions IlsMvUser::setUserInfo() and IlsMvUser::getUserInfo() for more information. If the returned arrary is not null, Rogue Wave Server deletes it using the system function delete []. The argc parameter must be set to the size of the returned array.

◆ getUserName()

virtual const char* IlsMvComponentFactory::getUserName ( )
virtual

Used by Rogue Wave Server when a component connects to a server.

This function returns the name of the user who started the component. It can be overridden.

◆ Instanciate()

static IlsMvComponent* IlsMvComponentFactory::Instanciate ( )
static

Called by Rogue Wave Server to create a new instance of the IlsMvComponent class.

It calls the newInstance() function on the class singleton (see GetSingleton()).

Returns
a pointer to the new instance

◆ newInstance()

virtual IlsMvComponent* IlsMvComponentFactory::newInstance ( )
virtual

Called by the Instanciate() function on the class singleton to create a new instance of an IlsMvComponent class or subclass.

You must override it if you want Rogue Wave Server to create instances of a specific derived class.

See also
GetSingleton(), Instanciate().
Returns
pointer to the new instance

Reimplemented in IlsSwComponentFactory.

◆ SetSingleton()

static IlsMvComponentFactory* IlsMvComponentFactory::SetSingleton ( IlsMvComponentFactory s)
static

Declares the object pointed to by s as the component factory singleton.

If s is null, the component factory singleton no longer exists. This function returns the address of the previous current component factory or, by default, the null pointer.

Parameters
spointer to the new singleton
Returns
pointer to the previous singleton