⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spobject.cpp

📁 股软 通达信行情接收接口, 包括美元汇率
💻 CPP
字号:
/*
	Cross Platform Core Code.

	Copyright(R) 2001-2002 Balang Software.
	All rights reserved.

	Using:
		class	Object;
*/
#include	"StdAfx.h"

#define	_SPRING( cause )	static char sz##cause[] = #cause;
#include	"SpObjErr.inl"
#undef	_SPRING

#ifndef	_SP_ENABLE_INLINES
#define	_SPOBJ_INLINE
#include	"SpObject.inl"
#undef	_SPOBJ_INLINE
#endif

static	LPCSTR	allObjectErrorNames[] = 
{
	#define	_SPRING( cause )	sz##cause,
	#include	"SpObjErr.inl"
	#undef	_SPRING
	NULL
};


void	Object::AssertValid( ) const
{
	SP_ASSERT( NULL != this );
}

void	Object::Dump( ) const
{

}

LPCSTR	Object::GetLastErrorString( ) const
{
	if( m_nErrorStatus >= errObject_None && m_nErrorStatus < errorEnd )
		return	allObjectErrorNames[ m_nErrorStatus ];
	return	NULL;
}

#ifdef	_DEBUG
void*	Object::operator new( size_t nSize )
{
	SP_ASSERT( SP_CheckMemory() );
	void	*p	=	SP_AllocMemoryDebug( nSize, TRUE, NULL, 0 );
	if( NULL == p )
	{
		SP_TRACE1("Object::new( size_t ) allocate %d bytes fail.\n", nSize );
	}
	return	p;
}

void*	Object::operator new( size_t nSize, LPCSTR lpszFileName, int nLine )
{
	SP_ASSERT( SP_CheckMemory() );
	void	*p	=	SP_AllocMemoryDebug( nSize, TRUE, lpszFileName, nLine );
	if( NULL == p )
	{
		SP_TRACE1("Object::new( size_t, LPCSTR, int ) allocate %d bytes fail.\n", nSize );
	}
	return	p;
}

void	Object::operator delete( void *p )
{
	SP_ASSERT( SP_CheckMemory() );

	SP_FreeMemoryDebug( p, TRUE );
}

#if	_MSC_VER >= 1200
void	Object::operator delete( void *p, void* )
{
	SP_ASSERT( SP_CheckMemory() );

	SP_FreeMemoryDebug(p,TRUE);
}

void	Object::operator delete( void *p, LPCSTR /* lpszFileName */,
								int	/* nLine */ )
{
	SP_ASSERT( SP_CheckMemory() );

	SP_FreeMemoryDebug(p, TRUE);
}
#endif // _MSC_VER

#endif //_DEBUG

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -