Click here to Skip to main content
15,892,697 members
Articles / Programming Languages / C++/CLI

Bridge Pattern - Bridging the gap between Interface and Implementation

Rate me:
Please Sign up or sign in to vote.
4.60/5 (26 votes)
8 Jan 2001 198.4K   686   83  
This article discusses the Bridge Pattern, what it is, why and when it is needed.
// BridgeView.h : interface of the CBridgeView class
//
/////////////////////////////////////////////////////////////////////////////

class CBridgeView : public CScrollView
{
protected: // create from serialization only
	CBridgeView();
	DECLARE_DYNCREATE(CBridgeView)

// Attributes
public:
	CBridgeDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBridgeView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CBridgeView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CBridgeView)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in BridgeView.cpp
inline CBridgeDoc* CBridgeView::GetDocument()
   { return (CBridgeDoc*)m_pDocument; }
#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


Written By
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.

Comments and Discussions