Click here to Skip to main content
15,881,898 members
Articles / Programming Languages / C++

3G Modem Internet Dialer

Rate me:
Please Sign up or sign in to vote.
4.90/5 (88 votes)
13 Jul 2011CPOL7 min read 772.4K   65.9K   192  
3G Modem Internet Dialer
#pragma once
#include <vector>
#include <fstream>


class CHistoryItem
{
public:
	CHistoryItem()
	{
		m_iDownloaded = 0;
		m_iUploaded = 0;
	}

	CHistoryItem(FILETIME ftStart, FILETIME ftEnd, int iDownloaded, int iUploaded)
	{
		m_ftStart = ftStart;
		m_ftEnd = ftEnd;
		m_iDownloaded = iDownloaded;
		m_iUploaded = iUploaded;

	};

	FILETIME m_ftStart;
	FILETIME m_ftEnd;
	int m_iDownloaded;
	int m_iUploaded;
};

class CHistory
{
public:
	static CHistory* Instance();
	static void ShutDown();
	void Add(SYSTEMTIME stStart, SYSTEMTIME stEnd, int iDownloaded, int iUploaded);
	void GetIndexForTimeRange(SYSTEMTIME stStart, SYSTEMTIME stEnd, int &iStartIndex, int &iEndIndex);
	BOOL GetItemAt(int iIndex, SYSTEMTIME &stStart, SYSTEMTIME &stEnd, int &iDownload, int &iUploaded);


private:
	CHistory(void);
	CHistory(CHistory const&);
	CHistory& operator=(CHistory const&);  

	static CHistory *m_pInstance;


	std::vector<CHistoryItem> m_List;

	void Save();
	void Load();
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
I love coding with C++. I always split my free time between coding and gaming Smile | :)

Comments and Discussions