RateMeasure.h
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:1k
源码类别:

P2P编程

开发平台:

Visual C++

  1. // RateMeasure.h: interface for the CRateMeasure class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_RATEMEASURE_H__3C7C455F_79AD_4619_A855_E98B33F63D60__INCLUDED_)
  5. #define AFX_RATEMEASURE_H__3C7C455F_79AD_4619_A855_E98B33F63D60__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class CStorageWrapper;
  10. class CRateMeasure  
  11. {
  12. public:
  13. CRateMeasure(BLONG lAmountLeft, CStorageWrapper* pStorageWrapper);
  14. virtual ~CRateMeasure();
  15. void update(long ltime, long lAmount);
  16. BLONG get_size_left();
  17. long get_time_left();
  18. void data_rejected(long lAmount);
  19. void data_came_in(long lAmount);
  20. long m_lStart;
  21. long m_lLast;
  22. float m_fRate;
  23. long m_lRemaining;
  24. BLONG m_lLeft;
  25. bool m_bBroke;
  26. bool m_bGotAnything;
  27. CStorageWrapper* m_pStorageWrapper;
  28. };
  29. void RateMeasureTest();
  30. #endif // !defined(AFX_RATEMEASURE_H__3C7C455F_79AD_4619_A855_E98B33F63D60__INCLUDED_)