-struct PACKET_EXTRA_DATA {
-PACKET_EXTRA_DATA()
- : flushTime(0),
- updateTime(0),
- userU(NULL),
- userUPresent(false),
- userD(NULL),
- userDPresent(false),
- dirU(DIR_NUM),
- dirD(DIR_NUM),
- lenU(0),
- lenD(0)
-{}
-
-PACKET_EXTRA_DATA(const PACKET_EXTRA_DATA & pp)
- : flushTime(pp.flushTime),
- updateTime(pp.updateTime),
- userU(pp.userU),
- userUPresent(pp.userUPresent),
- userD(pp.userD),
- userDPresent(pp.userDPresent),
- dirU(pp.dirU),
- dirD(pp.dirD),
- lenU(pp.lenU),
- lenD(pp.lenD)
-{}
-
-time_t flushTime; // Last flush time
-time_t updateTime; // Last update time
-USER_IMPL * userU; // Uploader
-bool userUPresent; // Uploader is registered user
-USER_IMPL * userD; // Downloader
-bool userDPresent; // Downloader is registered user
-int dirU; // Upload direction
-int dirD; // Download direction
-uint32_t lenU; // Upload length
-uint32_t lenD; // Download length
-};
-//-----------------------------------------------------------------------------
-class TRAFFCOUNTER_IMPL;
-//-----------------------------------------------------------------------------
-class TRF_IP_BEFORE: public PROPERTY_NOTIFIER_BASE<uint32_t> {
-public:
- TRF_IP_BEFORE(TRAFFCOUNTER_IMPL & t, USER_IMPL * u)
- : PROPERTY_NOTIFIER_BASE<uint32_t>(),
- traffCnt(t),
- user(u)
- {}
- void Notify(const uint32_t & oldValue, const uint32_t & newValue);
- void SetUser(USER_IMPL * u) { user = u; }
- USER_IMPL * GetUser() const { return user; }
-
-private:
- TRAFFCOUNTER_IMPL & traffCnt;
- USER_IMPL * user;
-};
-//-----------------------------------------------------------------------------
-class TRF_IP_AFTER: public PROPERTY_NOTIFIER_BASE<uint32_t> {
-public:
- TRF_IP_AFTER(TRAFFCOUNTER_IMPL & t, USER_IMPL * u)
- : PROPERTY_NOTIFIER_BASE<uint32_t>(),
- traffCnt(t),
- user(u)
- {}
- void Notify(const uint32_t & oldValue, const uint32_t & newValue);
- void SetUser(USER_IMPL * u) { user = u; }
- USER_IMPL * GetUser() const { return user; }
-private:
- TRAFFCOUNTER_IMPL & traffCnt;
- USER_IMPL * user;
-};
-//-----------------------------------------------------------------------------
-class ADD_USER_NONIFIER: public NOTIFIER_BASE<USER_IMPL_PTR> {
-public:
- ADD_USER_NONIFIER(TRAFFCOUNTER_IMPL & t) :
- NOTIFIER_BASE<USER_IMPL_PTR>(),
- traffCnt(t)
- {}
- virtual ~ADD_USER_NONIFIER() {}
- void Notify(const USER_IMPL_PTR & user);
-private:
- TRAFFCOUNTER_IMPL & traffCnt;
-};
-//-----------------------------------------------------------------------------
-class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_IMPL_PTR> {
-public:
- DEL_USER_NONIFIER(TRAFFCOUNTER_IMPL & t) :
- NOTIFIER_BASE<USER_IMPL_PTR>(),
- traffCnt(t)
- {}
- virtual ~DEL_USER_NONIFIER() {}
- void Notify(const USER_IMPL_PTR & user);
-private:
- TRAFFCOUNTER_IMPL & traffCnt;
+struct PacketExtraData {
+ PacketExtraData()
+ : flushTime(0),
+ updateTime(0),
+ userU(NULL),
+ userUPresent(false),
+ userD(NULL),
+ userDPresent(false),
+ dirU(DIR_NUM),
+ dirD(DIR_NUM),
+ lenU(0),
+ lenD(0)
+ {}
+
+ time_t flushTime; // Last flush time
+ time_t updateTime; // Last update time
+ UserImpl * userU; // Uploader
+ bool userUPresent; // Uploader is registered user
+ UserImpl * userD; // Downloader
+ bool userDPresent; // Downloader is registered user
+ int dirU; // Upload direction
+ int dirD; // Download direction
+ uint32_t lenU; // Upload length
+ uint32_t lenD; // Download length