📄 object_8h.html
字号:
</table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This macro is used to assert immediately. The 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="a10" doxytag="object.h::PAssertAlways2"></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 PAssertAlways2</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">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> PAssertFunc(__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 immediately. The 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="a8" doxytag="object.h::PAssertNULL"></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 PAssertNULL</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">p </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre>((&(p)&&(p)!=NULL)?(p): \ (<a class="code" href="object_8h.html#a57">PAssertFunc</a>(__FILE__,__LINE__, <a class="code" href="object_8h.html#a4">__CLASS__</a>, <a class="code" href="object_8h.html#a70a43">PNullPointerReference</a>),(p)))</pre></div>This macro is used to assert that a pointer must be non-null. If the pointer is NULL then an assert function is called with the source file and line number the macro was instantiated on, plus the message described by the PNullPointerReference value in the <a class="el" href="object_8h.html#a70">PStandardAssertMessage</a># enum.<p>Note that this evaluates the expression defined by ptr# twice. To prevent incorrect behaviour with this, the macro will assume that the ptr# parameter is an L-Value. </td> </tr></table><a name="a7" doxytag="object.h::PAssertOS"></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 PAssertOS</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">b </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> PAssertFuncInline((b), __FILE__,__LINE__,__CLASS__,POperatingSystemError) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This macro is used to assert that an operating system call succeeds. 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 <a class="el" href="object_8h.html#a70a50">POperatingSystemError</a># value in the <a class="el" href="object_8h.html#a70">PStandardAssertMessage</a># enum. </td> </tr></table><a name="a26" doxytag="object.h::PBASECLASSINFO"></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 PBASECLASSINFO</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">cls, <tr> <td></td> <td></td> <td class="md" nowrap>par </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre><span class="keyword">public</span>: \ <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * Class() \ { <span class="keywordflow">return</span> PCLASSNAME(cls); } \ <span class="keyword">virtual</span> BOOL InternalIsDescendant(<span class="keyword">const</span> <span class="keywordtype">char</span> * clsName) <span class="keyword">const</span> \ { <span class="keywordflow">return</span> strcmp(clsName, PCLASSNAME(cls)) == 0 || par::InternalIsDescendant(clsName); } \</pre></div> </td> </tr></table><a name="a31" doxytag="object.h::PBIG_ENDIAN"></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 PBIG_ENDIAN 3 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a35" doxytag="object.h::PCHAR8"></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 PCHAR8 PANSI_CHAR </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a27" doxytag="object.h::PCLASSINFO"></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 PCLASSINFO</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">cls, <tr> <td></td> <td></td> <td class="md" nowrap>par </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre><a class="code" href="object_8h.html#a26">PBASECLASSINFO</a>(cls, par) \ <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * GetClass(<span class="keywordtype">unsigned</span> ancestor = 0) <span class="keyword">const</span> \ { <span class="keywordflow">return</span> ancestor > 0 ? par::GetClass(ancestor-1) : cls::Class(); } \ <span class="keyword">virtual</span> Comparison CompareObjectMemoryDirect(<span class="keyword">const</span> <a class="code" href="classPObject.html">PObject</a> & obj) <span class="keyword">const</span> \ { <span class="keywordflow">return</span> (Comparison)memcmp(<span class="keyword">this</span>, &obj, <span class="keyword">sizeof</span>(cls)); } \</pre></div> </td> </tr></table><a name="a28" doxytag="object.h::PDECLARE_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 PDECLARE_CLASS</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">cls, <tr> <td></td> <td></td> <td class="md" nowrap>par </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> class cls : public par { PCLASSINFO(cls, par) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Declare a class with PWLib class information. This macro is used to declare a new class with a single public ancestor. It starts the class declaration and then uses the <a class="el" href="object_8h.html#a27">PCLASSINFO</a># macro to get all the run-time type functions.<p>The use of this macro is no longer recommended for reasons of compatibility with documentation systems. </td> </tr></table><a name="a25" doxytag="object.h::PDownCast"></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 PDownCast</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">cls, <tr> <td></td> <td></td> <td class="md" nowrap>ptr </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> PAssertCast<cls>(dynamic_cast<cls*>(ptr),__FILE__,__LINE__) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a11" doxytag="object.h::PError"></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 PError (PGetErrorStream()) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This macro is used to access the platform specific error output stream. This is to be used in preference to assuming cerr# is always available. On Unix platforms this {\bfis} cerr# but for MS-Windows this is another stream that uses the OutputDebugString() Windows API function. Note that a MS-DOS or Windows NT console application would still use cerr#.<p>The <a class="el" href="object_8h.html#a11">PError</a># stream would normally only be used for debugging information as a suitable display is not always available in windowed environments.<p>The macro is a wrapper for a global variable PErrorStream# which is a pointer to an ostream#. The variable is initialised to cerr# for all but MS-Windows and NT GUI applications. An application could change this pointer to a ofstream# variable of <a class="el" href="object_8h.html#a11">PError</a># output is wished to be redirected to a file. </td> </tr></table><a name="a34" doxytag="object.h::PI_DIFF"></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 PI_DIFF</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">name, <tr> <td></td> <td></td> <td class="md" nowrap>type </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre><span class="keyword">struct </span>name { \ name() { } \ name(type value) { operator=(value); } \ name(<span class="keyword">const</span> name & value) { data = value.data; } \ name & operator =(type value) { <a class="code" href="object_8h.html#a33">PI_LOOP</a>(value, data); <span class="keywordflow">return</span> *<span class="keyword">this</span>; } \ name & operator =(<span class="keyword">const</span> name & value) { data = value.data; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } \ operator type()<span class="keyword"> const </span>{ type value; <a class="code" href="object_8h.html#a33">PI_LOOP</a>(data, value); <span class="keywordflow">return</span> value; } \ <span class="keyword">friend</span> ostream & operator<<(ostream & s, <span class="keyword">const</span> name & value) { <span class="keywordflow">return</span> s << (type)value; } \ <span class="keyword">friend</span> istream & operator>>(istream & s, name & v) { type val; s >> val; v = val; <span class="keywordflow">return</span> s; } \ <span class="keyword">private</span>: type data; \ }</pre></div> </td> </tr></table><a name="a33" doxytag="object.h::PI_LOOP"></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 PI_LOOP</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">src, <tr> <td></td> <td></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -