本文整理汇总了C++中auto_ptr::RemoveTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ auto_ptr::RemoveTarget方法的具体用法?C++ auto_ptr::RemoveTarget怎么用?C++ auto_ptr::RemoveTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auto_ptr
的用法示例。
在下文中一共展示了auto_ptr::RemoveTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testSendBlob
/**
* Check that we send OSC messages correctly.
*/
void OSCNodeTest::testSendBlob() {
// First up create a UDP socket to receive the messages on.
// Port 0 means 'ANY'
IPV4SocketAddress socket_address(IPV4Address::Loopback(), 0);
// Bind the socket, set the callback, and register with the select server.
OLA_ASSERT_TRUE(m_udp_socket.Bind(socket_address));
m_udp_socket.SetOnData(NewCallback(this, &OSCNodeTest::UDPSocketReady));
OLA_ASSERT_TRUE(m_ss.AddReadDescriptor(&m_udp_socket));
// Store the local address of the UDP socket so we know where to tell the
// OSCNode to send to.
OLA_ASSERT_TRUE(m_udp_socket.GetSocketAddress(&socket_address));
// Setup the OSCTarget pointing to the local socket address
OSCTarget target(socket_address, TEST_OSC_ADDRESS);
// Add the target to the node.
m_osc_node->AddTarget(TEST_GROUP, target);
// Send the data
OLA_ASSERT_TRUE(m_osc_node->SendData(TEST_GROUP, OSCNode::FORMAT_BLOB,
m_dmx_data));
// Run the SelectServer this will return either when UDPSocketReady
// completes, or the abort timeout triggers.
m_ss.Run();
// Remove target
OLA_ASSERT_TRUE(m_osc_node->RemoveTarget(TEST_GROUP, target));
// Try to remove it a second time
OLA_ASSERT_FALSE(m_osc_node->RemoveTarget(TEST_GROUP, target));
// Try to remove the target from a group that doesn't exist
OLA_ASSERT_FALSE(m_osc_node->RemoveTarget(TEST_GROUP + 1, target));
}