Server
API Reference Guide
Product Documentation:

Visualization Server
Documentation Home
List of all members | Public Member Functions | Protected Member Functions | Friends
IlsViewed Class Referenceabstract

This class is the parent class of IlsEntity and IlsObject and, as such, the base class for any type of server object. More...

#include <ilserver/viewed.h>

Inheritance diagram for IlsViewed:
IlsRefCounted

Public Member Functions

virtual ~IlsViewed ()
 This is the virtual destructor of the class.
 
IlsBoolean forceModify ()
 This member function lets you designate an object as "modified", even if the relations in which it is involved or its entries or derived members have not been updated.
 
virtual IlsBoolean remove ()=0
 This pure virtual member function is used by a dynamic view server to remove a Server object. More...
 
Subscribing to an Object

The first three functions below are supplied to maintain upward compatibility. They provide general information about the state of an object that a regular view subscribes to (as opposed to a multithreaded view). For efficiency reasons, multithreaded views do not update the information returned by these functions. However, you can still get this information by overriding the virtual functions onSubscribe() and onUnsubscribe().

IlsBoolean isViewOrigin ()
 This member function is a predicate that returns IlsTrue if the object is the origin of at least one regular view.
 
virtual void onSubscribe (IlsView &, IlsBoolean)
 This empty virtual member function is called each time a view subscribes to the relation.
 
virtual void onUnsubscribe (IlsView &, IlsBoolean)
 This virtual member function is called each time a view cancels a subscription to the relation.
 
Dynamic Views
virtual IlsBoolean beginEdition (IlsMvView &, IlsRpUpdateType)
 This virtual member function (or the overriding one) is called on each Server object that is directly involved in a transaction triggered by a component on a dynamic view server (see IlsMvComponent::commitC2SCTransaction()). More...
 
virtual IlsBoolean endEdition (IlsMvView &, IlsRpUpdateType, IlsBoolean isRollback)
 This virtual member function (or the overriding one) is called on each server object that is directly involved in a transaction triggered by a component on a dynamic view server (see IlsMvComponent::commitC2SCTransaction()). More...
 
virtual IlsBoolean acceptView (IlsMvUser *, const char *viewType)
 By overriding this virtual member function, you can control how a dynamic view is opened by a user. More...
 
virtual IlsTypeId getTypeId ()
 This virtual member function returns the identifier that Rogue Wave Server associates with the actual type of the object. More...
 
virtual IlsString getKeyIdentifier () const
 This virtual member function is used in subclasses of IlsViewed (see the IlsDynObject class). By default, it returns a null string.
 
- Public Member Functions inherited from IlsRefCounted
 IlsRefCounted ()
 This is the default constructor of the class.
 
 IlsRefCounted (const IlsRefCounted &)
 This is the copy constructor of IlsRefCounted. More...
 
virtual ~IlsRefCounted ()
 This is the virtual destructor for IlsRefCounted.
 
IlsRefCount getRefCount ()
 This member function returns the reference counter of an object.
 
IlsRefCountedoperator= (const IlsRefCounted &)
 This is the assignment operator of IlsRefcounted.
 
IlsRefCount refcountDecr ()
 This member function decrements the reference counter. More...
 
void refcountIncr ()
 This member function increments the reference counter. More...
 

Protected Member Functions

 IlsViewed ()
 This is the protected constructor of the class.
 

Friends

class IlsModel
 

Additional Inherited Members

- Static Public Member Functions inherited from IlsRefCounted
static void SetMT ()
 This static member function activates the multithread-safe facility. More...
 

Detailed Description

This class is the parent class of IlsEntity and IlsObject and, as such, the base class for any type of server object.

Library: server

This class is used as an argument to many functions of the class IlsMvView.

See also
IlsEntity, ILS_ENTITY_DECL(), IlsMvComponent, IlsMvServer, IlsMvView, IlsMsgEncoder, IlsObject, ILS_OBJECT_DECL().

Member Function Documentation

◆ acceptView()

virtual IlsBoolean IlsViewed::acceptView ( IlsMvUser ,
const char *  viewType 
)
virtual

By overriding this virtual member function, you can control how a dynamic view is opened by a user.

It is executed when:

  • A request to retrieve the list of Server objects is received (see IlsMvComponent::getObjectIds()). The member function is called for each one of the objects registered with the server whose label matches the pattern specified by the component. In this case, the viewType argument is null. If the member function returns IlsTrue, the label is included in the list sent to the component.
  • A request to retrieve the list of available dynamic view types is received (see IlsMvComponent::getViewIds()). The member function is called for each dynamic view type whose name matches the pattern specified by the component. If the member function returns IlsTrue, the view type name is included in the list returned by the component.
  • A request to open an instance of viewType is received (see the functions IlsMvComponent::openView() and IlsMvServer::OpenView()). Only if the member function returns IlsTrue is the view opened.

◆ beginEdition()

virtual IlsBoolean IlsViewed::beginEdition ( IlsMvView ,
IlsRpUpdateType   
)
virtual

This virtual member function (or the overriding one) is called on each Server object that is directly involved in a transaction triggered by a component on a dynamic view server (see IlsMvComponent::commitC2SCTransaction()).

It is called before these objects are modified. If the function returns IlsFalse, the transaction is rolled back both to the server and to the component.

This function takes two arguments:

  • The first one is a reference to the dynamic view through which the object is modified.
  • The second one indicates the type of modification that is carried out. This function returns IlsTrue but it can be overridden on the derived object types.

Reimplemented in IlsDynObject.

◆ endEdition()

virtual IlsBoolean IlsViewed::endEdition ( IlsMvView ,
IlsRpUpdateType  ,
IlsBoolean  isRollback 
)
virtual

This virtual member function (or the overriding one) is called on each server object that is directly involved in a transaction triggered by a component on a dynamic view server (see IlsMvComponent::commitC2SCTransaction()).

It is called once all the modifications are performed on these objects. If such a call returns IlsFalse, the transaction is rolled back on both the server and the component.

  • The first argument is a reference to the dynamic view through which the object is modified.
  • The second argument indicates the type of modification that is carried out, using the enumerated type IlsRpUpdateEnum. This function returns IlsTrue but it can be overridden on the derived object types.
  • When the value of the parameter isRollback is IlsTrue, this indicates that the current transaction is being rolled back.

Reimplemented in IlsDynObject.

◆ getTypeId()

virtual IlsTypeId IlsViewed::getTypeId ( )
virtual

This virtual member function returns the identifier that Rogue Wave Server associates with the actual type of the object.

It is implicitly overridden in each Server class by the macros ILS_OBJECT_DECL() or ILS_ENTITY_DECL().

◆ remove()

virtual IlsBoolean IlsViewed::remove ( )
pure virtual

This pure virtual member function is used by a dynamic view server to remove a Server object.

This function is overriden in classes IlsObject and IlsEntity. It can also be overriden in user-defined object and entity classes.

  • If the function returns IlsTrue, the dynamic view server carries on with the current transaction.
  • If the function returns IlsFalse, the current transaction is rolled back.

You can learn more about how the dynamic view server manages transactions in Transaction Control on class IlsMvServer.

Implemented in IlsEntity, and IlsObject.