📄 object_8h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>object.h File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>object.h File Reference</h1><code>#include "unix/ptlib/contain.h"</code><br><code>#include <stdio.h></code><br><code>#include <stdarg.h></code><br><code>#include <stdlib.h></code><br><code>#include <string.h></code><br><code>#include <iostream.h></code><br><code>#include <strstrea.h></code><br><code>#include <iomanip.h></code><br><code>#include <typeinfo></code><br><p><a href="object_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Compounds</h2></td></tr><tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classPObject.html">PObject</a></td></tr><tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classPTrace_1_1Block.html">Block</a></td></tr><tr><td nowrap align=right valign=top>class </td><td valign=bottom><a class="el" href="classPTrace.html">PTrace</a></td></tr><tr><td colspan=2><br><h2>Defines</h2></td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a0">_BADOFF</a> -1</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a1">P_USE_INLINES</a> 0</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a2">PINLINE</a></td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a3">P_USE_ASSERTS</a> 1</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a4">__CLASS__</a> NULL</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a5">PAssert</a>(b, m) PAssertFuncInline((b), __FILE__,__LINE__,__CLASS__,(m))</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a6">PAssert2</a>(b, c, m) PAssertFuncInline((b), __FILE__,__LINE__,(c),(m))</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a7">PAssertOS</a>(b) PAssertFuncInline((b), __FILE__,__LINE__,__CLASS__,POperatingSystemError)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a8">PAssertNULL</a>(p)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a9">PAssertAlways</a>(m) PAssertFunc(__FILE__,__LINE__,__CLASS__,(m))</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a10">PAssertAlways2</a>(c, m) PAssertFunc(__FILE__,__LINE__,(c),(m))</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a11">PError</a> (PGetErrorStream())</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a12">PTRACING</a> 0</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a13">PTRACE_PARAM</a>(param)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a14">PTRACE_BLOCK</a>(n)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a15">PTRACE_LINE</a>()</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a16">PTRACE</a>(level, arg)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a17">PTRACE_IF</a>(level, cond, args)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a18">PNEW</a> new</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a19">PNEW_AND_DELETE_FUNCTIONS</a></td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a20">runtime_malloc</a>(s) malloc(s)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a21">runtime_free</a>(p) free(p)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a22">PIsDescendant</a>(ptr, cls) (dynamic_cast<const cls *>(ptr) != NULL)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a23">PIsDescendantStr</a>(ptr, str) ((ptr)->InternalIsDescendant(str))</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a24">PRemoveConst</a>(cls, ptr) (const_cast<cls*>(ptr))</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a25">PDownCast</a>(cls, ptr) PAssertCast<cls>(dynamic_cast<cls*>(ptr),__FILE__,__LINE__)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a26">PBASECLASSINFO</a>(cls, par)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a27">PCLASSINFO</a>(cls, par)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a28">PDECLARE_CLASS</a>(cls, par) class cls : public par { PCLASSINFO(cls, par)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a29">PANSI_CHAR</a> 1</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a30">PLITTLE_ENDIAN</a> 2</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a31">PBIG_ENDIAN</a> 3</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a32">PI_SAME</a>(name, type)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a33">PI_LOOP</a>(src, dst)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a34">PI_DIFF</a>(name, type)</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a35">PCHAR8</a> PANSI_CHAR</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a36">PARRAYSIZE</a>(array) ((PINDEX)(sizeof(array)/sizeof(array[0])))</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a37">PMIN</a>(v1, v2) ((v1) < (v2) ? (v1) : (v2))</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a38">PMAX</a>(v1, v2) ((v1) > (v2) ? (v1) : (v2))</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="object_8h.html#a39">PABS</a>(v) ((v) < 0 ? -(v) : (v))</td></tr><tr><td colspan=2><br><h2>Typedefs</h2></td></tr><tr><td nowrap align=right valign=top>typedef long </td><td valign=bottom><a class="el" href="object_8h.html#a40">_Ios_Fmtflags</a></td></tr><tr><td colspan=2><br><h2>Enumerations</h2></td></tr><tr><td nowrap align=right valign=top>enum </td><td valign=bottom><a class="el" href="object_8h.html#a70">PStandardAssertMessage</a> { <br> <a class="el" href="object_8h.html#a70a41">PLogicError</a>, <a class="el" href="object_8h.html#a70a42">POutOfMemory</a>, <a class="el" href="object_8h.html#a70a43">PNullPointerReference</a>, <a class="el" href="object_8h.html#a70a44">PInvalidCast</a>, <br> <a class="el" href="object_8h.html#a70a45">PInvalidArrayIndex</a>, <a class="el" href="object_8h.html#a70a46">PInvalidArrayElement</a>, <a class="el" href="object_8h.html#a70a47">PStackEmpty</a>, <a class="el" href="object_8h.html#a70a48">PUnimplementedFunction</a>, <br> <a class="el" href="object_8h.html#a70a49">PInvalidParameter</a>, <a class="el" href="object_8h.html#a70a50">POperatingSystemError</a>, <a class="el" href="object_8h.html#a70a51">PChannelNotOpen</a>, <a class="el" href="object_8h.html#a70a52">PUnsupportedFeature</a>, <br> <a class="el" href="object_8h.html#a70a53">PInvalidWindow</a>, <a class="el" href="object_8h.html#a70a54">PMaxStandardAssertMessage</a><br> }</td></tr><tr><td> </td><td><font size=-1><em>Standard assert messages for the PAssert macro.</em> <a href="#a70">More...</a><em></em></font><br><br></td></tr><tr><td colspan=2><br><h2>Functions</h2></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="object_8h.html#a55">PAssertFunc</a> (const char *file, int line, const char *className, <a class="el" href="object_8h.html#a70">PStandardAssertMessage</a> msg)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="object_8h.html#a56">PAssertFunc</a> (const char *file, int line, const char *className, const char *msg)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="object_8h.html#a57">PAssertFunc</a> (const char *full_msg)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="object_8h.html#a58">PAssertFuncInline</a> (bool b, const char *file, int line, const char *className, <a class="el" href="object_8h.html#a70">PStandardAssertMessage</a> msg)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="object_8h.html#a59">PAssertFuncInline</a> (bool b, const char *file, int line, const char *className, const char *msg)</td></tr><tr><td nowrap align=right valign=top>ostream & </td><td valign=bottom><a class="el" href="object_8h.html#a60">PGetErrorStream</a> ()</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="object_8h.html#a61">PSetErrorStream</a> (ostream *strm)</td></tr><tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="object_8h.html#a62">operator new</a> (size_t nSize)</td></tr><tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="object_8h.html#a63">operator new[]</a> (size_t nSize)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="object_8h.html#a64">operator delete</a> (void *ptr)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="object_8h.html#a65">operator delete[]</a> (void *ptr)</td></tr><tr><td nowrap align=right valign=top>template<class BaseClass> BaseClass * </td><td valign=bottom><a class="el" href="object_8h.html#a66">PAssertCast</a> (BaseClass *obj, const char *file, int line)</td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="object_8h.html#a67">PI_SAME</a> (PChar8, char)</td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="object_8h.html#a68">PI_SAME</a> (PInt8, signed char)</td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="object_8h.html#a69">PI_SAME</a> (PUInt8, unsigned char)</td></tr></table><hr><h2>Define Documentation</h2><a name="a4" doxytag="object.h::__CLASS__"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define __CLASS__ NULL </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a0" doxytag="object.h::_BADOFF"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define _BADOFF -1 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a3" doxytag="object.h::P_USE_ASSERTS"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define P_USE_ASSERTS 1 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a1" doxytag="object.h::P_USE_INLINES"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define P_USE_INLINES 0 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a39" doxytag="object.h::PABS"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define PABS</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">v </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> ((v) < 0 ? -(v) : (v)) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a29" doxytag="object.h::PANSI_CHAR"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define PANSI_CHAR 1 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a36" doxytag="object.h::PARRAYSIZE"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define PARRAYSIZE</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">array </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> ((PINDEX)(sizeof(array)/sizeof(array[0]))) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a5" doxytag="object.h::PAssert"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define PAssert</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">b, <tr> <td></td> <td></td> <td class="md" nowrap>m </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> PAssertFuncInline((b), __FILE__,__LINE__,__CLASS__,(m)) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This macro is used to assert that a condition must be TRUE. If the condition is FALSE then an assert function is called with the source file and line number the macro was instantiated on, plus the message described by the msg# parameter. This parameter may be either a standard value from the <a class="el" href="object_8h.html#a70">PStandardAssertMessage</a># enum or a literal string. </td> </tr></table><a name="a6" doxytag="object.h::PAssert2"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define PAssert2</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">b, <tr> <td></td> <td></td> <td class="md" nowrap>c, <tr> <td></td> <td></td> <td class="md" nowrap>m </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> PAssertFuncInline((b), __FILE__,__LINE__,(c),(m)) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This macro is used to assert that a condition must be TRUE. If the condition is FALSE then an assert function is called with the source file and line number the macro was instantiated on, plus the message described by the msg# parameter. This parameter may be either a standard value from the <a class="el" href="object_8h.html#a70">PStandardAssertMessage</a># enum or a literal string. The c# parameter specifies the class name that the error occurred in </td> </tr></table><a name="a9" doxytag="object.h::PAssertAlways"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define PAssertAlways</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">m </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> PAssertFunc(__FILE__,__LINE__,__CLASS__,(m)) </table> </td> </tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -