IlsMvComponentItf
 
IlsMvComponentItf
Category 
Dynamic view-related class (server side)
Inheritance Path 
IlsMvEndPoint
IlsMvComponentItf
Description 
This class implements the interface of a component that interacts with a dynamic
view server. When a component connects to a server, an instance of a subtype of IlsMvComponentItf is automatically created on the server side. This class is generally transparent for the user, but you might need to use it in certain circumstances, such as opening views directly from a server. For details, see the member functions IlsMvServer::OpenView, IlsMvServer::GetInteractor, and IlsMvView::getComponent.
Library 
<mvserver>
Header File 
#include <ilserver/mvcpitf.h>
Synopsis 
class IlsMvComponentItf {
public:
IlsMvComponentItf* Narrow(IlsMvEndPoint& ep);
IlsMvView* getView(IlsRepresentationId id);
IlsViewed* getSvObject(const IlsMvRef&);
IlsMvUser* getUser();
IlsThread* threadSending();
IlsBoolean isThreadSending();
IlsMvComponentId getId();
Closing a Component
IlsMvComponentItf& closeAllViews(IlsBoolean notify=IlsTrue);
virtual IlsMvComponentItf& close(IlsBoolean notify=IlsTrue);
virtual void onClose();
virtual void requestDisconnect();
Messages
unsigned int getPendingOutput();
void monitorSendingQueue(IlsBoolean b);
};
Member Functions 
[static] IlsMvComponentItf* Narrow(IlsMvEndPoint& ep);
This member function operates a safe downcast of the reference ep into a pointer to a component interface. If that downcast is successful, the function returns the address of this component interface. Otherwise, it returns the null pointer.
IlsMvView* getView(IlsRepresentationId id);
This member function returns a pointer to the view associated with the representation identifier id or a null pointer if no association has been established between a view and a representation.
IlsViewed* getSvObject(const IlsMvRef&);
This member function returns a pointer to the Server object associated with the reference object passed as its argument. It returns null by default. The server object can be narrowed down to its actual application class by using the static function Narrow defined on this class (see the macros ILS_OBJECT_DECL and ILS_ENTITY_DECL for details.)
IlsMvUser* getUser();
This member function returns a pointer to the user associated with the component interface. It returns a null pointer if the interface is being destroyed.
IlsThread* threadSending();
This member function starts a thread that sends all notification updates and other messages generated by the server to the component. See the IlsMvServer constructor for details about the various server threaded execution modes.
IlsBoolean isThreadSending();
This member function return IlsTrue if a special thread is started to send notification updates and other messages generated by the server to the component.
IlsMvComponentId getId();
This member function returns the identifier associated with the component. These identifiers are unique. You can therefore keep them to retrieve a component later using the function IlsMvServer::GetComponent.
Closing a Component
IlsMvComponentItf& closeAllViews(IlsBoolean notify=IlsTrue);
This member function closes all the views associated with the component by calling the function IlsMvView::close on each one of the views with the Boolean parameter notify as its argumentIf the notify argument is set to IlsFalse, the views are immediately closed without notification. If it is set to IlsTrue, the views will be closed during the next notification cycle.
[virtual] IlsMvComponentItf& close(IlsBoolean notify=IlsTrue);
This virtual member function closes the views associated with the component.
[virtual] void onClose();
This empty virtual function is called when all the views associated with the component are closed. It can be overridden.
[virtual] void requestDisconnect();
This virtual member function closes the connection from the server. It can be safely used when the function IlsMvUser::updateSendingQueueLength is invoked from the main thread or from the sender thread. Use this function to close the connection when the sending queue has grown too big, meaning that the peer client is blocked. Also, you should use this method rather than IlsMvEndPoint::disconnect when you want to close the connection during the notification cycle.
Messages
unsigned int getPendingOutput();
This member function returns the number of output messages stored in the sending queue associated with this component, if any.
void monitorSendingQueue(IlsBoolean b);
This member function allows you to monitor the sending queue if a sending thread has been associated with this component. When this property is set to IlsTrue, Rogue Wave Server calls the function IlsMvUser::updateSendingQueueLength each time a message is added to, or removed from, the sending queue. By default, the sending queue is not monitored. You can call this method when the function IlsMvUser::onBind is called.
See Also 
IlsMvServer, IlsMvUser, IlsMvView, IlsRepresentation

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