Server
API Reference Guide
Product Documentation:

Visualization Server
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlsMvUserFactory Class Reference

Factory class that applies to instances of the class IlsMvUser. More...

#include <ilserver/mvuser.h>

Public Member Functions

 IlsMvUserFactory ()
 default constructor of the class.
 
virtual ~IlsMvUserFactory ()
 Virtual destructor of the class. More...
 
virtual IlsMvUsergetUser (const char *userName, int userId, const char *hostName, const char *inetId, int processId)
 Creates a new IlsMvUser object. More...
 

Static Public Member Functions

static IlsMvUserFactoryGetSingleton ()
 Returns a reference to the user factory. More...
 
static IlsMvUserFactoryGetSingletonPtr ()
 Returns a pointer on the class singleton. More...
 
static IlsMvUserFactorySetSingleton (IlsMvUserFactory *fp)
 Declares the object pointed to by fp as the user factory singleton. More...
 

Detailed Description

Factory class that applies to instances of the class IlsMvUser.

Library: mvserver

You should install this factory before initializing the dynamic view server, that is, before calling IlsMvServer::Initialize().

The API of this factory is somewhat different from that of other factories – such as IlsMvComponentFactory, for instance – in that the usual virtual member function newInstance() is replaced by the virtual member function getUser().

Each time a new application component connects to the server, a component interface object is created on the server side (see the class IlsMvComponentItf for details).

When the component interface object is created, it is associated with an IlsMvUser object. The class IlsMvUserFactory is used to get the relevant IlsMvUser object by calling the virtual function getUser(), which returns a new instance of IlsMvUser. However, by overriding this function in a subclass of IlsMvUserFactory, you can define a user type that will be specific to the application. Moreover, you can implement your own semantics to associate user objects with component interface objects. For instance, because you can decide to use the same IlsMvUser frequent implementation, getUser() was chosen as function name rather than newInstance.

As IlsMvUser derives from IlsEntity, its subclasses can define their own Server relations and data members. They can be accessed at runtime and used in view specifications. For more information, see the macros ILS_ENTITY_DECL().

See also
IlsEntity, ILS_ENTITY_BEGIN()/ILS_ENTITY_END(), ILS_ENTITY_DECL(), IlsMvComponentItf, IlsMvUser.

Constructor & Destructor Documentation

◆ ~IlsMvUserFactory()

virtual IlsMvUserFactory::~IlsMvUserFactory ( )
virtual

Virtual destructor of the class.

Note that the singleton is automatically destroyed when the process exits (see SetSingleton()).

Member Function Documentation

◆ GetSingleton()

static IlsMvUserFactory& IlsMvUserFactory::GetSingleton ( )
static

Returns a reference to the user factory.

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

The singleton is automatically destroyed at process exit.

◆ GetSingletonPtr()

IlsMvUserFactory * IlsMvUserFactory::GetSingletonPtr ( )
static

Returns a pointer on the class singleton.

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

◆ getUser()

IlsMvUser * IlsMvUserFactory::getUser ( const char *  userName,
int  userId,
const char *  hostName,
const char *  inetId,
int  processId 
)
virtual

Creates a new IlsMvUser object.

If it is not overridden in the class of the factory singleton (see GetSingleton() below), this virtual member function is called each time a new instance of IlsMvComponentItf is created in the server. It creates a new IlsMvUser object.

◆ SetSingleton()

static IlsMvUserFactory* IlsMvUserFactory::SetSingleton ( IlsMvUserFactory fp)
static

Declares the object pointed to by fp as the user factory singleton.

If fp is null, there is no longer a user factory singleton. The address of the previous current user factory or, by default, the null pointer is returned as the result of the function.