Click here to Skip to main content
13,139,254 members (74,001 online)
Click here to Skip to main content


87 bookmarked
Posted 16 Aug 2004

Designing Robust Objects with Boost

, 16 Aug 2004
Tutorial on designing classes using Boost libraries
// $Workfile: AppVersion.h $
// $Modtime: 8/15/04 7:59a $
// Header for AddVersion class.
// This class provides application version number handling.

#pragma once

#if _MSC_VER == 1200
#pragma warning(push, 3)	// turn off some STL warnings in VS6
#include <iostream>
#include "boost\operators.hpp"
#if _MSC_VER == 1200
#pragma warning(pop)

class AppVersion : public CObject,
				   public boost::totally_ordered<AppVersion>

	public :
		AppVersion(unsigned long Major,
				   unsigned long Minor,
				   unsigned long Build,
				   unsigned long Revision);
		AppVersion(const AppVersion& b);

		virtual ~AppVersion();

		AppVersion& operator=(const AppVersion& b);

		bool operator<(const AppVersion& b) const;
		bool operator==(const AppVersion& b) const;

		unsigned long GetMajor() const;
		unsigned long GetMinor() const;
		unsigned long GetBuild() const;
		unsigned long GetRevision() const;

		virtual void Serialize(CArchive& ar);

#if defined _DEBUG
		virtual void Dump(CDumpContext& dc) const;

	private :
		unsigned long m_Major;
		unsigned long m_Minor;
		unsigned long m_Build;
		unsigned long m_Revision;

// AppVersion support functions
const CString GetText(const AppVersion& AV);
std::ostream& operator<<(std::ostream& os, const AppVersion& AV);

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.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Jim D'Agostino
Technical Lead
United States United States
Jim has been developing software for over 25 years. He is a consultant specializing in writing software for commercial products. He has developed software for embedded systems, device drivers, and windows applications.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170915.1 | Last Updated 17 Aug 2004
Article Copyright 2004 by Jim D'Agostino
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid