当前位置: 首页>>代码示例>>C++>>正文


C++ DoublyLinkedList::Add方法代码示例

本文整理汇总了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;
}
开发者ID:mmadia,项目名称:haiku-1,代码行数:12,代码来源:l2cap.cpp

示例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;
}
开发者ID:mmanley,项目名称:Antares,代码行数:13,代码来源:l2cap.cpp

示例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;
}
开发者ID:luciang,项目名称:haiku,代码行数:51,代码来源:ethernet.cpp

示例4: AddChild

	void AddChild(Attribute* child)
	{
		children.Add(child);
	}
开发者ID:mmanley,项目名称:Antares,代码行数:4,代码来源:PackageWriter.cpp


注:本文中的DoublyLinkedList::Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。