📄 contain.h
字号:
/*
* contain.h
*
* General container classes.
*
* Portable Windows Library
*
* Copyright (c) 1993-1998 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Portable Windows Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Portions are Copyright (C) 1993 Free Software Foundation, Inc.
* All Rights Reserved.
*
* Contributor(s): ______________________________________.
*
* $Log: contain.h,v $
* Revision 1.3 2006/11/28 07:59:17 joegenbaclor
* Corrected some compile warning on X64 build
*
* Revision 1.2 2006/08/29 03:56:43 joegenbaclor
* 1. Added GC Reference in SIP Event
* 2. Corrected buf in ProcessStackEvent where session is checked against NULL not allowing requests to create new sessions
*
* Revision 1.1 2006/08/04 03:34:05 joegenbaclor
* Moved pwlib and OPAL headers to root include directory
*
* Revision 1.1 2006/06/29 04:17:41 joegenbaclor
* *** empty log message ***
*
* Revision 1.57 2006/04/09 11:44:21 csoutheren
* And then refix VS.net 2003
*
* Revision 1.56 2006/04/09 11:03:59 csoutheren
* Remove warnings on VS.net 2005
*
* Revision 1.55 2005/09/25 10:51:23 dominance
* almost complete the mingw support. We'll be there soon. ;)
*
* Revision 1.54 2005/09/24 09:11:42 dominance
* use unix-style slashes to not confuse mingw on win32
*
* Revision 1.53 2005/09/23 15:30:46 dominance
* more progress to make mingw compile nicely. Thanks goes to Julien Puydt for pointing out to me how to do it properly. ;)
*
* Revision 1.52 2005/09/18 13:01:43 dominance
* fixed pragma warnings when building with gcc.
*
* Revision 1.51 2005/03/10 06:37:19 csoutheren
* Removed use of typeid on WIndows to get class name because it is not threadsafe
* In fact, lets just use #classname everywhere because that will always work
* Thanks to Vyacheslav Frolov
*
* Revision 1.50 2004/10/30 19:23:45 ykiryanov
* Ifdefd strcasecmp for WinCE port
*
* Revision 1.49 2004/10/23 11:34:14 ykiryanov
* Added ifdef _WIN32_WCE for PocketPC 2003 SDK port
*
* Revision 1.48 2004/08/15 06:45:48 rjongbloed
* Disabled warning about conversion from int to bool type.
*
* Revision 1.47 2004/06/30 12:17:04 rjongbloed
* Rewrite of plug in system to use single global variable for all factories to avoid all sorts
* of issues with startup orders and Windows DLL multiple instances.
*
* Revision 1.46 2004/06/19 09:10:24 csoutheren
* Removed MSVC warnings for <queue>
*
* Revision 1.45 2004/06/01 23:25:20 csoutheren
* Disabled warnings under MSVC
*
* Revision 1.44 2004/06/01 05:22:43 csoutheren
* Restored memory check functionality
*
* Revision 1.43 2004/05/19 23:34:43 csoutheren
* Added <algorithm>
*
* Revision 1.42 2004/05/13 14:53:35 csoutheren
* Add "abstract factory" template classes
*
* Revision 1.41 2004/04/15 03:58:40 csoutheren
* Removed PCONTAINER_USES_CRITSEC
*
* Revision 1.40 2004/04/13 10:12:21 csoutheren
* Fix for MSVC (grrr)
*
* Revision 1.39 2004/04/13 03:13:29 csoutheren
* VS.net won't compile without "using namespace std"
*
* Revision 1.38 2004/04/12 03:04:10 csoutheren
* Removed <vector> warnings under Windows
*
* Revision 1.37 2004/04/11 22:47:03 csoutheren
* Remove unused parameter warnings for Windows <string>
*
* Revision 1.36 2004/04/11 13:26:25 csoutheren
* Removed namespace problems and removed warnings for Windows <string>
*
* Revision 1.35 2004/04/11 02:55:18 csoutheren
* Added PCriticalSection for Windows
* Added compile time option for PContainer to use critical sections to provide thread safety under some circumstances
*
* Revision 1.34 2004/04/09 06:40:48 rjongbloed
* Removed warning in VC++2003 version about wspapi.h
*
* Revision 1.33 2004/04/09 00:42:59 csoutheren
* Changed Unix build to use slightly different method for
* keep class names, as GCC does not use actual class names for typeinfo
*
* Revision 1.32 2004/04/03 08:22:20 csoutheren
* Remove pseudo-RTTI and replaced with real RTTI
*
* Revision 1.31 2004/04/03 06:54:23 rjongbloed
* Many and various changes to support new Visual C++ 2003
*
* Revision 1.30 2004/01/06 21:17:38 csoutheren
* Fixed formatting of warning message regarding old include system
* Thanks to Louis R. Marascio
*
* Revision 1.29 2003/09/17 05:41:59 csoutheren
* Removed recursive includes
*
* Revision 1.28 2002/09/23 07:17:23 robertj
* Changes to allow winsock2 to be included.
*
* Revision 1.27 2002/03/15 05:58:52 robertj
* Added strncasecmp macro for unix compatibility
*
* Revision 1.26 2000/05/02 02:58:09 robertj
* Added strcasecmp macro, BSDish version of stricmp
*
* Revision 1.25 2000/02/28 11:39:52 robertj
* Removed warning for if STRICT (for windows.h) already defined.
*
* Revision 1.24 1999/03/09 10:30:17 robertj
* Fixed ability to have PMEMORY_CHECK on/off on both debug/release versions.
*
* Revision 1.23 1998/11/30 02:55:06 robertj
* New directory structure
*
* Revision 1.22 1998/10/13 14:13:16 robertj
* Complete rewrite of memory leak detection code.
*
* Revision 1.21 1998/09/24 03:29:57 robertj
* Added open software license.
*
* Revision 1.20 1998/03/09 07:15:15 robertj
* Added support for MemCheck-32 program.
*
* Revision 1.19 1998/01/26 00:52:13 robertj
* Fixed istream << operator for PInt64, should be reference.
*
* Revision 1.18 1997/07/08 13:01:30 robertj
* DLL support.
*
* Revision 1.17 1997/01/12 04:13:07 robertj
* Changed library to support NT 4.0 API changes.
*
* Revision 1.16 1996/09/14 12:38:57 robertj
* Moved template define from command line to code.
* Fixed correct application of windows defines.
*
* Revision 1.15 1996/08/17 10:00:33 robertj
* Changes for Windows DLL support.
*
* Revision 1.14 1996/08/08 10:08:58 robertj
* Directory structure changes for common files.
*
* Revision 1.13 1996/07/15 10:26:55 robertj
* MSVC 4.1 Support
*
* Revision 1.12 1996/03/31 09:07:29 robertj
* Removed bad define in NT headers.
*
* Revision 1.11 1996/01/28 02:54:27 robertj
* Removal of MemoryPointer classes as usage didn't work for GNU.
*
* Revision 1.10 1996/01/23 13:23:15 robertj
* Added const version of PMemoryPointer
*
* Revision 1.9 1995/11/09 12:23:46 robertj
* Added 64 bit integer support.
* Added platform independent base type access classes.
*
* Revision 1.8 1995/04/25 11:31:18 robertj
* Changes for DLL support.
*
* Revision 1.7 1995/03/12 04:59:54 robertj
* Re-organisation of DOS/WIN16 and WIN32 platforms to maximise common code.
* Used built-in equate for WIN32 API (_WIN32).
*
* Revision 1.6 1995/01/09 12:28:45 robertj
* Moved EXPORTED definition from applicat.h
*
* Revision 1.5 1995/01/06 10:47:08 robertj
* Added 64 bit integer.
*
* Revision 1.4 1994/11/19 00:18:26 robertj
* Changed PInteger to be INT, ie standard type like BOOL/WORD etc.
*
* Revision 1.3 1994/07/02 03:18:09 robertj
* Support for 16 bit systems.
*
* Revision 1.2 1994/06/25 12:13:01 robertj
* Synchronisation.
*
* Revision 1.1 1994/04/01 14:38:42 robertj
* Initial revision
*
*/
#ifndef _CONTAIN_H
#ifndef _WIN32_WCE
#error "Please remove pwlib\include\ptlib\msos from the tool include path \"
and from the pre-processor options for this project"
#endif // !_WIN32_WCE
#endif
#ifndef _OBJECT_H
#define _OBJECT_H
#ifdef _MSC_VER
#pragma warning(disable:4201) // nonstandard extension: nameless struct/union
#pragma warning(disable:4251) // disable warning exported structs
#pragma warning(disable:4511) // default copy ctor not generated warning
#pragma warning(disable:4512) // default assignment op not generated warning
#pragma warning(disable:4514) // unreferenced inline removed
#pragma warning(disable:4699) // precompiled headers
#pragma warning(disable:4702) // disable warning about unreachable code
#pragma warning(disable:4705) // disable warning about statement has no effect
#pragma warning(disable:4710) // inline not expanded warning
#pragma warning(disable:4711) // auto inlining warning
#pragma warning(disable:4786) // identifier was truncated to '255' characters in the debug information
#pragma warning(disable:4097) // typedef synonym for class
#pragma warning(disable:4800) // forcing value to bool 'true' or 'false' (performance warning)
#if _MSC_VER>=800
#define PHAS_TEMPLATES
#endif
#if _MSC_VER>=1300
#define __USE_STL__ 1
#endif
#if _MSC_VER>=1400
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
#endif
#endif
#endif
///////////////////////////////////////////////////////////////////////////////
// Machine & Compiler dependent declarations
#if defined(_WIN32) && !defined(WIN32)
#define WIN32
#endif
#if defined(_WINDOWS) || defined(_WIN32)
# ifndef WINVER
# define WINVER 0x401
# endif
# ifndef STRICT
# define STRICT
# endif
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
#ifndef _WINDOWS_
# include <windows.h>
#endif
# undef DELETE // Remove define from NT headers.
#else
typedef unsigned char BYTE; // 8 bit unsigned integer quantity
typedef unsigned short WORD; // 16 bit unsigned integer quantity
typedef unsigned long DWORD; // 32 bit unsigned integer quantity
typedef int BOOL; // type returned by expresion (i != j)
#define TRUE 1
#define FALSE 0
#define NEAR __near
#endif
// Declaration for exported callback functions to OS
#if defined(_WIN32)
# define PEXPORTED __stdcall
#elif defined(_WINDOWS)
# define PEXPORTED WINAPI __export
#else
# define PEXPORTED __far __pascal
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -