cpluslib.html

来自「Vxworks API操作系统和驱动程序设计API。压缩的HTML文件」· HTML 代码 · 共 611 行 · 第 1/2 页

HTML
611
字号
<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cplusLib.html#top">cplusLib</a></b>, <b><a href="./cplusLib.html#cplusXtorSet">cplusXtorSet</a>(&nbsp;)</b><hr><a name="cplusDtorsLink"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>cplusDtorsLink(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>cplusDtorsLink(&nbsp;)</strong> - call all linked static destructors (C++)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>extern "C" void cplusDtorsLink ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function calls destructors for all of the static objects linkedwith a VxWorks bootable image.  When creating bootable applications,this function should be called during system shutdown to decommissionall static objects.  Correct operation depends on correctly munchingthe C++ modules that are linked with VxWorks.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cplusLib.html#top">cplusLib</a></b><hr><a name="cplusLibInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>cplusLibInit(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>cplusLibInit(&nbsp;)</strong> - initialize the C++ library (C++)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>extern "C" STATUS cplusLibInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the C++ library and forces all C++ run-time supportto be linked with the bootable VxWorks image.  If the configurationmacro <b>INCLUDE_CPLUS</b> is defined,<b><a href="./cplusLib.html#cplusLibInit">cplusLibInit</a>(&nbsp;)</b> is called automatically from the root task,<b><a href="./usrConfig.html#usrRoot">usrRoot</a>(&nbsp;)</b>, in <b>usrConfig.c</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cplusLib.html#top">cplusLib</a></b><hr><a name="cplusXtorSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>cplusXtorSet(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>cplusXtorSet(&nbsp;)</strong> - change C++ static constructor calling strategy (C++)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>extern "C" void cplusXtorSet    (    int strategy    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command sets the C++ static constructor calling strategyto <i>strategy</i>.  The default strategy is 1.<p>There are two static constructor calling strategies: <i>automatic</i>and <i>manual</i>.  These modes are represented by numeric codes:<p><table><tr valign=top><th align=left>Strategy   </th><th align=left> Code</tr><tr><td colspan="2"><hr></tr><tr valign=top><td align=left>manual     </td><td align=left> 0</tr><tr valign=top><td align=left>automatic  </td><td align=left> 1</tr><tr valign=top><td align=left></tr></tr></table>Under the manual strategy, a module's static constructors anddestructors are called by <b><a href="./cplusLib.html#cplusCtors">cplusCtors</a>(&nbsp;)</b> and <b><a href="./cplusLib.html#cplusDtors">cplusDtors</a>(&nbsp;)</b>, which arethemselves invoked manually.<p>Under the automatic strategy, a module's static constructors arecalled as a side-effect of loading the module using the VxWorks moduleloader.  A module's static destructors are called as a side-effect ofunloading the module.<p></blockquote><h4>NOTE</h4><blockquote><p>The manual strategy is applicable only to modules that areloaded by the VxWorks module loader.  Static constructors anddestructors contained by modules linked with the VxWorks imageare called using <b><a href="./cplusLib.html#cplusCtorsLink">cplusCtorsLink</a>(&nbsp;)</b> and <b><a href="./cplusLib.html#cplusDtorsLink">cplusDtorsLink</a>(&nbsp;)</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cplusLib.html#top">cplusLib</a></b><hr><a name="operator delete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>operator delete(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>operator delete(&nbsp;)</strong> - default run-time support for memory deallocation (C++)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>extern void operator delete    (    void * pMem               /* pointer to dynamically-allocated object */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function provides the default implementation of operator delete.It returns the memory, previously allocated by operator new, to theVxWorks system memory partition.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cplusLib.html#top">cplusLib</a></b><hr><a name="operator new"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>operator new(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>operator new(&nbsp;)</strong> - default run-time support for operator new (C++)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>extern void * operator new    (    size_t n                  /* size of object to allocate */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function provides the default implementation of operator new.It allocates memory from the system memory partition for therequested object.  The value, when evaluated, is a pointer of thetype <b>pointer-to-</b><i>T</i> where <i>T</i> is the type of the new object.<p>If allocation fails a new-handler, if one is defined, is called.If the new-handler returns, presumably after attempting to recoverfrom the memory allocation failure, allocation is retried.If there is no new-handler an exception of type "<b>bad_alloc</b>" isthrown.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>Pointer to new object.<p></blockquote><h4>THROWS</h4><blockquote><p><p>std::<b>bad_alloc</b> if allocation failed.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cplusLib.html#top">cplusLib</a></b><hr><a name="operator new_1"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>operator new(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>operator new(&nbsp;)</strong> - default run-time support for operator new (nothrow) (C++)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>extern void * operator new    (    size_t          n,        /* size of object to allocate */    const nothrow_t &         /* supply argument of "nothrow" here */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function provides the default implementation of operator new (nothrow).It allocates memory from the system memory partition for therequested object.  The value, when evaluated, is a pointer of thetype <b>pointer-to-</b><i>T</i> where <i>T</i> is the type of the new object.<p>If allocation fails, a new-handler, if one is defined, is called.If the new-handler returns, presumably after attempting to recoverfrom the memory allocation failure, allocation is retried.If the <b>new_handler</b> throws a <b>bad_alloc</b> exception, the exceptionis caught and 0 is returned. If allocation fails and there is no <b>new_handler</b> 0 is returned.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>Pointer to new object or 0 if allocation fails.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>new</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cplusLib.html#top">cplusLib</a></b><hr><a name="operator new_2"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>operator new(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>operator new(&nbsp;)</strong> - run-time support for operator new with placement (C++)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>extern void * operator new    (    size_t n,                 /* size of object to allocate (unused) */    void * pMem               /* pointer to allocated memory */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function provides the default implementation of the globalnew operator, with support for the placement syntax.New-with-placement is used to initialize objects for which memory hasalready been allocated. <i>pMem</i> points to the previously allocated memory.memory.<p></blockquote><h4>RETURNS</h4><blockquote><p><p><i>pMem</i><p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>new</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cplusLib.html#top">cplusLib</a></b><hr><a name="set_new_handler"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>set_new_handler(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>set_new_handler(&nbsp;)</strong> - set <b>new_handler</b> to user-defined function (C++)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>extern void (*set_new_handler (void(* pNewNewHandler)()))  ()    </pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function is used to define the function that will be calledwhen operator new cannot allocate memory.<p>The <b>new_handler</b> acts for all threads in the system;you cannot set a different handler for different tasks.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to the previous value of <b>new_handler</b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>new</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cplusLib.html#top">cplusLib</a></b><hr><a name="set_terminate"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>set_terminate(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>set_terminate(&nbsp;)</strong> - set terminate to user-defined function (C++)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>extern void (*set_terminate (void(* terminate_handler)()))  ()    </pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function is used to define the <b>terminate_handler</b>which will be called when an uncaught exception is raised.<p>The <b>terminate_handler</b> acts for all threads in the system;you cannot set a different handler for different tasks.<p></blockquote><h4>RETURNS</h4><blockquote><p>The previous <b>terminate_handler</b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>exception</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cplusLib.html#top">cplusLib</a></b></body></html>

⌨️ 快捷键说明

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