本文整理汇总了C++中Proxy::update方法的典型用法代码示例。如果您正苦于以下问题:C++ Proxy::update方法的具体用法?C++ Proxy::update怎么用?C++ Proxy::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Proxy
的用法示例。
在下文中一共展示了Proxy::update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatep
// Search for an existing Proxy that matches the pointer to
// member and replace it's Call, or create a new Proxy for it.
//
void ListenersBase::updatep (void const* const member,
const size_t bytes, Call::Ptr cp)
{
Call* c = cp;
ReadWriteMutex::ScopedReadLockType lock (m_groups_mutex);
if (!m_groups.empty ())
{
Proxy* proxy;
{
ReadWriteMutex::ScopedReadLockType lock (m_proxies_mutex);
// See if there's already a proxy
proxy = find_proxy (member, bytes);
}
// Possibly create one
if (!proxy)
{
ReadWriteMutex::ScopedWriteLockType lock (m_proxies_mutex);
// Have to search for it again in case someone else added it
proxy = find_proxy (member, bytes);
if (!proxy)
{
// Create a new empty proxy
proxy = new (m_allocator) Proxy (member, bytes);
// Add all current groups to the Proxy.
// We need the group read lock for this (caller provided).
for (Groups::iterator iter = m_groups.begin(); iter != m_groups.end();)
{
Group* group = &(*iter++);
proxy->add (group, *m_allocator);
}
// Add it to the list.
m_proxies.push_front (*proxy);
}
}
// Requires the group read lock
proxy->update (c, m_timestamp);
}
}