IlsMvUserFactory
 
IlsMvUserFactory
Category 
Dynamic view-related class (server side)
Inheritance Path 
IlsMvUserFactory
Description 
This class is a factory class that applies to instances of the class IlsMvUser. 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.
Library 
<mvserver>
Header File 
#include <ilserver/mvuser.h>
Synopsis 
class IlsMvUserFactory{
public:
IlsMvUserFactory();
virtual ~IlsMvUserFactory();
virtual IlsMvUser* getUser(const char* userName,
int userId,
const char* hostName,
const char* inetId,
int processId);
static IlsMvUserFactory& getSingleton();
static IlsMvUserFactory* getSingletonPtr(){}
static IlsMvUserFactory* SetSingleton(IlsMvUserFactory* fp);
};
Constructor 
IlsMvUserFactory();
This is the default constructor of the class.
Destructor 
virtual ~IlsMvUserFactory();
This is the virtual destructor of the class. Note that the singleton is automatically destroyed when the process exits (see SetSingleton below).
Member Functions 
[virtual] IlsMvUser* getUser(const char* userName,
int userId,
const char* hostName,
const char* inetId,
int processId);
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.
[static] IlsMvUserFactory& GetSingleton();
This static member function returns a reference to the user factory. If no factory has been declared yet (see SetSingleton below), 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.
[static] IlsMvUserFactory* GetSingletonPtr(){}
This static member function returns a pointer on the class singleton. If no singleton has been yet declared, it returns the null pointer.
[static] IlsMvUserFactory* SetSingleton(IlsMvUserFactory* fp);
This static member function 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.
See Also 
IlsEntity, ILS_ENTITY_BEGIN/ILS_ENTITY_END, ILS_ENTITY_DECL, IlsMvComponentItf, IlsMvUser

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.