本文整理汇总了C++中ACE_DLL::get_handle方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_DLL::get_handle方法的具体用法?C++ ACE_DLL::get_handle怎么用?C++ ACE_DLL::get_handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_DLL
的用法示例。
在下文中一共展示了ACE_DLL::get_handle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
int
ACE_Service_Repository::relocate_i (size_t begin,
size_t end,
const ACE_DLL& adll)
{
ACE_SHLIB_HANDLE new_handle = adll.get_handle (0);
for (size_t i = begin; i < end; i++)
{
ACE_Service_Type *type =
const_cast<ACE_Service_Type *> (this->service_vector_[i]);
ACE_SHLIB_HANDLE old_handle = (type == 0) ? ACE_SHLIB_INVALID_HANDLE
: type->dll ().get_handle (0);
#ifndef ACE_NLOGGING
if (ACE::debug ())
{
if (type == 0)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("ACE (%P|%t) SR::relocate_i - repo=%@ [%d] (size=%d)")
ACE_TEXT (": skipping empty slot\n"),
this,
i,
this->total_size_));
else
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("ACE (%P|%t) SR::relocate_i - repo=%@ [%d] (size=%d)")
ACE_TEXT (": trying name=%s, handle: %d -> %d\n"),
this,
i,
this->total_size_,
type->name (),
old_handle,
new_handle));
}
#endif
if (type != 0 // skip any gaps
&& old_handle == ACE_SHLIB_INVALID_HANDLE
&& new_handle != old_handle)
{
#ifndef ACE_NLOGGING
if (ACE::debug ())
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("ACE (%P|%t) SR::relocate_i - repo=%@ [%d] (size=%d)")
ACE_TEXT (": relocating name=%s, handle: %d -> %d\n"),
this,
i,
this->total_size_,
type->name (),
old_handle,
new_handle));
#endif
type->dll (adll); // ups the refcount on adll
}
}
return 0;
}
示例2: handle_test
int handle_test (ACE_DLL &dll)
{
// Test the get/set_handle methods.
ACE_DLL local_dll;
ACE_SHLIB_HANDLE handle = dll.get_handle (1);
if (handle != ACE_SHLIB_INVALID_HANDLE)
{
if (local_dll.set_handle (handle) != 0)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Error setting handle.\n")),
-1);
return 0;
}
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Error getting handle.\n")),
-1);
}