IlsMvComponentFactory
 
IlsMvComponentFactory
Category 
Dynamic view-related class (server side)
Inheritance Path 
IlsMvComponentFactory
Description 
This class is the factory class used to create instances of the IlsMvComponent class.
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.
*In distributed applications, such an instance is automatically created on the component side each time this process connects to a dynamic view server (see IlsMvComponent::Connect).
*In linked mode, such an instance is automatically created as soon as there is an attempt to open a view without specifying any owning component (see IlsMvServer::OpenView).
By subclassing IlsMvComponentFactory and overriding the newInstance function, you can create your own subtype of IlsMvComponent.
Libraries 
<mvserver> and <mvcomp>
Header File 
#include <ilserver/mvcomp.h>
Synopsis 
class IlsMvComponentFactory {
public:
IlsMvComponentFactory();
virtual ~IlsMvComponentFactory(){};
 
virtual IlsMvComponent* newInstance(){}
virtual const char* getUserName();
virtual long getUserId();
virtual IlsMvValue* getUserInfo(int& argc);
virtual const char* getHostName();
virtual const char* getInetId();
virtual long getProcessId();
static IlsMvComponent* Instanciate();
static IlsMvComponentFactory& GetSingleton();
static IlsMvComponentFactory* GetSingletonPtr();
static IlsMvComponentFactory*
SetSingleton(IlsMvComponentFactory* fp);
};
Constructor 
IlsMvComponentFactory();
The construction of an IlsMvComponentFactory object is triggered either by the function GetSingleton or by the construction of a subtype object.
Destructor 
virtual ~IlsMvComponentFactory();
The destruction of the singleton is automatically performed at process exit.
Member Functions 
[virtual] IlsMvComponent* newInstance() {}
This virtual member function is called by the Instanciate function on the class singleton to create a new instance of an IlsMvComponent class or of a derived class (see the member functions GetSingleton and Instanciate below). You must override it if you want Rogue Wave Server to create instances of a specific derived class.
It returns a pointer to the new instance.
[virtual] const char* getUserName();
This virtual member function is 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.
[virtual] long getUserId();
This virtual member function is used by Rogue Wave Server when a component connects to a server. This function returns the user identifier. It can be overridden.
[virtual] IlsMvValue* getUserInfo(int& argc);
This virtual member function is called by an 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 tit using the system function delete []. The argc parameter must be set to the size of the returned array.
[virtual] .const char* getHostName();
This virtual member function is used 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.
[virtual] const char* getInetId();
This virtual member function is 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.
[virtual] long getProcessId();
This virtual member function is used by Rogue Wave Server when a component connects to a server. This function returns the component process identifier. It can be overridden.
[static] IlsMvComponent* Instanciate();
This static member function is 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 below).
It returns a pointer to the new instance.
[static] IlsMvComponentFactory& GetSingleton();
This static member function 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.
[static] IlsMvComponentFactory* GetSingletonPtr();
This static member function returns a pointer to the class singleton. If no singleton has been declared yet, it returns the null pointer.
[static] IlsMvComponentFactory* SetSingleton(IlsMvComponentFactory* fp);
This static member function declares the object pointed to by fp as the component factory singleton. If fp is nul, the component factory singleton no longer exists. This function returns the address of the previous current component factory or, by default, the null pointer.
See Also 
IlsMvComponent

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