Sophie

Sophie

distrib > * > cooker > x86_64 > by-pkgid > 5fb1c39f9f9130a3cc01e8b1ffa5c0f8 > files > 8763

libreoffice-devel-3.5.4-4.x86_64.rpm

<html>
<head>
<title>struct _rtl_ModuleCount</title>
<link rel="stylesheet" type="text/css" href="../cpp.css">
</head>
<body>
<div id="adc-cppref">

<a name="_top_"> </a><table class="navimain" border="0" cellpadding="1" cellspacing="0">
<tr align="center" valign="top">
<td class="navimain">&nbsp;<a href="../index.html">Overview</a>&nbsp;</td>
<td class="navimain">&nbsp;<a href="index.html">Namespace</a>&nbsp;</td>
<td class="navimainself">&nbsp;Class&nbsp;</td>
<td class="navimain">&nbsp;<a href="../index-files/index-1.html">Index</a>&nbsp;</td>
<td class="navimain">&nbsp;<a href="../help.html">Help</a>&nbsp;</td>
</tr>
</table>
<table class="navisub" cellpadding="0" cellspacing="3"></table>
<hr>
<a href="../names/index.html" alt="Global Namespace in C++"><font size="+1"><b>::</b></font></a> <div class="title"><h2>struct _rtl_ModuleCount</h2>
</div><hr>
<dl>
<dt>Base Classes</dt>
<dd>None.</dd>
</dl>
<dl>
<dt>Known Derived Classes</dt>
<dd>None.</dd>
</dl>
<br>
<table class="flag-table" border="1" cellspacing="0">
<tr>
<td width="25%" class="flagname">virtual</td>
<td width="25%" class="flagname">abstract</td>
<td width="25%" class="flagname">interface</td>
<td width="25%" class="flagname">template</td>
</tr>
<tr>
<td class="flagno">NO</td>
<td class="flagno">NO</td>
<td class="flagno">NO</td>
<td class="flagno">NO</td>
</tr>
</table>
<dl>
<dt>Description</dt>
<dd>Pointers to <code>rtl_ModuleCount</code> are passed as arguments to the default factory creator
functions: <code>createSingleComponentFactory</code>, <code>createSingleFactory</code>,
<code>createOneInstanceFactory</code>.
The factory implementation is calling <code>rtl_ModuleCount.acquire</code> when it is being
constructed and it is calling <code>rtl_ModuleCount.release</code>. The implementations of
<code>acquire</code>
and <code>release</code> should influence the return value of <code>component_canUnload</code>
in a way that it
returns <code>sal_False</code> after <code>acquire</code> has been called. That is the module will not be unloaded
once a default factory has been created. A call to <code>release</code> may cause
<code>component_canUnload</code> to return <code>sal_False</code>, but only if there are
no object alive which
originated from the module. These objects are factory instances and the service instances
which have been created by these factories.
<p>
It is not necessary to synchronize <code>acquire</code> and <code>release</code> as a whole.
Simply sychronize the
access to a counter variable, e.g. the <code>rtl_moduleCount_release</code> implementation:
<pre>
extern "C" void rtl_moduleCount_acquire(rtl_ModuleCount * that )
{
    rtl_StandardModuleCount* pMod= (rtl_StandardModuleCount*)that;
    osl_incrementInterlockedCount( &pMod->counter);
}
</pre>
The SAL library offers functions that can be used for <code>acquire</code> and <code>release</code>. See struct
<code>_rtl_StandardModuleCount</code>.
</dd>
</dl>
<dl>
<dt>File</dt>
<dd>unload.h</dd>
</dl>
<hr>
<a href="#_top_" class="objchapter">Top of Page</a><hr size="3"><p class="copyright" align="center">Copyright &copy; 2000, 2012 LibreOffice contributors and/or their affiliates. All rights reserved.</p><p class="copyright" align="center">LibreOffice was created by The Document Foundation, based on OpenOffice.org, which is Copyright 2000, 2010 Oracle and/or its affiliates.</p><p class="copyright" align="center">The Document Foundation acknowledges all community members, please find more info <a href="http://www.libreoffice.org/about-us/credits/" target="_blank">at our website</a>.<p>&nbsp;</p><p class="copyright" align="center"><a href="http://www.libreoffice.org/privacy" target="_blank">Privacy Policy</a> | <a href="http://www.libreoffice.org/imprint" target="_blank">Impressum (Legal Info)</a> | Copyright information: The source code of LibreOffice is licensed under the GNU Lesser General Public License (<a href="http://www.libreoffice.org/download/license/" target="_blank">LGPLv3</a>). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our <a href="http://wiki.documentfoundation.org/TradeMark_Policy" target="_blank">trademark policy</a>.</p>

</div> <!-- id="adc-cppref" -->
</body>

</html>