本文整理匯總了C++中Destory函數的典型用法代碼示例。如果您正苦於以下問題:C++ Destory函數的具體用法?C++ Destory怎麽用?C++ Destory使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Destory函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ASSERT
void P2PProxySession::OnMessage(talk_base::Message *msg){
ASSERT(signal_thread_->IsCurrent());
switch(msg->message_id){
case DESTORY_SELFT:
{
if(p2p_connection_implementator_ != NULL){
std::cout << "delete p2p connection implementation" << std::endl;
delete p2p_connection_implementator_;
p2p_connection_implementator_ = NULL;
}
if(p2p_proxy_sockets_.size() == 0){
std::cout << "delete proxy p2p session" << std::endl;
p2p_connection_management_->DeleteP2PProxySession(this);
}
break;
}
case CLOSE_ALL_PROXY_SOCKET:
{
break;
}
case SEND_BUFFER_DATA:
{
LOG_P2P(P2P_PROXY_SOCKET_LOGIC) << "Send command data";
if(state_ == P2P_CLOSE)
return ;
//send this string to remote peer
size_t written;
///////////////////////////////////////////////////////////////////
//when p2p connection implementation is NULL, is can't send message
//it is normal but it very important
///////////////////////////////////////////////////////////////////
if(p2p_connection_implementator_ == NULL || command_data_buffers_.empty()){
return ;
}
P2PCommandData *p2p_command_data = command_data_buffers_.front();
p2p_connection_implementator_->Send(0,TCP_SOCKET,
p2p_command_data->data_,p2p_command_data->len_,&written);
if(written == P2PRTSPCOMMAND_LENGTH){
command_data_buffers_.pop();
delete p2p_command_data;
}
break;
}
case RELEASE_ALL:
{
if(p2p_proxy_sockets_.size() == 0)
Destory();
break;
}
case DELAYED_CLOSE:
{
if(state_ == P2P_CLOSING){
state_ = P2P_CLOSE;
Destory();
}
}
}
}
示例2: Destory
void RedBlackTree::Destory(TreeNode *T)
{
if (T != m_pSentinel && T != NULL )
{
Destory(T->left) ;
Destory(T->right) ;
}
}
示例3: Destory
void Destory(HuffmanNode_P<T>*& root)
{
if (root)
{
Destory(root->_left);
Destory(root->_right);
delete root;
root = NULL;
}
}
示例4: Destory
Status Destory(TREE_TYPE* tree) {
if (*tree == NULL)
return OK;
Destory(&((*tree) -> first_child));
Destory(&((*tree) -> next_sibling));
free(*tree);
*tree = NULL;
return OK;
}
示例5: Flush
bool CGameSocket::SendMsg(BYTE* pBuf, int nSize)
{
if (pBuf == NULL || nSize <= 0)
return false;
if (m_sockClient == INVALID_SOCKET)
return false;
// 檢查消息包長度
int nPackSize = 0;
nPackSize = nSize;
// 檢測BUFFER溢出
if (m_nOutBufLen + nSize > OUTBUFSIZE)
{
// 立即發送OUTBUF中的數據,以清空OUTBUF
Flush();
if (m_nOutBufLen + nSize > OUTBUFSIZE)
{
// 出錯了
Destory();
return false;
}
}
// 數據添加到BUF尾
memcpy(m_outBuf + m_nOutBufLen, pBuf, nSize);
m_nOutBufLen += nSize;
Flush();
return true;
}
示例6: Destory
BOOL CThreadSafeCycleBufferEx::Create(LPVOID pBuff,UINT Size,UINT SmoothSize)
{
Destory();
CAutoLockEx FrontLock;
if(m_IsLockFront)
{
FrontLock.Lock(m_FrontLock);
}
CAutoLockEx BackLock;
if(m_IsLockBack)
{
BackLock.Lock(m_BackLock);
}
if(Size<=SmoothSize*2)
{
return FALSE;
}
m_pBuffer=(BYTE *)pBuff;
m_BufferSize=Size-SmoothSize;
m_SmoothSize=SmoothSize;
m_BufferHead=0;
m_BufferTail=0;
m_IsSelfBuffer=false;
return TRUE;
}
示例7: Destory
BOOL CNetPTCPConnection::Create(UINT RecvQueueSize,UINT SendQueueSize)
{
if(GetServer()==NULL)
return FALSE;
Destory();
if(m_pEpollEventRouter==NULL)
{
m_pEpollEventRouter=GetServer()->CreateEventRouter();
m_pEpollEventRouter->Init(this);
}
m_Socket.MakeSocket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(m_SendQueue.GetBufferSize()<SendQueueSize)
{
m_SendQueue.Create(SendQueueSize);
}
else
{
m_SendQueue.Clear();
}
return TRUE;
}
示例8: Destory
AudioInputEngine::~AudioInputEngine(void)
{
if (bInit)
{
Destory();
}
}
示例9: Destory
CDBTransationWorkThread::~CDBTransationWorkThread(void)
{
SS_TRY_BEGIN;
Destory();
SS_TRY_END();
}
示例10: send
bool CGameSocket::Flush()
{
if (m_sockClient == INVALID_SOCKET)
return false;
if (m_nOutBufLen <= 0)
return true;
int nOutSize = send(m_sockClient, m_outBuf, m_nOutBufLen, 0);
//CCLOG("send size: %d", nOutSize);
if (nOutSize > 0)
{
if (m_nOutBufLen - nOutSize > 0)
{
memcpy(m_outBuf, m_outBuf + nOutSize, m_nOutBufLen - nOutSize);
}
m_nOutBufLen -= nOutSize;
assert(m_nOutBufLen >= 0);
return Flush();
}
else
{
if (hasError())
{
Destory();
return false;
}
return true;
}
}
示例11: __DestoryAux
inline void __DestoryAux(ForwardIterator first, ForwardIterator last, __FalseType)
{
while (first < last)
{
Destory(&(*first));
first++;
}
}
示例12: Destory
void ConformalResizing::ConstrainUnits::SetNumber(int _n)
{
Destory();
n = _n;
CmAssert(n != 0);
pnts = new CvPoint2D64f[n];
ind = new int[n];
}
示例13: DeleteChild
Status DeleteChild(TREE_TYPE tree, TREE_NODE* node, int position) {
if (position == 1) {
Destory(&(node -> first_child));
} else {
int order = 1;
TREE_NODE *child = node -> first_child;
while (order < position - 1) {
child = child -> next_sibling;
order++;
}
TREE_NODE *n = child -> next_sibling;
child -> next_sibling = child -> next_sibling -> next_sibling;
n -> next_sibling = NULL;
Destory(&n);
}
return OK;
}
示例14: main
int main(int argc, char *argv[])
{
ST my_st;
my_st = Init_ST();
Create(my_st , "info_file");
Traverse(my_st);
printf("Find the 14 index is %d\n",Search(my_st , 56));
Destory(my_st);
}
示例15: test_Destory
void test_Destory(void) {
BINARY_TREE_TYPE tree = get_test_tree("1,2,3,4,5");
if (tree == NULL)
return;
Status status = Destory(&tree);
CU_ASSERT_EQUAL(status, OK);
CU_ASSERT_PTR_NULL(tree);
}