本文整理汇总了C++中TibrvMsg::attach方法的典型用法代码示例。如果您正苦于以下问题:C++ TibrvMsg::attach方法的具体用法?C++ TibrvMsg::attach怎么用?C++ TibrvMsg::attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TibrvMsg
的用法示例。
在下文中一共展示了TibrvMsg::attach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TibrvMsg
TibrvMsg*
TibrvMsg::detach()
{
if ((_detached == TIBRV_TRUE) || (_status != TIBRV_OK))
return NULL;
// allocate new object
TibrvMsg * newmsg = new TibrvMsg();
if (newmsg == NULL) return NULL;
// detach if not yet detached
if (_detached == TIBRV_FALSE) // this is redundand but may be needed
{
TibrvStatus status;
if (_msg != NULL)
{
if ((status = tibrvMsg_Detach(_msg)) != TIBRV_OK)
{
delete newmsg;
return NULL;
}
}
_detached = TIBRV_TRUE;
}
newmsg->attach(_msg,TIBRV_TRUE);
// invalidate this handle so we won't try to delete it
_msg=NULL;
_status = TIBRV_NOT_INITIALIZED;
_detached = TIBRV_TRUE;
return newmsg;
}
示例2:
TibrvStatus
TibrvMsg::createCopy(TibrvMsg& copy)
{
_create();
if (_status != TIBRV_OK) return _status;
tibrvMsg newmsg;
tibrv_status status = tibrvMsg_CreateCopy(_msg,&newmsg);
if (status == TIBRV_OK)
copy.attach(newmsg,TIBRV_TRUE);
return status;
}