This class implements the interface of a component that interacts with a dynamic view server. More...
#include <ilserver/mvcpitf.h>
Public Member Functions | |
IlsMvComponentId | getId () |
Returns the identifier associated with the component. More... | |
IlsSmartViewed | getSvObject (const IlsMvRef &ref) |
Returns a pointer to the Server object associated with the reference object passed as its argument. More... | |
IlsMvUser * | getUser () |
Returns a pointer to the user associated with the component interface. More... | |
IlsMvView * | getView (IlsRepresentationId id) |
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. More... | |
virtual void | onDisconnect () |
Called when the connection between the component and the server is destroyed. More... | |
virtual void | suppress () |
Call this virtual member function instead of the destructor if you want to delete an instance of IlsMvEndPoint . More... | |
Closing a Component | |
IlsMvComponentItf & | closeAllViews (IlsBoolean notify=IlsTrue) |
Closes all the views associated with the component. More... | |
virtual IlsMvComponentItf & | close (IlsBoolean notify=IlsTrue) |
Closes the views associated with the component. More... | |
virtual void | onClose () |
Called when all the views associated with the component are closed. More... | |
virtual IlsBoolean | requestDisconnect () |
Closes the connection from the server. More... | |
Public Member Functions inherited from IlsMvEndPoint | |
void | traceConnectionDenied (IlsBoolean b) |
Allows you to control whether an error message should be displayed when a connection is refused. | |
const IlsString & | getPeerName () const |
Returns remote process name. More... | |
const IlsString & | getPeerHost () const |
Returns host if remote connection. More... | |
IlsBoolean | isComponent () const |
This member function returns IlsTrue when the object is an instance of IlsMvComponent or of a derived class. Otherwise, it returns IlsFalse. | |
IlsBoolean | isLinked () const |
This member function returns IlsTrue when the component and the server are implemented in the same process. Otherwise, it returns IlsFalse. | |
IlsBoolean | setEncoder (IlsMsgEncoder) |
Declares the function encoding to be applied on any message before it is sent through the connnection. More... | |
IlsBoolean | setDecoder (IlsMsgDecoder) |
Declares the function encoding to be applied on any message received through the connnection. More... | |
IlsMsgEncoder | getEncoder () const |
Returns the encoding function set through a call to the function setEncoder() or 0 by default. | |
IlsMsgDecoder | getDecoder () const |
Returns the decoding function set through a call to the function setDecoder() or 0 by default. | |
void | loadViewSpec (const IlsString &fileOrString, IlsBoolean isString, IlsBoolean useXmlParser, IlsBoolean isSync) |
Loads a dynamic view-type specification to the server. More... | |
IlsBoolean | execAsyncObjectCallback (const IlsMvRef &ref, const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, IlsBoolean inTrans=IlsTrue, IlsBoolean freeArgs=IlsFalse) |
Executes an asynchronous call to the function funNm on the object identified by the reference ref. More... | |
IlsBoolean | execSyncObjectCallback (const IlsMvRef &ref, const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, IlsMvValue &result, IlsBoolean freeArgs=IlsFalse) |
This callback executes a synchronous call to the callback function funNm on the object identified by the reference ref. More... | |
IlsBoolean | execDuplexObjectCallback (const IlsMvRef &ref, const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, const IlsString &duplexFunNm, IlsMvValue *duplexArgs=0, IlsCbArgNb duplexNbArgs=0, IlsCbArgNb resultIndex=0, IlsBoolean inTrans=IlsTrue, IlsBoolean freeArgs=IlsFalse) |
Executes an asynchronous call to the function funNm on the "remote" object identified by the reference ref. More... | |
IlsBoolean | execAsyncGlobalCallback (const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, IlsBoolean inTrans=IlsTrue, IlsBoolean freeArgs=IlsFalse) |
This callback executes an asynchronous call to the global function funNm. More... | |
IlsBoolean | execSyncGlobalCallback (const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, IlsMvValue &result, IlsBoolean freeArgs=IlsFalse) |
This callback executes a synchronous call to the global function funNm. More... | |
IlsBoolean | execDuplexGlobalCallback (const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, const IlsString &duplexFunNm, IlsMvValue *duplexArgs=0, IlsCbArgNb duplexNbArgs=0, IlsCbArgNb resultIndex=0, IlsBoolean inTrans=IlsTrue, IlsBoolean freeArgs=IlsFalse) |
This callback executes an asynchronous call to the global function funNm . More... | |
IlsBoolean | disconnect () |
Closes the connection between the local end point and its peer end point, and then calls the function onDisconnect. More... | |
virtual void | onConnect () |
Called when the connection between the component and the server is established. More... | |
virtual IlsConnectionStatus | testConnection (IlsTime *timeout=0) |
Can be used from server to component or from component to server to test the underlying connection between two processes. More... | |
virtual void | addConnectionListener (ConnectionListener *) |
Add a connection listener. | |
virtual void | removeConnectionListener (ConnectionListener *) |
Remove a connection listener. | |
IlsThread * | startSendThread () |
Starts a thread in charge of sending the message to the peer end point. More... | |
IlsThread * | threadSending () |
Starts a thread that sends all notification updates and other messages generated by the server to the component. More... | |
IlsBoolean | stopSendThread (IlsBoolean flush) |
Stops the thread used to send messages. More... | |
IlsBoolean | isSendingThread () |
Returns IlsTrue if a special thread is started to send notification updates and other messages generated by the server to the component. More... | |
void | monitorSendingQueue (IlsBoolean b) |
Allows you to monitor the sending queue. More... | |
unsigned int | getPendingOutput () |
Returns the number of output messages stored in the sending queue associated with this component, if any. More... | |
void | trace (int=TRACE_TRANS) |
Selects the type of traces at one of the end points of a view server-to-component connection. More... | |
IlsBoolean | isTraced (int=TRACE_TRANS) |
Tests the type of traces at one of the end points of a view server-to-component connection. More... | |
int | getTraceType () const |
Returns the type of traces currently selected. | |
Static Public 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. More... | |
Static Public Member Functions inherited from IlsMvEndPoint | |
static IlsMvEndPoint * | GetInteractor () |
Returns the current interacting component. More... | |
static void | SetMT (IlsBoolean isMT) |
Call this static member function with the isMT parameter set to IlsTrue if you want to use the component API or the component interface API in a multithread context. | |
static void | Trace (int=TRACE_TRANS) |
Selects the default type of traces selected. More... | |
static IlsBoolean | IsTraced (int=TRACE_TRANS) |
Tests the default type of traces selected. More... | |
static int | GetTraceType () |
Returns the default type of traces. | |
Friends | |
class | IlsMvServer |
class | IlsMvView |
Additional Inherited Members | |
Public Types inherited from IlsMvEndPoint | |
enum | TraceType { NO_TRACE, TRACE_TRANS, TRACE_MSG , TRACE_TAG_ERR, TRACE_TAG_PRINT } |
Specifies the type of trace attached to interactions between an object server and its components. See the trace functions of the class IlsMvEndPoint for more information. More... | |
This class implements the interface of a component that interacts with a dynamic view server.
Library: mvserver
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. By default, IlsMvComponentItf instances are created by the factory class IlsMvEndPointFactory
.
For details, see the member functions IlsMvServer::OpenView()
, IlsMvServer::GetInteractor()
, and IlsMvView::getComponent()
.
IlsMvServer
, IlsMvUser
, IlsMvView
, IlsRepresentation
.
|
virtual |
Closes the views associated with the component.
notify | IlsFalse to close without notification. IlsTrue will close the view during the next notification cycle. |
IlsMvComponentItf& IlsMvComponentItf::closeAllViews | ( | IlsBoolean | notify = IlsTrue | ) |
Closes all the views associated with the component.
It calls the function IlsMvView::close()
on each view with the Boolean parameter notify as its argument. If 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.
notify | IlsFalse to close without notification. IlsTrue will close the view during the next notification cycle. |
IlsMvComponentId IlsMvComponentItf::getId | ( | ) |
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()
.
IlsSmartViewed IlsMvComponentItf::getSvObject | ( | const IlsMvRef & | ref | ) |
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).
ref | reference object |
IlsMvUser* IlsMvComponentItf::getUser | ( | ) |
Returns a pointer to the user associated with the component interface.
It returns a null pointer if the interface is being destroyed.
IlsMvView* IlsMvComponentItf::getView | ( | IlsRepresentationId | id | ) |
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.
id | representation identifier |
null
otherwise.
|
static |
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.
|
virtual |
Called when all the views associated with the component are closed.
It can be overridden.
|
virtual |
Called when the connection between the component and the server is destroyed.
This function has an empty implementation. It is overridden in the subclasses IlsMvComponent
and IlsMvComponentItf
.
Reimplemented from IlsMvEndPoint.
|
virtual |
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.
IlsFalse
if there is no connection. Reimplemented from IlsMvEndPoint.
|
virtual |
Call this virtual member function instead of the destructor if you want to delete an instance of IlsMvEndPoint
.
This function:
Reimplemented from IlsMvEndPoint.