本文整理汇总了C++中CDXLNode::AddRef方法的典型用法代码示例。如果您正苦于以下问题:C++ CDXLNode::AddRef方法的具体用法?C++ CDXLNode::AddRef怎么用?C++ CDXLNode::AddRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDXLNode
的用法示例。
在下文中一共展示了CDXLNode::AddRef方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//---------------------------------------------------------------------------
// @function:
// CParseHandlerQueryOutput::EndElement
//
// @doc:
// Invoked by Xerces to process a closing tag
//
//---------------------------------------------------------------------------
void
CParseHandlerQueryOutput::EndElement
(
const XMLCh* const, // element_uri,
const XMLCh* const element_local_name,
const XMLCh* const // element_qname
)
{
if(0 != XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenQueryOutput), element_local_name))
{
CWStringDynamic *str = CDXLUtils::CreateDynamicStringFromXMLChArray(m_parse_handler_mgr->GetDXLMemoryManager(), element_local_name);
GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, str->GetBuffer());
}
const ULONG size = this->Length();
for (ULONG ul = 0; ul < size; ul++)
{
CParseHandlerScalarIdent *child_parse_handler = dynamic_cast<CParseHandlerScalarIdent *>((*this)[ul]);
GPOS_ASSERT(NULL != child_parse_handler);
CDXLNode *pdxlnIdent = child_parse_handler->CreateDXLNode();
pdxlnIdent->AddRef();
m_dxl_array->Append(pdxlnIdent);
}
// deactivate handler
m_parse_handler_mgr->DeactivateHandler();
}
示例2:
//---------------------------------------------------------------------------
// @function:
// CParseHandlerOp::AddChildFromParseHandler
//
// @doc:
// Extracts the node constructed from the given parse handler and adds it
// to children array of the current node. Child nodes are ref-counted before
// being added to the array.
//
//---------------------------------------------------------------------------
void
CParseHandlerOp::AddChildFromParseHandler
(
const CParseHandlerOp *pph
)
{
GPOS_ASSERT(NULL != m_pdxln);
GPOS_ASSERT(NULL != pph);
// extract constructed element
CDXLNode *pdxlnChild = pph->Pdxln();
GPOS_ASSERT(NULL != pdxlnChild);
pdxlnChild->AddRef();
m_pdxln->AddChild(pdxlnChild);
}
示例3: CMDPartConstraintGPDB
//---------------------------------------------------------------------------
// @function:
// CParseHandlerMDRelation::EndElement
//
// @doc:
// Invoked by Xerces to process a closing tag
//
//---------------------------------------------------------------------------
void
CParseHandlerMDRelation::EndElement
(
const XMLCh* const, // xmlszUri,
const XMLCh* const xmlszLocalname,
const XMLCh* const // xmlszQname
)
{
if (0 == XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenPartConstraint), xmlszLocalname))
{
CParseHandlerScalarOp *pphPartCnstr = dynamic_cast<CParseHandlerScalarOp *>((*this)[UlLength() - 1]);
CDXLNode *pdxlnPartConstraint = pphPartCnstr->Pdxln();
pdxlnPartConstraint->AddRef();
m_ppartcnstr = GPOS_NEW(m_pmp) CMDPartConstraintGPDB(m_pmp, pdxlnPartConstraint, m_pdrgpulDefaultParts, m_fPartConstraintUnbounded);
return;
}
if (0 != XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenRelation), xmlszLocalname))
{
CWStringDynamic *pstr = CDXLUtils::PstrFromXMLCh(m_pphm->Pmm(), xmlszLocalname);
GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, pstr->Wsz());
}
// construct metadata object from the created child elements
CParseHandlerMetadataColumns *pphMdCol = dynamic_cast<CParseHandlerMetadataColumns *>((*this)[0]);
CParseHandlerMetadataIdList *pphMdidlIndices = dynamic_cast<CParseHandlerMetadataIdList*>((*this)[1]);
CParseHandlerMetadataIdList *pphMdidlTriggers = dynamic_cast<CParseHandlerMetadataIdList*>((*this)[2]);
CParseHandlerMetadataIdList *pphMdidlCheckConstraints = dynamic_cast<CParseHandlerMetadataIdList*>((*this)[3]);
GPOS_ASSERT(NULL != pphMdCol->Pdrgpmdcol());
GPOS_ASSERT(NULL != pphMdidlIndices->Pdrgpmdid());
GPOS_ASSERT(NULL != pphMdidlCheckConstraints->Pdrgpmdid());
// refcount child objects
DrgPmdcol *pdrgpmdcol = pphMdCol->Pdrgpmdcol();
DrgPmdid *pdrgpmdidIndices = pphMdidlIndices->Pdrgpmdid();
DrgPmdid *pdrgpmdidTriggers = pphMdidlTriggers->Pdrgpmdid();
DrgPmdid *pdrgpmdidCheckConstraint = pphMdidlCheckConstraints->Pdrgpmdid();
pdrgpmdcol->AddRef();
pdrgpmdidIndices->AddRef();
pdrgpmdidTriggers->AddRef();
pdrgpmdidCheckConstraint->AddRef();
m_pimdobj = GPOS_NEW(m_pmp) CMDRelationGPDB
(
m_pmp,
m_pmdid,
m_pmdname,
m_fTemporary,
m_erelstorage,
m_ereldistrpolicy,
pdrgpmdcol,
m_pdrgpulDistrColumns,
m_pdrgpulPartColumns,
m_fConvertHashToRandom,
m_pdrgpdrgpulKeys,
pdrgpmdidIndices,
pdrgpmdidTriggers,
pdrgpmdidCheckConstraint,
m_ppartcnstr,
m_fHasOids
);
// deactivate handler
m_pphm->DeactivateHandler();
}