Click here to Skip to main content
15,893,668 members
Articles / Desktop Programming / Win32

Pipe template classes

Rate me:
Please Sign up or sign in to vote.
4.69/5 (9 votes)
2 Nov 2010MPL12 min read 146.3K   1.9K   33  
A template classes library to support pipe development with minimum programmer effort.
#if !defined(__TRACE_H__3F83BA89_0D58_4F61_B156_2E8A3C0F60E8)
#define __TRACE_H__3F83BA89_0D58_4F61_B156_2E8A3C0F60E8

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

template<typename _Type> inline
_Type* trace_alloc_func(_Type* _ptr,LPCTSTR _szFileName,long _nLine)
{
#if defined(_DEBUG) && defined(TRACE_MEM_ALLOCATION)
	TRACE(_T("memory allocate block 0x%08X at \"%s\" at line %d\n"),(LPVOID)_ptr,_szFileName,_nLine);
	::SwitchToThread();
#endif
	return _ptr;
}

#define trace_alloc(_ptr) trace_alloc_func(_ptr,__FILE__,__LINE__)


#endif //#if !defined(__TRACE_H__3F83BA89_0D58_4F61_B156_2E8A3C0F60E8)

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, along with any associated source code and files, is licensed under The Mozilla Public License 1.1 (MPL 1.1)


Written By
Software Developer
Belarus Belarus
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions