本文整理汇总了C++中CDXLNode类的典型用法代码示例。如果您正苦于以下问题:C++ CDXLNode类的具体用法?C++ CDXLNode怎么用?C++ CDXLNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CDXLNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLPhysicalRandomMotion::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLPhysicalRandomMotion::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
) const
{
// assert proj list and filter are valid
CDXLPhysical::AssertValid(pdxln, fValidateChildren);
GPOS_ASSERT(m_pdrgpiInputSegIds != NULL);
GPOS_ASSERT(0 < m_pdrgpiInputSegIds->UlLength());
GPOS_ASSERT(m_pdrgpiOutputSegIds != NULL);
GPOS_ASSERT(0 < m_pdrgpiOutputSegIds->UlLength());
GPOS_ASSERT(EdxlrandommIndexSentinel == pdxln->UlArity());
CDXLNode *pdxlnChild = (*pdxln)[EdxlrandommIndexChild];
GPOS_ASSERT(EdxloptypePhysical == pdxlnChild->Pdxlop()->Edxloperatortype());
if (fValidateChildren)
{
pdxlnChild->Pdxlop()->AssertValid(pdxlnChild, fValidateChildren);
}
}
示例2: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLScalarWindowFrameEdge::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLScalarWindowFrameEdge::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
)
const
{
const ULONG ulArity = pdxln->UlArity();
GPOS_ASSERT(1 >= ulArity);
GPOS_ASSERT_IMP((m_edxlfb == EdxlfbBoundedPreceding || m_edxlfb == EdxlfbBoundedFollowing
|| m_edxlfb == EdxlfbDelayedBoundedPreceding || m_edxlfb == EdxlfbDelayedBoundedFollowing), 1 == ulArity);
GPOS_ASSERT_IMP((m_edxlfb == EdxlfbUnboundedPreceding || m_edxlfb == EdxlfbUnboundedFollowing || m_edxlfb == EdxlfbCurrentRow), 0 == ulArity);
for (ULONG ul = 0; ul < ulArity; ++ul)
{
CDXLNode *pdxlnArg = (*pdxln)[ul];
GPOS_ASSERT(EdxloptypeScalar == pdxlnArg->Pdxlop()->Edxloperatortype());
if (fValidateChildren)
{
pdxlnArg->Pdxlop()->AssertValid(pdxlnArg, fValidateChildren);
}
}
}
示例3: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLScalarBitmapBoolOp::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLScalarBitmapBoolOp::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
)
const
{
EdxlBitmapBoolOp edxlbitmapboolop = ((CDXLScalarBitmapBoolOp *) pdxln->Pdxlop())->Edxlbitmapboolop();
GPOS_ASSERT( (edxlbitmapboolop == EdxlbitmapAnd) || (edxlbitmapboolop == EdxlbitmapOr));
ULONG ulArity = pdxln->UlArity();
GPOS_ASSERT(2 == ulArity);
for (ULONG ul = 0; ul < ulArity; ++ul)
{
CDXLNode *pdxlnArg = (*pdxln)[ul];
Edxlopid edxlop = pdxlnArg->Pdxlop()->Edxlop();
GPOS_ASSERT(EdxlopScalarBitmapBoolOp == edxlop || EdxlopScalarBitmapIndexProbe == edxlop);
if (fValidateChildren)
{
pdxlnArg->Pdxlop()->AssertValid(pdxlnArg, fValidateChildren);
}
}
}
示例4: PstrOpName
//---------------------------------------------------------------------------
// @function:
// CDXLPhysicalLimit::SerializeToDXL
//
// @doc:
// Serialize operator in DXL format
//
//---------------------------------------------------------------------------
void
CDXLPhysicalLimit::SerializeToDXL
(
CXMLSerializer *pxmlser,
const CDXLNode *pdxln
)
const
{
const CWStringConst *pstrElemName = PstrOpName();
pxmlser->OpenElement(CDXLTokens::PstrToken(EdxltokenNamespacePrefix), pstrElemName);
// serialize properties
pdxln->SerializePropertiesToDXL(pxmlser);
// serialize children nodes
const DrgPdxln *pdrgpdxln = pdxln->PdrgpdxlnChildren();
GPOS_ASSERT(4 == pdxln->UlArity());
// serialize the first two children: target-list and plan
for (ULONG i = 0; i < 4; i++)
{
CDXLNode *pdxlnChild = (*pdrgpdxln)[i];
pdxlnChild->SerializeToDXL(pxmlser);
}
pxmlser->CloseElement(CDXLTokens::PstrToken(EdxltokenNamespacePrefix), pstrElemName);
}
示例5: GPOS_RAISE
//---------------------------------------------------------------------------
// @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();
}
示例6: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLScalarBoolExpr::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLScalarBoolExpr::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
)
const
{
EdxlBoolExprType edxlbooltype = ((CDXLScalarBoolExpr *) pdxln->Pdxlop())->EdxlBoolType();
GPOS_ASSERT( (edxlbooltype == Edxlnot) || (edxlbooltype == Edxlor) || (edxlbooltype == Edxland));
const ULONG ulArity = pdxln->UlArity();
if(edxlbooltype == Edxlnot)
{
GPOS_ASSERT(1 == ulArity);
}
else
{
GPOS_ASSERT(2 <= ulArity);
}
for (ULONG ul = 0; ul < ulArity; ++ul)
{
CDXLNode *pdxlnArg = (*pdxln)[ul];
GPOS_ASSERT(EdxloptypeScalar == pdxlnArg->Pdxlop()->Edxloperatortype());
if (fValidateChildren)
{
pdxlnArg->Pdxlop()->AssertValid(pdxlnArg, fValidateChildren);
}
}
}
示例7: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLPhysicalIndexScan::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLPhysicalIndexScan::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
)
const
{
// assert proj list and filter are valid
CDXLPhysical::AssertValid(pdxln, fValidateChildren);
// index scan has only 3 children
GPOS_ASSERT(3 == pdxln->UlArity());
// assert validity of the index descriptor
GPOS_ASSERT(NULL != m_pdxlid);
GPOS_ASSERT(NULL != m_pdxlid->Pmdname());
GPOS_ASSERT(m_pdxlid->Pmdname()->Pstr()->FValid());
// assert validity of the table descriptor
GPOS_ASSERT(NULL != m_pdxltabdesc);
GPOS_ASSERT(NULL != m_pdxltabdesc->Pmdname());
GPOS_ASSERT(m_pdxltabdesc->Pmdname()->Pstr()->FValid());
CDXLNode *pdxlnIndexConds = (*pdxln)[EdxlisIndexCondition];
// assert children are of right type (physical/scalar)
GPOS_ASSERT(EdxlopScalarIndexCondList == pdxlnIndexConds->Pdxlop()->Edxlop());
if (fValidateChildren)
{
pdxlnIndexConds->Pdxlop()->AssertValid(pdxlnIndexConds, fValidateChildren);
}
}
示例8: str
//---------------------------------------------------------------------------
// @function:
// CParseHandlerTest::EresParseAndSerializePlan
//
// @doc:
// Verifies that after parsing the given DXL file into a DXL tree,
// it will be serialized back to the same string.
//
//---------------------------------------------------------------------------
GPOS_RESULT
CParseHandlerTest::EresParseAndSerializePlan
(
IMemoryPool *pmp,
const CHAR *szDXLFileName,
BOOL fValidate
)
{
CWStringDynamic str(pmp);
COstreamString oss(&str);
// read DXL file
CHAR *szDXL = CDXLUtils::SzRead(pmp, szDXLFileName);
GPOS_CHECK_ABORT;
const CHAR *szValidationPath = NULL;
if (fValidate)
{
szValidationPath = CTestUtils::m_szXSDPath;
}
// the root of the parsed DXL tree
ULLONG ullPlanId = ULLONG_MAX;
ULLONG ullPlanSpaceSize = ULLONG_MAX;
CDXLNode *pdxlnRoot = CDXLUtils::PdxlnParsePlan(pmp, szDXL, szValidationPath, &ullPlanId, &ullPlanSpaceSize);
GPOS_CHECK_ABORT;
oss << "Serializing parsed tree" << std::endl;
CWStringDynamic strPlan(pmp);
COstreamString osPlan(&strPlan);
CDXLUtils::SerializePlan(pmp, osPlan, pdxlnRoot, ullPlanId, ullPlanSpaceSize, true /*fSerializeHeaderFooter*/, true /*fIndent*/);
GPOS_CHECK_ABORT;
CWStringDynamic dstrExpected(pmp);
dstrExpected.AppendFormat(GPOS_WSZ_LIT("%s"), szDXL);
if (!dstrExpected.FEquals(&strPlan))
{
GPOS_TRACE(dstrExpected.Wsz());
GPOS_TRACE(strPlan.Wsz());
GPOS_ASSERT(!"Not matching");
}
// cleanup
pdxlnRoot->Release();
GPOS_DELETE_ARRAY(szDXL);
return GPOS_OK;
}
示例9: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLPhysicalNLJoin::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLPhysicalNLJoin::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
)
const
{
// assert proj list and filter are valid
CDXLPhysical::AssertValid(pdxln, fValidateChildren);
GPOS_ASSERT(EdxlnljIndexSentinel == pdxln->UlArity());
GPOS_ASSERT(EdxljtSentinel > Edxltype());
CDXLNode *pdxlnJoinFilter = (*pdxln)[EdxlnljIndexJoinFilter];
CDXLNode *pdxlnLeft = (*pdxln)[EdxlnljIndexLeftChild];
CDXLNode *pdxlnRight = (*pdxln)[EdxlnljIndexRightChild];
// assert children are of right type (physical/scalar)
GPOS_ASSERT(EdxlopScalarJoinFilter == pdxlnJoinFilter->Pdxlop()->Edxlop());
GPOS_ASSERT(EdxloptypePhysical == pdxlnLeft->Pdxlop()->Edxloperatortype());
GPOS_ASSERT(EdxloptypePhysical == pdxlnRight->Pdxlop()->Edxloperatortype());
if (fValidateChildren)
{
pdxlnJoinFilter->Pdxlop()->AssertValid(pdxlnJoinFilter, fValidateChildren);
pdxlnLeft->Pdxlop()->AssertValid(pdxlnLeft, fValidateChildren);
pdxlnRight->Pdxlop()->AssertValid(pdxlnRight, fValidateChildren);
}
}
示例10: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLLogicalWindow::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLLogicalWindow::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
) const
{
GPOS_ASSERT(2 == pdxln->UlArity());
CDXLNode *pdxlnProjList = (*pdxln)[0];
CDXLNode *pdxlnChild = (*pdxln)[1];
GPOS_ASSERT(EdxlopScalarProjectList == pdxlnProjList->Pdxlop()->Edxlop());
GPOS_ASSERT(EdxloptypeLogical == pdxlnChild->Pdxlop()->Edxloperatortype());
if (fValidateChildren)
{
pdxlnProjList->Pdxlop()->AssertValid(pdxlnProjList, fValidateChildren);
pdxlnChild->Pdxlop()->AssertValid(pdxlnChild, fValidateChildren);
}
const ULONG ulArity = pdxlnProjList->UlArity();
for (ULONG ul = 0; ul < ulArity; ++ul)
{
CDXLNode *pdxlnPrEl = (*pdxlnProjList)[ul];
GPOS_ASSERT(EdxlopScalarIdent != pdxlnPrEl->Pdxlop()->Edxlop());
}
GPOS_ASSERT(NULL != m_pdrgpdxlws);
GPOS_ASSERT(0 < m_pdrgpdxlws->UlLength());
}
示例11: GPOS_ASSERT
//---------------------------------------------------------------------------
// @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);
}
示例12: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLPhysicalDML::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLPhysicalDML::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
)
const
{
GPOS_ASSERT(2 == pdxln->UlArity());
CDXLNode *pdxlnChild = (*pdxln)[1];
GPOS_ASSERT(EdxloptypePhysical == pdxlnChild->Pdxlop()->Edxloperatortype());
if (fValidateChildren)
{
pdxlnChild->Pdxlop()->AssertValid(pdxlnChild, fValidateChildren);
}
}
示例13: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLScalarCoerceViaIO::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLScalarCoerceViaIO::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
) const
{
GPOS_ASSERT(1 == pdxln->UlArity());
CDXLNode *pdxlnChild = (*pdxln)[0];
GPOS_ASSERT(EdxloptypeScalar == pdxlnChild->Pdxlop()->Edxloperatortype());
if (fValidateChildren)
{
pdxlnChild->Pdxlop()->AssertValid(pdxlnChild, fValidateChildren);
}
}
示例14: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLLogicalDelete::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLLogicalDelete::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
)
const
{
GPOS_ASSERT(1 == pdxln->UlArity());
CDXLNode *pdxlnChild = (*pdxln)[0];
GPOS_ASSERT(EdxloptypeLogical == pdxlnChild->Pdxlop()->Edxloperatortype());
if (fValidateChildren)
{
pdxlnChild->Pdxlop()->AssertValid(pdxlnChild, fValidateChildren);
}
}
示例15: GPOS_ASSERT
//---------------------------------------------------------------------------
// @function:
// CDXLPhysicalCTEConsumer::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLPhysicalCTEConsumer::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
) const
{
GPOS_ASSERT(1 == pdxln->UlArity());
CDXLNode *pdxlnPrL = (*pdxln)[0];
GPOS_ASSERT(EdxlopScalarProjectList == pdxlnPrL->Pdxlop()->Edxlop());
if (fValidateChildren)
{
pdxlnPrL->Pdxlop()->AssertValid(pdxlnPrL, fValidateChildren);
}
}