GlobalObjects
|
In order to be informed about changes and states in the object database, an extensive notification system is available in GlobalObjects. Among other things, this can be used to ensure the consistency of individual objects for several instances in multi-user operation.
You can monitor individual objects, groups of objects in containers and entire AllSets and be notified of changes. It is possible to monitor operations in the object database that take longer and to be notified about the progress. Additionally it is possible to watch the opening or closing of an object database of other clients.
To observe an object, derived from glo::CallBack, must be passed to the respective observation method. In order for the notification to be processed, the virtual method glo::CallBack::notify(glo::NotifyNote & rNote) for the evaluation of the glo::NotifyNote must be overwritten.
In principle, the observing instance that has triggered the change or the event itself is also notified.
A single object can be assigned to the object database for watching in a variety of ways. This can be initiated via glo::Persistent::setWatch (...), glo::TOndemand::setWatch (...) or glo::Base::setWatchObject (...).
Another possibility is to use a glo::TPointerList, a glo::TPointerSet, a glo::TOndemandList or a glo::TOndemandSet. A watching can be set in these containers. Each object that is inserted into the containers is automatically observed with the watching mode of the container, or the watching is stopped when the object is removed from the container.
A group of persistent objects can be observed by passing a subclass of glo::BaseSet to method glo::Base::setWatchLot (...) or by directly calling glo::BaseLot::setWatch(glo::TdWatchNotifyMode, glo::EnDeepMode, glo::CallBack*) respectively glo::BaseLot::setWatch(const glo::WatchSpecification&) (glo::BaseLot is the superclass of glo::TOndemandList, glo::TOndemandSet, glo::TPointerList and glo::TPointerSet).
The notification of the type glo::NotifyNote transports the following information:
glo::NotifNote attribute | Content |
---|---|
glo::NotifyNote::m_ulNotifyMode | The glo::TdWatchNotifyMode tells, which action(s) have been performed. Possible values are:
|
glo::NotifyNote::m_ipCallBack | Is usually the address of the glo::CallBack object. Is used to call its method glo::CallBack::notify (...) with the glo::NotifyNote. |
glo::NotifyNote::m_nSocket | Contains no information. |
glo::NotifyNote::m_uiCommunicatorID | The unique Communicator ID of the Notify trigger (the own Communicator ID can be determined via glo::Base::getCommunicatorID()). |
glo::NotifyNote::m_strClientName | The name of the triggering client. |
glo::NotifyNote::m_ObjID | The glo::ObjID of the object on which the action glo::NotifyNote::m_ulNotifyMode was executed. |
glo::NotifyNote::m_uiInfo | Contains no information. |
glo::NotifyNote::m_uiInfo2 | Contains no information. |
glo::NotifyNote::m_strInfo | Contains no information. |
glo::NotifyNote::m_strInfo2 | Contains no information. |
In a glo::TAllSet (all persistent objects of one type in the object database) the objects can be watched in a limited way only flat (no glo::EnDeepMode is passed). In addition, however, there is the possibility that the calling instance can be notified when a new object is saved, i.e. inserted into the glo::TAllSet. This can be initiated either via glo::TAllSet::setWatch(glo::TdWatchNotifyMode, glo::CallBack*) or glo::Base::setWatchClass (...).
The notification of the type glo::NotifyNote transports the following information:
glo::NotifNote attribute | Content |
---|---|
glo::NotifyNote::m_ulNotifyMode | The glo::TdWatchNotifyMode tells, which action(s) have been performed. Mögliche Werte sind:
|
glo::NotifyNote::m_ipCallBack | Is usually the address of the glo::CallBack object. Is used to call its method glo::CallBack::notify (...) with the glo::NotifyNote. |
glo::NotifyNote::m_nSocket | Contains no information. |
glo::NotifyNote::m_uiCommunicatorID | The unique Communicator ID of the Notify trigger (the own Communicator ID can be determined via glo::Base::getCommunicatorID()). |
glo::NotifyNote::m_strClientName | The name of the triggering client. |
glo::NotifyNote::m_ObjID | The glo::ObjID of the object on which the action glo::NotifyNote::m_ulNotifyMode was executed. |
glo::NotifyNote::m_uiInfo | Contains no information. |
glo::NotifyNote::m_uiInfo2 | Contains no information. |
glo::NotifyNote::m_strInfo | Contains no information. |
glo::NotifyNote::m_strInfo2 | Contains no information. |
If one is connected to a GloServer, its can be observe which clients connect to this GloServer. This is initiated via the method glo::Base::setWatchClient (...) with the parameters glo::WNM_CLIENT_CONNECTSERVER or glo::WNM_CLIENT_DISCONNECTSERVER.
The notification of the type glo::NotifyNote transports the following information:
glo::NotifNote attribute | Content |
---|---|
glo::NotifyNote::m_ulNotifyMode | The glo::TdWatchNotifyMode tells, which action(s) have been performed. Possible values are:
|
glo::NotifyNote::m_ipCallBack | Is usually the address of the glo::CallBack object. Is used to call its method glo::CallBack::notify (...) with the glo::NotifyNote. |
glo::NotifyNote::m_nSocket | The SOCKET of the triggering client. |
glo::NotifyNote::m_uiCommunicatorID | Is 0, because it is only assigned when an object database is opened. |
glo::NotifyNote::m_strClientName | Contains no information because the client name is only assigned when an object database is opened. |
glo::NotifyNote::m_ObjID | Contains no information. |
glo::NotifyNote::m_uiInfo | Contains no information. |
glo::NotifyNote::m_uiInfo2 | Contains no information. |
glo::NotifyNote::m_strInfo | Contains no information. |
glo::NotifyNote::m_strInfo2 | The IP address (possibly resolved into a name) of the triggering client. |
If one is connected to a GloServer, its can be observe which clients open and close which object database. This is initiated via the method glo::Base::setWatchClient (...) with the parameters glo::WNM_CLIENT_OPENBASE or glo::WNM_CLIENT_CLOSEBASE.
The notification of the type glo::NotifyNote transports the following information:
glo::NotifNote attribute | Content |
---|---|
glo::NotifyNote::m_ulNotifyMode | The glo::TdWatchNotifyMode tells, which action(s) have been performed. Possible values are:
|
glo::NotifyNote::m_ipCallBack | Is usually the address of the glo::CallBack object. Is used to call its method glo::CallBack::notify (...) with the glo::NotifyNote. |
glo::NotifyNote::m_nSocket | The SOCKET of the triggering client. |
glo::NotifyNote::m_uiCommunicatorID | The unique Communicator ID of the Notify trigger (the own Communicator ID can be determined via glo::Base::getCommunicatorID()). |
glo::NotifyNote::m_strClientName | The name of the triggering client. |
glo::NotifyNote::m_ObjID | Contains no information. |
glo::NotifyNote::m_uiInfo | Contains no information. |
glo::NotifyNote::m_uiInfo2 | Contains no information. |
glo::NotifyNote::m_strInfo | Name of the open/closed object database. |
glo::NotifyNote::m_strInfo2 | The IP address (possibly resolved into a name) of the triggering client. |
Reading and writing the indexes may take a little longer. If an object database is opened, the index is read (if not already done). So that the user does not get the feeling that the application is "frozen", the application can be informed about the progress of the read-in and display this to the user.
In order to be informed about the progress of the import, you only have to pass a corresponding glo::CallBack object to the calls of glo::Base::open (...) and glo::Base::close (...), or glo::Base::openBase (...) and glo::Base::closeBase (...), which handles the processing of the progress notifications.
The notification of the type glo::NotifyNote transports the following information:
glo::NotifNote attribute | Content |
---|---|
glo::NotifyNote::m_ulNotifyMode | The glo::TdWatchNotifyMode tells, which action(s) have been performed. Possible values are:
|
glo::NotifyNote::m_ipCallBack | Is usually the address of the glo::CallBack object. Is used to call its method glo::CallBack::notify (...) with the glo::NotifyNote. |
glo::NotifyNote::m_nSocket | Contains no information. |
glo::NotifyNote::m_uiCommunicatorID | The unique Communicator ID of the Notify trigger (the own Communicator ID can be determined via glo::Base::getCommunicatorID()). |
glo::NotifyNote::m_strClientName | The name of the triggering client. |
glo::NotifyNote::m_ObjID | The index of the class ID in the glo::ObjID is currently read or written. All changes of this value result in the number of actions from glo::NotifyNote::m_uiInfo2. |
glo::NotifyNote::m_uiInfo | The percentage of the current index already read or written. |
glo::NotifyNote::m_uiInfo2 | Number of indexes that are read or written. |
glo::NotifyNote::m_strInfo | Name of the read or written current index. |
glo::NotifyNote::m_strInfo2 | Contains no information. |
If one is connected to an object database, the indexes can be reindexed, e.g. if they are 'corrupt'. This process can take longer, depending on the number of objects. The progress can also be displayed here. To do this, the methods glo::Base::reindexBase(const std::string&, glo::CallBack* ) or glo::Base::reindexBase(glo::CallBack*) only need to be passed a corresponding glo::CallBack object which handles the processing of the progress notifications.
If one is connected to an object database, the tables can be compressed, the entries of the deleted objects are removed from the tables. Since there is also an index of deleted objects in addition to the index of existing objects, the latter index can be disposed of when the deleted entries in the tables are removed. This process can take longer, depending on the number of objects. The progress can also be displayed here. To do this, the methods glo::Base::compressBase(const std::string&, glo::CallBack*) or glo::Base::compressBase(glo::CallBack*) only need to be passed a corresponding glo::CallBack object, which handles the processing of the progress notifications.
The notification of the type glo::NotifyNote transports the following information:
glo::NotifNote attribute | Content |
---|---|
glo::NotifyNote::m_ulNotifyMode | The glo::TdWatchNotifyMode tells, which action(s) have been performed. Possible values are:
|
glo::NotifyNote::m_ipCallBack | Ist in der Regel die Adresse des glo::CallBack-Objekts. Wird genutzt um dessen Methode glo::CallBack::notify (...) mit der glo::NotifyNote aufzurufen. |
glo::NotifyNote::m_nSocket | Contains no information. |
glo::NotifyNote::m_uiCommunicatorID | The unique Communicator ID of the Notify trigger (the own Communicator ID can be determined via glo::Base::getCommunicatorID()). |
glo::NotifyNote::m_strClientName | The name of the triggering client. |
glo::NotifyNote::m_ObjID | The class ID in the glo::ObjID whose table is currently being processed All changes of this value result in the number of actions from glo::NotifyNote::m_uiInfo2. |
glo::NotifyNote::m_uiInfo | The percentage of actions completed. |
glo::NotifyNote::m_uiInfo2 | Number of actions. |
glo::NotifyNote::m_strInfo | The name of the table which is currently being processed. |
glo::NotifyNote::m_strInfo2 | Contains no information. |
If one is connected to a GloServer, a notification can be initiated if there is a disconnection to the GloServer. This is initiated by the method glo::Base::connect (…), glo::Base::reconnect (…) or glo::Base::setWatchServer (…).
The notification of the type glo::NotifyNote transports the following information:
glo::NotifNote attribute | Content |
---|---|
glo::NotifyNote::m_ulNotifyMode | The glo::TdWatchNotifyMode tells, which action(s) have been performed. Possible values are:
|
glo::NotifyNote::m_ipCallBack | Is usually the address of the glo::CallBack object. Is used to call its method glo::CallBack::notify (...) with the glo::NotifyNote. |
glo::NotifyNote::m_nSocket | Contains no information. |
glo::NotifyNote::m_uiCommunicatorID | Contains no information (the own CommunicatorID is lost due to the termination). |
glo::NotifyNote::m_strClientName | Contains no information, there is no triggering client. |
glo::NotifyNote::m_ObjID | Contains no information. |
glo::NotifyNote::m_uiInfo | Contains no information. |
glo::NotifyNote::m_uiInfo2 | The port number of the GloServer to which the connection was broken. |
glo::NotifyNote::m_strInfo | Contains no information. |
glo::NotifyNote::m_strInfo2 | The IP address (possibly resolved into a name) of the GloServer to which the connection was broken. |