本文整理汇总了C++中CHECK_POINTER函数的典型用法代码示例。如果您正苦于以下问题:C++ CHECK_POINTER函数的具体用法?C++ CHECK_POINTER怎么用?C++ CHECK_POINTER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CHECK_POINTER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CHECK_POINTER
// 获取排序的枚举型
IVS_BOOL CDevEnum::GetOrderTypeBool( const IVS_CHAR* pLoginType )
{
CHECK_POINTER(pLoginType, IVS_OPERATE_MEMORY_ERROR);
if (0 == strcmp(pLoginType, "DOWN"))
{
return TRUE;
}
return FALSE;
}
示例2: CHECK_POINTER
CString CWebPage::GetHTMLContent()
{
CHECK_POINTER(m_spDoc);
CComPtr<IHTMLElement> pBody;
VERIFY(SUCCEEDED(m_spDoc->get_body(&pBody)));
CComBSTR content;
VERIFY(SUCCEEDED(pBody->get_innerHTML(&content)));
return CString(content);
}
示例3: CHECK_POINTER
// 直接解析NSS头,返回一个结果码
int CNSSOperator::ParseCmd2NSS(CCmd* pCmd)
{
CHECK_POINTER(pCmd, IVS_FAIL); //add by xiongfeng00192614
CNssMsgBase nssMsg;
uint32_t iRet = nssMsg.decode(pCmd->GetMsgBlock());
if(NssRet_Succeed != iRet)
{
BP_RUN_LOG_ERR(IVS_FAIL,"decode cmd failed", "iRet = %d", iRet);
return IVS_FAIL; //modify by xiongfeng00192614 错误返回NULL (0)会被误认为成功
}
return nssMsg.GetHeader().uiRspCode; //lint !e10 !e713 无此问题
}//lint !e1762
示例4: BP_RUN_LOG_INF
// 推送发现到的前端设备
int CSDKMainctrl::OnDisCoveredDevNotify(CCmd* pCmd)const
{
BP_RUN_LOG_INF("OnDisCoveredDevNotify", "Begin");
CHECK_POINTER(pCmd, IVS_OPERATE_MEMORY_ERROR);
IVS_CHAR* pData = CSDKMainService::ProcessDevNotify(pCmd);
CHECK_POINTER(pData, IVS_OPERATE_MEMORY_ERROR);
int iSessionID = CLinkRouteMgr::instance().FindSessionIDByLinkID(pCmd->GetNetLinkID()); //lint !e1013 !e1055 !e746 !e64
if (SDK_SESSIONID_INIT == iSessionID)
{
BP_RUN_LOG_ERR(IVS_SDK_RET_INVALID_SESSION_ID, "linkage action", "iSessionID is -1");
IVS_DELETE(pData, MUILI);
return IVS_FAIL;
}
CEventCallBackJob::instance().PostEvent(iSessionID, IVS_EVENT_FIND_DEVICE, pData, static_cast<IVS_INT32>(strlen(pData)) + 1);
IVS_DELETE(pData, MUILI);
BP_RUN_LOG_INF("OnDisCoveredDevNotify", "End");
return IVS_SUCCEED;
}
示例5: CHECK_POINTER
IVS_ULONG CWindowSkinXML::TitleBarGetBackGround(std::string &strBGPtth)
{
strBGPtth.clear();
TiXmlElement * pChildElement = nullptr;
CHECK_POINTER(m_pTitleBarRootElement,IVS_FAIL);
pChildElement = m_pTitleBarRootElement->FirstChildElement("BackGround");
CHECK_POINTER(pChildElement,IVS_FAIL);
pChildElement = pChildElement->FirstChildElement("Picture");
CHECK_POINTER(pChildElement,IVS_FAIL);
TiXmlNode *pChildNode = nullptr;
pChildNode = pChildElement->FirstChild();
CHECK_POINTER(pChildNode,IVS_FAIL);
const TCHAR * pc = pChildNode->Value();
(void)strBGPtth.append(pc);
return IVS_SUCCEED;
}
示例6: CHECK_POINTER
// 通用请求XML增加QueryField字段
IVS_INT32 CXmlProcess::AddQueryFieldForUnifiedFormatQueryXML(const IVS_CHAR* pField,const IVS_CHAR* pValue, CXml& xmlReq)
{
CHECK_POINTER(pField, IVS_OPERATE_MEMORY_ERROR);
CHECK_POINTER(pValue, IVS_OPERATE_MEMORY_ERROR);
std::string sQueryType = "EXACT";
if (xmlReq.FindElemEx("Content/PageInfo/QueryCond/QueryField"))
{
xmlReq.OutOfElem();
(void)xmlReq.AddElem("QueryField");
(void)xmlReq.AddChildElem("Field");
(void)xmlReq.IntoElem();
(void)xmlReq.SetElemValue(pField);
(void)xmlReq.AddElem("Value");
(void)xmlReq.SetElemValue(pValue);
(void)xmlReq.AddElem("QueryType");
(void)xmlReq.SetElemValue(sQueryType.c_str());
xmlReq.OutOfElem();
}
return IVS_SUCCEED;
}
示例7: CHECK_POINTER
/**************************************************************************
* name : Parse
* description: 解析一个xml流到xml文件
* input : pszStream xml流
* output : NA
* return : true - 成功,false - 失败
* remark : NA
**************************************************************************/
bool CXml::Parse(const char *pszStream, TiXmlEncoding encode)
{
CHECK_POINTER(pszStream, false);
//songyiqun
SAFE_DELETE(m_pXMlDoc);
SAFE_NEW(m_pXMlDoc, TiXmlDocument);//lint !e774
CHECK_POINTER(m_pXMlDoc, false);//lint !e774
//TIXML_ENCODING_LEGACY为Tinyxml使用的编码方式
(void)(m_pXMlDoc->Parse(pszStream, NULL, encode));
if (0 != m_pXMlDoc->Error())
{
return false;
}
GetRootPos();
return true;
}
示例8: SearchContact
int UCSDK_CALL SearchContact(const char* condition, const char* deptid,
int querysubdept, int offset, int count, int ordertype,
int* recamount, UCContactList* memberList)
{
DEBUG_LOG() << "--- ENTER";
CHECK_POINTER(memberList, UC_InvalidParam);
CHECK_POINTER(condition, UC_InvalidParam);
CHECK_POINTER(deptid, UC_InvalidParam);
CHECK_POINTER(recamount, UC_InvalidParam);
UCContactMgrAbsProxy* pUCContactMgrAbsProxy = UCContactMgrAbsProxy::GetInstance();
CHECK_POINTER(pUCContactMgrAbsProxy, UC_NullPoint);
bool querysub = true;
if (0 == querysubdept)
{
querysub = false;
}
UCSDKContactList contactlist;
int iRet = pUCContactMgrAbsProxy->SearchContact(contactlist, condition, deptid, querysub, offset, count, ordertype, *recamount);
CHECK_RETURN(iRet, UC_Succ, "SearchContact");
int iFoundCount = (int)contactlist.size();
int iEnd = iFoundCount;
if (iFoundCount > count)
{
WARN_LOG() << "contactlist's size is large than count.";
iEnd = count;
}
for (int i=0; i<iEnd; i++)
{
UCStructCopy::Copy_UCContact(memberList->contact[i], contactlist[(unsigned int)i]);
}
memberList->iFrom = 0;
memberList->iTo = iEnd-1;
memberList->iTotal = iFoundCount;
DEBUG_LOG() << "--- LEAVE";
return UC_Succ;
}
示例9: CHECK_POINTER
// 删除角色
IVS_INT32 CRoleMgr::DeleteRole(const IVS_CHAR* pDomainCode, IVS_UINT32 uiRoleID)
{
CHECK_POINTER(m_UserMgr, IVS_OPERATE_MEMORY_ERROR);
IVS_DEBUG_TRACE("");
std::string strDomainCode;
if(NULL == pDomainCode || '\0' == pDomainCode[0])
{
m_UserMgr->GetDomainCode(strDomainCode);
}
else
{
strDomainCode = pDomainCode;
}
IVS_ROLE_INFO pRoleInfo;
memset(&pRoleInfo, 0, sizeof(IVS_ROLE_INFO));
pRoleInfo.uiRoleID = uiRoleID;
//拼接请求信息
IVS_INT32 iRet = IVS_FAIL;
CXml xmlReq;
CUserInfoMgrXMLProcess::GetRoleXML(strDomainCode.c_str(), &pRoleInfo, xmlReq);
unsigned int xmlLen = 0;
const IVS_CHAR* pReq = xmlReq.GetXMLStream(xmlLen);
CHECK_POINTER(pReq, IVS_OPERATE_MEMORY_ERROR);
// 构造带域的请求消息,并发送
CSendNssMsgInfo sendNssMsgInfo;
sendNssMsgInfo.SetNeedXml(TYPE_NSS_NOXML);
sendNssMsgInfo.SetNetElemType(NET_ELE_SMU_NSS);
sendNssMsgInfo.SetReqID(NSS_DEL_ROLE_REQ);
sendNssMsgInfo.SetReqData(pReq);
sendNssMsgInfo.SetDomainCode(strDomainCode);
std::string strpRsp;
IVS_INT32 iNeedRedirect = IVS_FAIL;
iRet = m_UserMgr->SendCmd(sendNssMsgInfo,strpRsp,iNeedRedirect);
return iRet;
}
示例10: IVS_DEBUG_TRACE
IVS_INT32 CReportMgr::SendQueryCmd(const IVS_CHAR* pReqXml, IVS_CHAR** pRspXml, IVS_INT32 iMsgType, IVS_INT32 iTimeOut)
{
IVS_DEBUG_TRACE("");
CHECK_POINTER(pReqXml, IVS_OPERATE_MEMORY_ERROR);
CHECK_POINTER(m_UserMgr, IVS_OPERATE_MEMORY_ERROR);
IVS_INT32 iRet = IVS_FAIL;
std::string strLocalDomainLink;
iRet = m_UserMgr->GetLocalDomainLinkID(NET_ELE_OMU_NSS, strLocalDomainLink);
if (IVS_SUCCEED != iRet)
{
BP_RUN_LOG_ERR(iRet, "Send Query Cmd", "Get Local Domain OMU Link Failed");
return iRet;
}
CCmd *pCmd = CNSSOperator::instance().BuildOMUCmd(iMsgType, pReqXml, strLocalDomainLink);
CHECK_POINTER(pCmd, IVS_OPERATE_MEMORY_ERROR);
CCmd* pRspCmd =NULL;
if (0 < iTimeOut)
{
// 1表示不采用默认的超时时间,即用iTimeOut
pRspCmd = CNSSOperator::instance().SendSyncCmd(pCmd, (IVS_UINT32)iTimeOut, 1);
}
else
{
pRspCmd = CNSSOperator::instance().SendSyncCmd(pCmd);
}
if (NULL == pRspCmd)
{
BP_RUN_LOG_ERR(IVS_NET_RECV_TIMEOUT, "Send Query Cmd", "pRspCmd is NULL");
return IVS_NET_RECV_TIMEOUT;
}
iRet = IVS_SUCCEED;
*pRspXml = CNSSOperator::instance().ParseCmd2XML(pRspCmd, iRet);
HW_DELETE(pRspCmd);
return iRet;
}//lint !e1762
示例11: CHECK_POINTER
IVS_INT32 CDomainRouteMgr::SendCmdAndGetInfo(CXml& xmlRsp) const
{
IVS_INT32 iRet = IVS_FAIL;
CHECK_POINTER(m_pUserMgr,IVS_OPERATE_MEMORY_ERROR);
// 获取本域SMU连接
std::string strSMULinkID;
IVS_INT32 iGetLinkRet = m_pUserMgr->GetLocalDomainLinkID(NET_ELE_SMU_NSS, strSMULinkID);
if (IVS_SUCCEED != iGetLinkRet)
{
BP_RUN_LOG_ERR(iGetLinkRet, "Get LocalDomainLinkID failed", "NA");
return iGetLinkRet;
}
//创建要发送的CMD,拼装了NSS消息头
CCmd* pCmd = CNSSOperator::instance().BuildSMUCmd(NSS_GET_DOMAIN_ROUTE_REQ, NULL, strSMULinkID);
CHECK_POINTER(pCmd, IVS_OPERATE_MEMORY_ERROR);
//发送消息
CCmd *pCmdRsp = CNSSOperator::instance().SendSyncCmd(pCmd);
CHECK_POINTER(pCmdRsp, IVS_NET_RECV_TIMEOUT);
const IVS_CHAR* pRsp = CNSSOperator::instance().ParseCmd2XML(pCmdRsp, iRet);
HW_DELETE(pCmdRsp);
CHECK_POINTER(pRsp, iRet);
if (IVS_SUCCEED != iRet)
{
BP_RUN_LOG_INF("Send Command get return value", " Error");
IVS_DELETE(pRsp, MUILI); //lint !e605
return IVS_FAIL;
}
iRet = IVS_XML_INVALID;
BP_RUN_LOG_INF("Get domain route ", "pRsp:%s", pRsp);
if (xmlRsp.Parse(pRsp))
{
iRet = IVS_SUCCEED;
}
IVS_DELETE(pRsp, MUILI); //lint !e605
return iRet;
}
示例12: CHECK_POINTER
// add by zwx211831, Date:20140605 处理客户端关闭视频业务通知
int CSDKMainctrl::OnShutdownStreamNotify(CCmd* pCmd) const
{
CHECK_POINTER(pCmd, IVS_OPERATE_MEMORY_ERROR);
IVS_INT32 iRet = IVS_FAIL;
IVS_CHAR *pInfo = CNSSOperator::instance().ParseCmd2XML(pCmd, iRet);
CHECK_POINTER(pInfo, IVS_OPERATE_MEMORY_ERROR);
IVS_SHUTDOWN_NOTIFY_INFO stShutdownNotifyInfo = {0};
if (IVS_SUCCEED == iRet)
{
CXml xmlRsp;
if (!xmlRsp.Parse(pInfo))
{
BP_RUN_LOG_ERR(IVS_XML_INVALID, "OnShutdownStreamNotify", "XML parse failed");
HW_DELETE_A(pInfo);
return IVS_XML_INVALID;
}
iRet = CRealXMLProcess::ParseShutdownNotifyXML(xmlRsp, &stShutdownNotifyInfo);
}
if (IVS_SUCCEED != iRet)
{
BP_RUN_LOG_ERR(IVS_XML_INVALID, "OnShutdownStreamNotify", "XML parse failed");
HW_DELETE_A(pInfo);
return IVS_XML_INVALID;
}
IVS_INT32 iSessionID = CLinkRouteMgr::instance().FindSessionIDByLinkID(pCmd->GetNetLinkID());
if (SDK_SESSIONID_INIT == iSessionID)
{
BP_RUN_LOG_ERR(IVS_SDK_RET_INVALID_SESSION_ID, "OnShutdownStreamNotify", "iSessionID is -1");
HW_DELETE_A(pInfo);
return IVS_SDK_RET_INVALID_SESSION_ID;
}
(void)CEventCallBackJob::instance().PostEvent(iSessionID, IVS_EVENT_SHUTDOWN_STREAM, &stShutdownNotifyInfo, sizeof(stShutdownNotifyInfo));
HW_DELETE_A(pInfo);
return IVS_SUCCEED;
}
示例13: CHECK_POINTER
// 修改设备组名称
IVS_INT32 CDeviceGroupMgr::ModifyDeviceGroupName(const IVS_CHAR* pDomainCode,
IVS_UINT32 uiDevGroupID,
const IVS_CHAR* pNewDevGroupName)const
{
CHECK_POINTER(pDomainCode, IVS_OPERATE_MEMORY_ERROR);
CHECK_POINTER(pNewDevGroupName, IVS_OPERATE_MEMORY_ERROR);
IVS_DEBUG_TRACE("");
CXml xmlReq;
// 组装xml,准备发送给smu
IVS_INT32 iRet = CDeviceMgrXMLProcess::ModifyDeviceGroupGetXML(pDomainCode, uiDevGroupID, pNewDevGroupName, xmlReq);
IVS_CHAR cDomainCode[IVS_DOMAIN_CODE_LEN + 1] = {0};
if (!CToolsHelp::Memcpy(cDomainCode, IVS_DOMAIN_CODE_LEN, pDomainCode, IVS_DOMAIN_CODE_LEN))
{
BP_RUN_LOG_ERR(IVS_ALLOC_MEMORY_ERROR, "Memcpy(cDomainCode, IVS_DOMAIN_CODE_LEN, pDomainCode, IVS_DOMAIN_CODE_LEN) fail", "NA");
return IVS_ALLOC_MEMORY_ERROR;
}
iRet = CXmlProcess::GetCommSendMgr(xmlReq, m_pUserMgr, NSS_MOD_DEV_GROUP_REQ, BUILDRET, cDomainCode);
return iRet;
}
示例14: realloc
void TextProperty::addElement(IsoString elementName, IsoString value) {
IText* tp = ((ITextVectorProperty*) m_property->getProperty())->tp;
int ntp = ((ITextVectorProperty*) m_property->getProperty())->ntp;
tp = (IText*) realloc(tp, (ntp + 1) * sizeof(IText));
CHECK_POINTER(tp);
strcpy(tp->name, elementName.c_str());
//FIXME Leaks memory?
tp->text = (char*) malloc(sizeof(value.c_str()));
strcpy(tp->text, value.c_str());
tp->tvp = (ITextVectorProperty*) m_property->getProperty();
((ITextVectorProperty*) m_property->getProperty())->ntp++;
((ITextVectorProperty*) m_property->getProperty())->tp = tp;
}
示例15: switch
IProperty* PropertyFactory::create(INDI::Property* property,INDI_TYPE type){
property->setType(type);
switch(type){
case INDI_NUMBER:
{
INumberVectorProperty* nProperty = new INumberVectorProperty();
CHECK_POINTER(nProperty);
property->setProperty(nProperty);
return new NumberProperty(property);
break;
}
case INDI_TEXT:
{
ITextVectorProperty* tProperty = new ITextVectorProperty();
CHECK_POINTER(tProperty);
property->setProperty(tProperty);
return new TextProperty(property);
break;
}
case INDI_SWITCH:
{
ISwitchVectorProperty* sProperty = new ISwitchVectorProperty();
CHECK_POINTER(sProperty);
property->setProperty(sProperty);
return new SwitchProperty(property);
break;
}
case INDI_LIGHT:
{
ILightVectorProperty* lProperty = new ILightVectorProperty();
CHECK_POINTER(lProperty);
property->setProperty(lProperty);
return new LightProperty(property);
break;
}
default:
throw FatalError(ERR_MSG("Unknown property."));
}
}