Skip to content

Commit

Permalink
https://github.com/ObjectVision/GeoDMS/issues/199:
Browse files Browse the repository at this point in the history
DST_Categorical -> TSF_Categorical
  • Loading branch information
MaartenHilferink committed Apr 4, 2023
1 parent f143290 commit 35d6ae1
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 45 deletions.
2 changes: 1 addition & 1 deletion clc/dll/src1/ID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class AbstrIDOperator : public UnaryOperator
{
resultHolder = CreateCacheDataItem(e1, e1);
resultHolder.GetNew()->SetFreeDataState(true); // never cache
resultHolder->SetTSF(DSF_Categorical);
resultHolder->SetTSF(TSF_Categorical);
}
if (mustCalc)
{
Expand Down
2 changes: 1 addition & 1 deletion clc/dll/src1/Invert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct AbstrInvertOperator : public UnaryOperator
if (!resultHolder)
{
resultHolder = CreateCacheDataItem(newDomain, entity);
resultHolder->SetTSF(DSF_Categorical);
resultHolder->SetTSF(TSF_Categorical);
}
AbstrDataItem* res = AsDataItem(resultHolder.GetNew());

Expand Down
2 changes: 1 addition & 1 deletion clc/dll/src1/RLookup.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public:
if (!resultHolder)
{
resultHolder = CreateCacheDataItem(arg1_DomainUnit, arg2_DomainUnit);
resultHolder->SetTSF(DSF_Categorical);
resultHolder->SetTSF(TSF_Categorical);
}

if (mustCalc)
Expand Down
10 changes: 5 additions & 5 deletions clc/dll/src1/Subset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ struct SubsetOperator: public UnaryOperator
{
auto resSubName = ((m_ORCM == OrgRelCreationMode::org_rel) || (m_ORCM == OrgRelCreationMode::org_rel_and_use_it)) ? token::org_rel : token::nr_OrgEntity;
resSub = CreateDataItem(res, resSubName, res, arg1Domain);
resSub->SetTSF(DSF_Categorical);
resSub->SetTSF(TSF_Categorical);

MG_PRECONDITION(resSub);
}
Expand Down Expand Up @@ -344,8 +344,8 @@ struct AbstrCollectByCondOperator : TernaryOperator

if (!resultHolder)
resultHolder = CreateCacheDataItem(subset, dataA->GetAbstrValuesUnit(), dataA->GetValueComposition());
if (dataA->GetTSF(DSF_Categorical))
resultHolder->SetTSF(DSF_Categorical);
if (dataA->GetTSF(TSF_Categorical))
resultHolder->SetTSF(TSF_Categorical);

if (mustCalc)
{
Expand Down Expand Up @@ -539,11 +539,11 @@ struct AbstrRecollectByCondOperator : BinaryOperator
if (!resultHolder)
resultHolder = CreateCacheDataItem(condA->GetAbstrDomainUnit(), dataA->GetAbstrValuesUnit(), dataA->GetValueComposition());

if (dataA->GetTSF(DSF_Categorical) || fillA && fillA->GetTSF(DSF_Categorical))
if (dataA->GetTSF(TSF_Categorical) || fillA && fillA->GetTSF(TSF_Categorical))
{
if (fillA)
dataA->GetAbstrValuesUnit()->UnifyDomain(fillA->GetAbstrValuesUnit(), "v2", "v3", UnifyMode(UM_AllowDefaultRight | UM_Throw));
resultHolder->SetTSF(DSF_Categorical);
resultHolder->SetTSF(TSF_Categorical);
}
if (mustCalc)
{
Expand Down
4 changes: 2 additions & 2 deletions clc/dll/src1/Union.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class UnionDataOperator : public BinaryOperator // extra args are allowed
if (!hadToTryWithoutCategoricalCheck)
for (arg_index i = 1; i <= n; ++i)
{
if (AsDataItem(args[i])->GetTSF(DSF_Categorical))
if (AsDataItem(args[i])->GetTSF(TSF_Categorical))
isCategorical = true;
Unify(vc, AsDataItem(args[i])->GetValueComposition());
}
Expand All @@ -284,7 +284,7 @@ class UnionDataOperator : public BinaryOperator // extra args are allowed

resultHolder = CreateCacheDataItem(resultDomain, constUnitRef, vc );
if (isCategorical)
resultHolder->SetTSF(DSF_Categorical);
resultHolder->SetTSF(TSF_Categorical);
}

bool CalcResult(TreeItemDualRef& resultHolder, const ArgRefs& args, OperationContext* fc, Explain::Context* context) const override
Expand Down
2 changes: 1 addition & 1 deletion clc/dll/src1/UnitCreators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ ConstUnitRef compatible_values_unit_creator_func(arg_index nrSkippedArgs, const
if (mustCheckCategories)
{
for (; cat_unit_index != nrArgs; ++cat_unit_index)
if (AsDataItem(args[cat_unit_index])->GetTSF(DSF_Categorical))
if (AsDataItem(args[cat_unit_index])->GetTSF(TSF_Categorical))
{
catUnit = AbstrValuesUnit( AsDataItem(args[cat_unit_index]) );
break;
Expand Down
4 changes: 2 additions & 2 deletions clc/dll/src1/lookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class AbstrLookupOperator : public BinaryOperator
dms_assert(valuesA);

resultHolder = CreateCacheDataItem(domainA, valuesA, vc );
if (valuesA->GetTSF(DSF_Categorical))
resultHolder->SetTSF(DSF_Categorical);
if (valuesA->GetTSF(TSF_Categorical))
resultHolder->SetTSF(TSF_Categorical);
}

if (mustCalc)
Expand Down
4 changes: 2 additions & 2 deletions clc/dll/src2/OperAttrTer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ namespace
{
if (!MonalTernaryAttrOperator<iif_assign<X> >::CreateResult(resultHolder, args, mustCalc))
return false;
if (args[1]->GetTSF(DSF_Categorical) || args[2]->GetTSF(DSF_Categorical))
resultHolder->SetTSF(DSF_Categorical);
if (args[1]->GetTSF(TSF_Categorical) || args[2]->GetTSF(TSF_Categorical))
resultHolder->SetTSF(TSF_Categorical);
return true;
}
};
Expand Down
4 changes: 2 additions & 2 deletions clc/dll/src2/OperUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ bool UnitCombine_impl(AbstrUnit* res, const ArgSeqType& args, bool mustCalc, boo
for (; i; --i)
{
AbstrDataItem* resSub = CreateDataItem(res, subItemNameID[i-1], res, AsCertainUnit(args[i-1]));
resSub->SetTSF(DSF_Categorical);
resSub->SetTSF(TSF_Categorical);

if (!mustCalc)
{
auto depreciatedRes = CreateDataItem(res, GetTokenID_mt(myArrayPrintF<10>("nr_%d", i)), res, AsCertainUnit(args[i - 1]));
depreciatedRes->SetTSF(DSF_Categorical);
depreciatedRes->SetTSF(TSF_Categorical);
depreciatedRes->SetTSF(TSF_Depreciated);
depreciatedRes->SetReferredItem(resSub);
continue; // go to next sub
Expand Down
4 changes: 2 additions & 2 deletions geo/dll/src/BoostPolygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,12 @@ struct AbstrPolygonOperator : public VariadicOperator
if (!resDomain->IsKindOf(Unit<Void>::GetStaticClass()))
{
resNrOrgEntity = CreateDataItem(resUnit, argPart ? token::part_rel : token::polygon_rel, resUnit, resDomain, ValueComposition::Single);
resNrOrgEntity->SetTSF(DSF_Categorical);
resNrOrgEntity->SetTSF(TSF_Categorical);

if (!mustCalc)
{
auto depreciatedRes = CreateDataItem(resUnit, token::nr_OrgEntity, resUnit, resDomain, ValueComposition::Single);
depreciatedRes->SetTSF(DSF_Categorical);
depreciatedRes->SetTSF(TSF_Categorical);
depreciatedRes->SetTSF(TSF_Depreciated);
depreciatedRes->SetReferredItem(resNrOrgEntity);
}
Expand Down
12 changes: 6 additions & 6 deletions geo/dll/src/Connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct AbstrConnectNeighbourPointOperator : VariadicOperator
if (!resultHolder)
{
resultHolder = CreateCacheDataItem(pointDomain, pointDomain);
resultHolder->SetTSF(DSF_Categorical);
resultHolder->SetTSF(TSF_Categorical);
}
if (mustCalc)
{
Expand Down Expand Up @@ -303,7 +303,7 @@ struct AbstrConnectPointOperator : VariadicOperator
if (!resultHolder)
{
resultHolder = CreateCacheDataItem(point2Entity, point1Entity);
resultHolder->SetTSF(DSF_Categorical);
resultHolder->SetTSF(TSF_Categorical);
}

if (mustCalc)
Expand Down Expand Up @@ -626,9 +626,9 @@ class ConnectInfoOperator : std::conditional_t<CT == compare_type::none,

if (resSub2 && !mustCalc)
{
resSub2->SetTSF(DSF_Categorical);
resSub2->SetTSF(TSF_Categorical);
auto resNrOrg_depreciated = CreateDataItem(resultHolder, s_ArcID, pointEntity, polyEntity);
resNrOrg_depreciated->SetTSF(DSF_Categorical);
resNrOrg_depreciated->SetTSF(TSF_Categorical);
resNrOrg_depreciated->SetTSF(TSF_Depreciated);
resNrOrg_depreciated->SetReferredItem(resSub2);
}
Expand Down Expand Up @@ -922,11 +922,11 @@ class FastConnectOperator : std::conditional_t<CT == compare_type::none
}

AbstrDataItem* resNrOrg = CreateDataItem(resDomain, token::arc_rel, resDomain, arg1A->GetAbstrDomainUnit());
resNrOrg->SetTSF(DSF_Categorical);
resNrOrg->SetTSF(TSF_Categorical);
if (!mustCalc)
{
auto resNrOrg_depreciated = CreateDataItem(resDomain, token::nr_OrgEntity, resDomain, arg1A->GetAbstrDomainUnit());
resNrOrg_depreciated->SetTSF(DSF_Categorical);
resNrOrg_depreciated->SetTSF(TSF_Categorical);
resNrOrg_depreciated->SetTSF(TSF_Depreciated);
resNrOrg_depreciated->SetReferredItem(resNrOrg);
}
Expand Down
12 changes: 6 additions & 6 deletions geo/dll/src/Dijkstra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1370,13 +1370,13 @@ class DijkstraMatrOperator : public VariadicOperator
{
dms_assert(!flags(df & DijkstraFlag::OD));
resTB = CreateDataItem(resultContext, GetTokenID_mt("TraceBack"), v, e);
resTB->SetTSF(DSF_Categorical);
resTB->SetTSF(TSF_Categorical);
}

AbstrDataItem* resLS = flags(df & DijkstraFlag::ProdOdLinkSet)
? CreateDataItem(resultContext, GetTokenID_mt("LinkSet"), resultUnit, e, ValueComposition::Sequence)
: nullptr;
if (resLS) resLS->SetTSF(DSF_Categorical);
if (resLS) resLS->SetTSF(TSF_Categorical);

AbstrDataItem* resAltLinkImp = flags(df & DijkstraFlag::ProdOdAltImpedance)
? CreateDataItem(resultContext, GetTokenID_mt("alt_imp"), resultUnit, imp2Unit)
Expand Down Expand Up @@ -1405,21 +1405,21 @@ class DijkstraMatrOperator : public VariadicOperator
AbstrDataItem* resSrcZone = flags(df & DijkstraFlag::ProdOdOrgZone_rel)
? CreateDataItem(resultContext, GetTokenID_mt("OrgZone_rel"), resultUnit, orgZonesOrVoid)
: nullptr;
if (resSrcZone) resSrcZone->SetTSF(DSF_Categorical);
if (resSrcZone) resSrcZone->SetTSF(TSF_Categorical);

AbstrDataItem* resDstZone = flags(df & DijkstraFlag::ProdOdDstZone_rel)
? CreateDataItem(resultContext, GetTokenID_mt("DstZone_rel"), resultUnit, dstZones)
: nullptr;
if (resDstZone) resDstZone->SetTSF(DSF_Categorical);
if (resDstZone) resDstZone->SetTSF(TSF_Categorical);

AbstrDataItem* resStartPoint = flags(df & DijkstraFlag::ProdOdStartPoint_rel)
? CreateDataItem(resultContext, GetTokenID_mt("StartPoint_rel"), resultUnit, x)
: nullptr;
if (resStartPoint) resStartPoint->SetTSF(DSF_Categorical);
if (resStartPoint) resStartPoint->SetTSF(TSF_Categorical);
AbstrDataItem* resEndPoint = flags(df & DijkstraFlag::ProdOdEndPoint_rel)
? CreateDataItem(resultContext, GetTokenID_mt("EndPoint_rel"), resultUnit, y)
: nullptr;
if (resEndPoint) resEndPoint->SetTSF(DSF_Categorical);
if (resEndPoint) resEndPoint->SetTSF(TSF_Categorical);

if (mustCalc)
{
Expand Down
2 changes: 1 addition & 1 deletion geo/dll/src/DiscrAlloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2615,7 +2615,7 @@ class HitchcockTransportationOperator : public UndenaryOperator
dms_assert(res);

AbstrDataItem* resLanduse = CreateDataItem(res, GetTokenID_mt("landuse"), allocUnit, ggTypeSet);
resLanduse->SetTSF(DSF_Categorical);
resLanduse->SetTSF(TSF_Categorical);

AbstrDataItem* resStatus =
CreateDataItem(
Expand Down
18 changes: 9 additions & 9 deletions geo/dll/src/OperPolygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,11 @@ struct AbstrArcs2SegmentsOperator : public UnaryOperator
{
resSub3 = CreateDataItem(resDomain, token::sequence_rel, resDomain, polyEntity);
MG_PRECONDITION(resSub3);
resSub3->SetTSF(DSF_Categorical);
resSub3->SetTSF(TSF_Categorical);
if (!mustCalc)
{
auto depreciatedRes = CreateDataItem(resDomain, s_DepreciatedSequenceNr, resDomain, polyEntity);
depreciatedRes->SetTSF(DSF_Categorical);
depreciatedRes->SetTSF(TSF_Categorical);
depreciatedRes->SetTSF(TSF_Depreciated);
depreciatedRes->SetReferredItem(resSub3);
}
Expand Down Expand Up @@ -726,13 +726,13 @@ struct AbstrDynaPointOperator : public TernaryOperator
if (m_CreateFlags & DoCreateNrOrgEntity && pointEntity->GetUnitClass() != Unit<Void>::GetStaticClass() )
{
resSub3 = CreateDataItem(resDomain, token::sequence_rel, resDomain, pointEntity);
resSub3->SetTSF(DSF_Categorical);
resSub3->SetTSF(TSF_Categorical);
MG_PRECONDITION(resSub3);

if (!mustCalc)
{
auto depreciatedRes = CreateDataItem(resDomain, s_DepreciatedSequenceNr, resDomain, pointEntity);
depreciatedRes->SetTSF(DSF_Categorical);
depreciatedRes->SetTSF(TSF_Categorical);
depreciatedRes->SetTSF(TSF_Depreciated);
depreciatedRes->SetReferredItem(resSub3);
}
Expand All @@ -741,7 +741,7 @@ struct AbstrDynaPointOperator : public TernaryOperator
if (m_CreateFlags & DoCreateOrdinal)
{
resSub4 = CreateDataItem(resDomain, token::ordinal, resDomain, Unit<UInt32>::GetStaticClass()->CreateDefault() );
resSub4->SetTSF(DSF_Categorical);
resSub4->SetTSF(TSF_Categorical);
MG_PRECONDITION(resSub4);

}
Expand Down Expand Up @@ -1050,7 +1050,7 @@ class AbstrPointInPolygonOperator : public BinaryOperator
if (!resultHolder)
{
resultHolder = CreateCacheDataItem(domainUnit, valuesUnit);
resultHolder->SetTSF(DSF_Categorical);
resultHolder->SetTSF(TSF_Categorical);
}
if (mustCalc)
{
Expand Down Expand Up @@ -1359,7 +1359,7 @@ class AbstrPointInRankedPolygonOperator : public TernaryOperator
if (!resultHolder)
{
resultHolder = CreateCacheDataItem(domainUnit, valuesUnit);
resultHolder->SetTSF(DSF_Categorical);
resultHolder->SetTSF(TSF_Categorical);
}
if (mustCalc)
{
Expand Down Expand Up @@ -1590,8 +1590,8 @@ class AbstrPointInAllPolygonsOperator : public BinaryOperator

AbstrDataItem* res1 = e1IsVoid ? nullptr : CreateDataItem(res, s_tFR, res, domain1Unit);
AbstrDataItem* res2 = e2IsVoid ? nullptr : CreateDataItem(res, s_tSR, res, domain2Unit);
if (res1) res1->SetTSF(DSF_Categorical);
if (res2) res2->SetTSF(DSF_Categorical);
if (res1) res1->SetTSF(TSF_Categorical);
if (res2) res2->SetTSF(TSF_Categorical);

if (mustCalc)
{
Expand Down
6 changes: 3 additions & 3 deletions tic/dll/src/AbstrDataItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void AbstrDataItem::Unify(const TreeItem* refItem, CharPtr leftRole, CharPtr rig
GetAbstrValuesUnit()->UnifyValues(refAsDi->GetAbstrValuesUnit(), leftRole, rightRole, UnifyMode(UM_AllowDefaultLeft|UM_Throw));

/*
if (refAsDi->GetTSF(DSF_Categorical))
if (refAsDi->GetTSF(TSF_Categorical))
{
SharedStr resultMsg;
if (!GetAbstrValuesUnit()->UnifyDomain(refAsDi->GetAbstrValuesUnit(), UnifyMode(UM_AllowDefaultLeft), &resultMsg))
Expand Down Expand Up @@ -423,11 +423,11 @@ bool AbstrDataItem::CheckResultItem(const TreeItem* refItem) const
if (!myvu->UnifyValues(refvu, "the specified ValuesUnit", "the values unit of the calculation results", UnifyMode::UM_AllowDefaultLeft, &errMsgStr))
goto failResultMsg;
}
if (adi->GetTSF(DSF_Categorical))
if (adi->GetTSF(TSF_Categorical))
{
if (!GetAbstrValuesUnit()->UnifyDomain(adi->GetAbstrValuesUnit(), "the specified ValuesUnit", "the categorical calculation results", UnifyMode::UM_AllowDefaultLeft, &errMsgStr))
goto failResultMsg;
SetTSF(DSF_Categorical);
SetTSF(TSF_Categorical);
}
return true;

Expand Down
3 changes: 2 additions & 1 deletion tic/dll/src/TreeItemFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ const TreeItemStatusFlags TSF_InHidden = 0x00020000;
const TreeItemStatusFlags TSF_IsTemplate = 0x00040000;
const TreeItemStatusFlags TSF_InTemplate = 0x00080000;

const TreeItemStatusFlags TSF_Categorical = 0x00100000;
const TreeItemStatusFlags TSF_XXXXXXXXXXX = 0x00200000;
const TreeItemStatusFlags TSF_StoreData = 0x00400000; // Also use CalcCache when data is below the data-size threshold
const TreeItemStatusFlags TSF_Depreciated = 0x00800000; // unallocated bit

Expand All @@ -106,7 +108,6 @@ const int VC2DSF_SHIFT = DCM2DSF_SHIFT + 3;
const int VC_MASK = 0x03U;
const DataItemStatusFlags DSF_VC_Range = 0x08000000; // VC_Range << VC2DSF_SHIFT
const DataItemStatusFlags DSF_VC_Sequence = 0x10000000; // VC_Sequence<< VC2DSF_SHIFT
const DataItemStatusFlags DSF_Categorical = 0x20000000;

struct treeitem_flag_set : flag_set
{
Expand Down

0 comments on commit 35d6ae1

Please sign in to comment.