Click here to Skip to main content
13,198,322 members (55,607 online)
Click here to Skip to main content
Articles » Database » Database » General » Downloads


37 bookmarked
Posted 17 Nov 1999

C++ Object Oriented Database Generator

This project is a code generator to produce CObject-dervied data classes for Object-Oriented database management
// CTest -- Interface for CTest object

#ifndef __TEST_H__
#define __TEST_H__

class CTest;

class CTestList : public CObList
	CTest* FindEntry(COleDateTime dtDate, int nOrder, CString strLocationID);
	POSITION FindEntryPos(COleDateTime dtDate, int nOrder, CString strLocationID);
	POSITION FindEntryPosBruteForce(COleDateTime dtDate, int nOrder, CString strLocationID);
	void AddTest(CTest* pNew)
	void RemoveTest(COleDateTime dtDate, int nOrder, CString strLocationID)
	virtual void Serialize(CArchive& ar);
	void ClearAndDelete();

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

// Attributes

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

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

// Diagnostics
	void AssertValid() const;
#ifdef _DEBUG
	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 SetOrder(int nNew) {
		m_dtLastModified = COleDateTime::GetCurrentTime();
		m_nOrder = nNew; }
	inline int GetOrder() {;
		return m_nOrder; }

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

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

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