本文整理汇总了C++中DoublyLinkedList::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ DoublyLinkedList::Add方法的具体用法?C++ DoublyLinkedList::Add怎么用?C++ DoublyLinkedList::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DoublyLinkedList
的用法示例。
在下文中一共展示了DoublyLinkedList::Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new
net_protocol*
l2cap_init_protocol(net_socket* socket)
{
L2capEndpoint* protocol = new(std::nothrow) L2capEndpoint(socket);
if (protocol == NULL)
return NULL;
EndpointList.Add(protocol);
debugf("Prococol created %p\n", protocol);
return protocol;
}
示例2: new
net_protocol*
l2cap_init_protocol(net_socket* socket)
{
flowf("\n");
L2capEndpoint* protocol = new(std::nothrow) L2capEndpoint(socket);
if (protocol == NULL)
return NULL;
EndpointList.Add(protocol);
return protocol;
}
示例3: _
status_t
ethernet_up(net_device *_device)
{
ethernet_device *device = (ethernet_device *)_device;
device->fd = open(device->name, O_RDWR);
if (device->fd < 0)
return errno;
uint64 dummy;
if (ioctl(device->fd, ETHER_INIT, &dummy, sizeof(dummy)) < 0)
goto err;
if (ioctl(device->fd, ETHER_GETADDR, device->address.data, ETHER_ADDRESS_LENGTH) < 0)
goto err;
if (ioctl(device->fd, ETHER_GETFRAMESIZE, &device->frame_size, sizeof(uint32)) < 0) {
// this call is obviously optional
device->frame_size = ETHER_MAX_FRAME_SIZE;
}
if (update_link_state(device, false) == B_OK) {
// device supports retrieval of the link state
// Set the change notification semaphore; doesn't matter
// if this is supported by the device or not
ioctl(device->fd, ETHER_SET_LINK_STATE_SEM, &sLinkChangeSemaphore,
sizeof(sem_id));
MutexLocker _(&sListLock);
if (sCheckList.IsEmpty()) {
// start thread
sLinkCheckerThread = spawn_kernel_thread(ethernet_link_checker,
"ethernet link state checker", B_LOW_PRIORITY, NULL);
if (sLinkCheckerThread >= B_OK)
resume_thread(sLinkCheckerThread);
}
sCheckList.Add(device);
}
device->address.length = ETHER_ADDRESS_LENGTH;
device->mtu = device->frame_size - device->header_length;
return B_OK;
err:
close(device->fd);
device->fd = -1;
return errno;
}
示例4: AddChild
void AddChild(Attribute* child)
{
children.Add(child);
}