00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GZ_DIST_NOTIFICATION_H__
00022 #define __GZ_DIST_NOTIFICATION_H__
00023
00028
00029 #include "gzDistBase.h"
00030
00031
00032
00033
00034 GZ_DIST_DECLARE_MEMBASE_EXPORT(gzDistNotificationData, GZ_DIST_EXPORT);
00035
00037
00040 class gzDistNotificationData : public gzDistThreadSafeReference GZ_DIST_MEMBASE(gzDistNotificationData)
00041 {
00042 friend class gzDistSession;
00043
00044 public:
00045
00046 GZ_DIST_MEMBASE_IMP(gzDistNotificationData);
00047
00048 GZ_DIST_MEMBASE_CALL(gzDistNotificationData);
00049
00051 GZ_DIST_EXPORT gzDistNotificationData(const gzString& name, const gzDynamicType& data);
00052
00054 GZ_DIST_EXPORT gzDistNotificationData(const class gzDistAttribute* attribute);
00055
00057 GZ_DIST_EXPORT virtual ~gzDistNotificationData();
00058
00059
00061 GZ_DIST_EXPORT const gzString& getAttributeName() const;
00062
00064 GZ_DIST_EXPORT const gzDynamicType& getAttributeValue() const;
00065
00067 GZ_DIST_EXPORT const gzString& getAttributeType() const;
00068
00070 GZ_DIST_EXPORT gzDouble getAttributeNumber() const;
00071
00073 GZ_DIST_EXPORT gzString getAttributeString() const;
00074
00076 GZ_DIST_EXPORT gzGUID getAttributeGuid() const;
00077
00078 private:
00079
00080
00081 const gzString m_attributeName;
00082
00083
00084 const gzDynamicType m_attributeValue;
00085 };
00086
00087
00088
00090
00093 class gzDistNotificationSet
00094 {
00095 friend class gzDistNotificationSetIterator;
00096 friend class gzDistSession;
00097 friend class gzDistClientInterface;
00098
00099 public:
00100 GZ_DIST_EXPORT gzDistNotificationSet();
00101
00102 GZ_DIST_EXPORT ~gzDistNotificationSet();
00103
00105 GZ_DIST_EXPORT gzULong entries() const;
00106
00110 GZ_DIST_EXPORT gzDistNotificationData* find(const gzString& attributeName) const;
00111
00116 GZ_DIST_EXPORT gzBool getAttributeNumber(const gzString& attributeName, gzDouble& number) const;
00117
00122 GZ_DIST_EXPORT gzBool getAttributeString(const gzString& attributeName, gzString& string) const;
00123
00128 GZ_DIST_EXPORT gzBool getAttributeValue(const gzString& attributeName, gzDynamicType& value) const;
00129
00130 private:
00131
00132 gzVoid insert(gzDistNotificationData* data);
00133 gzDistNotificationData* first() const;
00134
00135 gzRefList<gzDistNotificationData> m_data;
00136 };
00137
00138
00140 class gzDistNotificationSetIterator
00141 {
00142 public:
00144
00145 GZ_DIST_EXPORT gzDistNotificationSetIterator(const gzDistNotificationSet& list);
00146
00148 GZ_DIST_EXPORT ~gzDistNotificationSetIterator();
00149
00151
00153 GZ_DIST_EXPORT gzDistNotificationData* operator()();
00154
00156
00157 GZ_DIST_EXPORT gzDistNotificationData* current() const;
00158
00159 private:
00160
00161 gzListConstIterator<gzDistNotificationData> m_iterator;
00162 };
00163
00164
00165
00166
00167 enum gzDistNotificationType
00168 {
00169 GZ_DIST_NOTIFICATION_TYPE_UNDEFINED = 0,
00170 GZ_DIST_NOTIFICATION_TYPE_EVENT,
00171 GZ_DIST_NOTIFICATION_TYPE_NEW_OBJECT,
00172 GZ_DIST_NOTIFICATION_TYPE_REMOVE_OBJECT,
00173 GZ_DIST_NOTIFICATION_TYPE_UPDATE_OBJECT,
00174 GZ_DIST_NOTIFICATION_TYPE_NEW_ATTRIBUTES,
00175 GZ_DIST_NOTIFICATION_TYPE_REMOVE_ATTRIBUTES,
00176 GZ_DIST_NOTIFICATION_TYPE_REQUEST_OWNERSHIP,
00177 GZ_DIST_NOTIFICATION_TYPE_GRANT_OWNERSHIP,
00178 GZ_DIST_NOTIFICATION_TYPE_DROP_OWNERSHIP,
00179 GZ_DIST_NOTIFICATION_TYPE_NEW_SESSION,
00180 GZ_DIST_NOTIFICATION_TYPE_REMOVE_SESSION,
00181 GZ_DIST_NOTIFICATION_TYPE_UNINITIALIZE_CLIENT,
00182 GZ_DIST_NOTIFICATION_TYPE_DEBUG,
00183 GZ_DIST_NOTIFICATION_TYPE_INVOKE
00184 };
00185
00186 GZ_DIST_DECLARE_MEMBASE(gzDistNotification);
00187
00188
00189 class gzDistNotification : public gzDistThreadSafeReference GZ_DIST_MEMBASE(gzDistNotification)
00190 {
00191 public:
00192 GZ_DIST_MEMBASE_IMP(gzDistNotification);
00193
00194 GZ_DIST_MEMBASE_CALL(gzDistNotification);
00195
00196
00197 gzDistNotification();
00198
00199
00200 gzDistNotification(gzDistNotificationType type, gzDistThreadSafeReference* reference);
00201
00202
00203 virtual ~gzDistNotification();
00204
00205
00206 gzVoid setClientID(const gzDistClientID& clientId);
00207
00208
00209 gzDistClientID* getClientID() const;
00210
00211
00212 gzVoid setObject(gzDistObject* object);
00213
00214
00215 gzDistObject* getObject() const;
00216
00217
00218 gzVoid setSession(gzDistSession* session);
00219
00220
00221 gzDistSession* getSession() const;
00222
00223
00224 gzVoid setEvent(gzDistEvent* event);
00225
00226
00227 gzDistEvent* getEvent() const;
00228
00229
00230 gzVoid setNotificationType(gzDistNotificationType type);
00231
00232
00233 gzDistNotificationType getNotificationType() const;
00234
00235
00236 gzDistNotificationSet* m_notification_data;
00237
00238
00239 gzVoid setHighPrio();
00240
00241
00242 gzBool isHighPrio();
00243
00244
00245 gzDistThreadSafeReference* getInvokeData() const;
00246
00247 private:
00248
00249
00250 gzDistNotificationType m_type;
00251
00252
00253 gzRefPointer<gzDistThreadSafeReference> m_reference;
00254
00255
00256 gzRefPointer<gzDistThreadSafeReference> m_addReference;
00257
00258
00259 gzDistClientID* m_clientID;
00260
00261
00262 gzBool m_highPrio;
00263 };
00264
00265 #endif