Click here to Skip to main content
12,509,269 members (57,253 online)
Click here to Skip to main content

Stats

168.4K views
598 downloads
82 bookmarked
Posted

Bridge Pattern - Bridging the gap between Interface and Implementation

, 8 Jan 2001
This article discusses the Bridge Pattern, what it is, why and when it is needed.
// Image.h : interface of the CImage class
//
/////////////////////////////////////////////////////////////////////////////
#ifndef _IMAGE
#define _IMAGE

//	Image constants 

#ifndef SUCCESS 
#define SUCCESS		0
#endif

#ifndef FAILURE
#define FAILURE		-1
#endif

// Forward declaration for the class CImageImp
class CImageImp;

// Class declaration
class CImage
{
	// Constructor and Destructor
	public :
		CImage();
		virtual ~CImage();

	// Services
	public :
		virtual INT Load( LPCSTR, CRuntimeClass * )	= 0;
		virtual INT	Show( CWnd *, WPARAM );
		INT			GetImageWidth();
		INT			GetImageHeight();

	// Attributes
	protected :
		CImageImp	* m_pImageImp;
};

// Class declaration
class CBmpImage : public CImage
{
	// Constructor and Destructor
	public :
		CBmpImage();
		virtual ~CBmpImage();

	// Services
	public :
		virtual INT	Load( LPCSTR, CRuntimeClass * );

	// Implementaion
	protected :
		INT	ReadColorEntries( INT, CFile *, BOOL, CImageImp * );
};
#endif

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 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

Share

About the Author

T. Kulathu Sarma
Switzerland Switzerland
Kulathu Sarma is working as a Technology Manager for GoldAvenue, a company based in Geneva, Switzerland and responsible for supporting e-business initiatives of GoldAvenue in B2B and B2C Sectors. He has been programming in C/C++ for 9 years and actively working on Patterns for the past 5 years.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160927.1 | Last Updated 9 Jan 2001
Article Copyright 2001 by T. Kulathu Sarma
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid