From: Maxim Mamontov Date: Thu, 7 Apr 2011 13:34:34 +0000 (+0300) Subject: Add subscription for 'connected' property X-Git-Tag: 2.407-rc3~60 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/b50165cd491723d34aea2d05a41e78a29edd14a9 Add subscription for 'connected' property --- diff --git a/include/user.h b/include/user.h index 90ce626d..adf140de 100644 --- a/include/user.h +++ b/include/user.h @@ -49,6 +49,12 @@ public: virtual void AddCurrIPAfterNotifier(PROPERTY_NOTIFIER_BASE * notifier) = 0; virtual void DelCurrIPAfterNotifier(PROPERTY_NOTIFIER_BASE * notifier) = 0; + virtual void AddConnectedBeforeNotifier(PROPERTY_NOTIFIER_BASE * notifier) = 0; + virtual void DelConnectedBeforeNotifier(PROPERTY_NOTIFIER_BASE * notifier) = 0; + + virtual void AddConnectedAfterNotifier(PROPERTY_NOTIFIER_BASE * notifier) = 0; + virtual void DelConnectedAfterNotifier(PROPERTY_NOTIFIER_BASE * notifier) = 0; + virtual int GetID() const = 0; virtual double GetPassiveTimePart() const = 0; diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index e1bb4bae..d720ffe5 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -908,6 +908,30 @@ STG_LOCKER lock(&mutex, __FILE__, __LINE__); currIP.DelAfterNotifier(n); } //----------------------------------------------------------------------------- +void USER_IMPL::AddConnectedBeforeNotifier(PROPERTY_NOTIFIER_BASE * n) +{ +STG_LOCKER lock(&mutex, __FILE__, __LINE__); +connected.AddBeforeNotifier(n); +} +//----------------------------------------------------------------------------- +void USER_IMPL::DelConnectedBeforeNotifier(PROPERTY_NOTIFIER_BASE * n) +{ +STG_LOCKER lock(&mutex, __FILE__, __LINE__); +connected.DelBeforeNotifier(n); +} +//----------------------------------------------------------------------------- +void USER_IMPL::AddConnectedAfterNotifier(PROPERTY_NOTIFIER_BASE * n) +{ +STG_LOCKER lock(&mutex, __FILE__, __LINE__); +connected.AddAfterNotifier(n); +} +//----------------------------------------------------------------------------- +void USER_IMPL::DelConnectedAfterNotifier(PROPERTY_NOTIFIER_BASE * n) +{ +STG_LOCKER lock(&mutex, __FILE__, __LINE__); +connected.DelAfterNotifier(n); +} +//----------------------------------------------------------------------------- void USER_IMPL::OnAdd() { STG_LOCKER lock(&mutex, __FILE__, __LINE__); diff --git a/projects/stargazer/user_impl.h b/projects/stargazer/user_impl.h index 5b473627..e9c9f986 100644 --- a/projects/stargazer/user_impl.h +++ b/projects/stargazer/user_impl.h @@ -129,6 +129,12 @@ public: void AddCurrIPAfterNotifier(PROPERTY_NOTIFIER_BASE *); void DelCurrIPAfterNotifier(PROPERTY_NOTIFIER_BASE *); + void AddConnectedBeforeNotifier(PROPERTY_NOTIFIER_BASE *); + void DelConnectedBeforeNotifier(PROPERTY_NOTIFIER_BASE *); + + void AddConnectedAfterNotifier(PROPERTY_NOTIFIER_BASE *); + void DelConnectedAfterNotifier(PROPERTY_NOTIFIER_BASE *); + int GetID() const { return id; } double GetPassiveTimePart() const;