Click here to Skip to main content
11,930,048 members (39,415 online)
Click here to Skip to main content
Articles » Database » Database » General » Downloads


36 bookmarked

C++ Object Oriented Database Generator

, 17 Nov 1999
This project is a code generator to produce CObject-dervied data classes for Object-Oriented database management
// CExample -- Interface for CExample object

#ifndef __EXAMPLE_H__
#define __EXAMPLE_H__

class CExample;

class CExampleList : public CObList
	CExample* FindExample(COleDateTime dtDate, CString strLocationID, int nOrder);
	POSITION FindExamplePos(COleDateTime dtDate, CString strLocationID, int nOrder);
	POSITION FindExamplePosBruteForce(COleDateTime dtDate, CString strLocationID, int nOrder);
	void AddExample(CExample* pNew);
	void RemoveExample(COleDateTime dtDate, CString strLocationID, int nOrder);
	virtual void Serialize(CArchive& ar);
	void ClearAndDelete();

class CExample : public CObject
// construction
	CExample(COleDateTime dtDate, CString strLocationID, int nOrder);

// Attributes

	COleDateTime m_dtDate;
	CString m_strLocationID;
	int m_nOrder;
	CString m_strCustomerName;
	COleDateTime m_dtBirthDate;
	COLORREF m_rgbColor;
	COleDateTime m_dtCreated;
	COleDateTime m_dtLastModified;

// Operations
	virtual void Serialize(CArchive& ar);
	void Duplicate(CExample* pSource);
	void Clear();
	int Compare(COleDateTime dtDate, CString strLocationID, int nOrder);
	int Compare(CExample* pTest);

// Diagnostics
#ifdef _DEBUG
	void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;

// inlines
	inline void SetDate(COleDateTime dtNew) {
		m_dtLastModified = COleDateTime::GetCurrentTime();
		m_dtDate = dtNew; }
	inline COleDateTime GetDate() {;
		return m_dtDate; }

	inline void SetLocationID(CString strNew) {
		m_dtLastModified = COleDateTime::GetCurrentTime();
		m_strLocationID = strNew;
		m_strLocationID.FreeExtra(); }
	inline CString GetLocationID() {;
		return m_strLocationID; }

	inline void SetOrder(int nNew) {
		m_dtLastModified = COleDateTime::GetCurrentTime();
		m_nOrder = nNew; }
	inline int GetOrder() {;
		return m_nOrder; }

	inline void SetCustomerName(CString strNew) {
		m_dtLastModified = COleDateTime::GetCurrentTime();
		m_strCustomerName = strNew;
		m_strCustomerName.FreeExtra(); }
	inline CString GetCustomerName() {;
		return m_strCustomerName; }

	inline void SetBirthDate(COleDateTime dtNew) {
		m_dtLastModified = COleDateTime::GetCurrentTime();
		m_dtBirthDate = dtNew; }
	inline COleDateTime GetBirthDate() {;
		return m_dtBirthDate; }

	inline void SetColor(COLORREF rgbNew) {
		m_dtLastModified = COleDateTime::GetCurrentTime();
		m_rgbColor = rgbNew; }
	inline COLORREF GetColor() {;
		return m_rgbColor; }

	inline void SetCreated(COleDateTime dtNew) {
		m_dtLastModified = COleDateTime::GetCurrentTime();
		m_dtCreated = dtNew; }
	inline COleDateTime GetCreated() {;
		return m_dtCreated; }

	inline void SetLastModified(COleDateTime dtNew) {
		m_dtLastModified = COleDateTime::GetCurrentTime();
		m_dtLastModified = dtNew; }
	inline COleDateTime GetLastModified() {;
		return m_dtLastModified; }


#endif // #define __EXAMPLE_H__

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

Robert Pittenger, MCPD-EAD
President Starpoint Software Inc.
United States United States
Bob Pittenger is founder and President of Starpoint Software Inc. He holds a B.A. degree from Miami University, M.S. and Ph.D. degrees from Purdue University, and an MBA from Xavier University. He has been programming since 1993, starting with Windows application development in C++/MFC and moving to C# and .NET around 2005 and is a .NET Microsoft Certified Professional Developer.

Bob is the author of two books:
Billionaire: How the Ultra-Rich Built Their Fortunes Through Good and Evil and What You Can Learn from Them
Wealthonomics: The Most Important Economic and Financial Concepts that Can Make You Rich Fast.
Visit for more information.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151126.1 | Last Updated 18 Nov 1999
Article Copyright 1999 by Robert Pittenger, MCPD-EAD
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid