本文整理汇总了C++中BReference::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ BReference::Get方法的具体用法?C++ BReference::Get怎么用?C++ BReference::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BReference
的用法示例。
在下文中一共展示了BReference::Get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static void
print_socket_line(net_socket_private* socket, const char* prefix)
{
BReference<net_socket_private> parent = socket->parent.GetReference();
kprintf("%s%p %2d.%2d.%2d %6ld %p %p %p%s\n", prefix, socket,
socket->family, socket->type, socket->protocol, socket->owner,
socket->first_protocol, socket->first_info, parent.Get(),
parent.Get() != NULL ? socket->is_connected ? " (c)" : " (p)" : "");
}
示例2: _ParseLinkAddress
status_t
BNetworkAddress::SetTo(int family, const char* host, const char* service,
uint32 flags)
{
if (family == AF_LINK) {
if (service != NULL)
return B_BAD_VALUE;
return _ParseLinkAddress(host);
// SetToLinkAddress takes care of setting fStatus
}
BReference<const BNetworkAddressResolver> resolver
= BNetworkAddressResolver::Resolve(family, host, service, flags);
if (resolver.Get() == NULL)
return B_NO_MEMORY;
status_t status = resolver->InitCheck();
if (status != B_OK)
return status;
uint32 cookie = 0;
status = resolver->GetNextAddress(&cookie, *this);
if (status != B_OK)
Unset();
fHostName = host;
fStatus = status;
return status;
}
示例3:
status_t
BNetworkAddress::SetTo(const char* host, const char* service, uint32 flags)
{
BReference<const BNetworkAddressResolver> resolver
= BNetworkAddressResolver::Resolve(host, service, flags);
if (resolver.Get() == NULL)
return B_NO_MEMORY;
status_t status = resolver->InitCheck();
if (status != B_OK)
return status;
// Prefer IPv6 addresses
uint32 cookie = 0;
status = resolver->GetNextAddress(AF_INET6, &cookie, *this);
if (status != B_OK) {
cookie = 0;
status = resolver->GetNextAddress(&cookie, *this);
if (status != B_OK)
Unset();
}
fHostName = host;
fStatus = status;
return status;
}
示例4:
bool
SATGroup::RemoveWindow(SATWindow* window, bool stayBelowMouse)
{
if (!fSATWindowList.RemoveItem(window))
return false;
// We need the area a little bit longer because the area could hold the
// last reference to the group.
BReference<WindowArea> area = window->GetWindowArea();
if (area.Get() != NULL)
area->_RemoveWindow(window);
window->RemovedFromGroup(this, stayBelowMouse);
if (CountItems() >= 2)
WindowAt(0)->DoGroupLayout();
return true;
}
示例5: _ParseLinkAddress
status_t
BNetworkAddress::SetTo(int family, const char* host, uint16 port, uint32 flags)
{
if (family == AF_LINK) {
if (port != 0)
return B_BAD_VALUE;
return _ParseLinkAddress(host);
}
BReference<const BNetworkAddressResolver> resolver
= BNetworkAddressResolver::Resolve(family, host, port, flags);
if (resolver.Get() == NULL)
return B_NO_MEMORY;
status_t status = resolver->InitCheck();
if (status != B_OK)
return status;
uint32 cookie = 0;
return resolver->GetNextAddress(&cookie, *this);
}
示例6:
status_t
BNetworkAddress::SetTo(const char* host, uint16 port, uint32 flags)
{
BReference<const BNetworkAddressResolver> resolver
= BNetworkAddressResolver::Resolve(host, port, flags);
if (resolver.Get() == NULL)
return B_NO_MEMORY;
status_t status = resolver->InitCheck();
if (status != B_OK)
return status;
// Prefer IPv6 addresses
uint32 cookie = 0;
status = resolver->GetNextAddress(AF_INET6, &cookie, *this);
if (status == B_OK)
return B_OK;
cookie = 0;
return resolver->GetNextAddress(&cookie, *this);
}
示例7: _
/*! The socket has been aborted. Steals the parent's reference, and releases
it.
*/
status_t
socket_aborted(net_socket* _socket)
{
net_socket_private* socket = (net_socket_private*)_socket;
TRACE("socket_aborted(%p)\n", socket);
BReference<net_socket_private> parent = socket->parent.GetReference();
if (parent.Get() == NULL)
return B_BAD_VALUE;
MutexLocker _(parent->lock);
if (socket->is_connected)
parent->connected_children.Remove(socket);
else
parent->pending_children.Remove(socket);
parent->child_count--;
socket->RemoveFromParent();
return B_OK;
}