Skip to content

Commit

Permalink
#372 supplemental.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenHilferink committed Jul 28, 2023
1 parent da89468 commit c40590a
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion clc/dll/include/CastedUnaryAttrOper.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class AbstrCastedUnaryAttrOperator : public BinaryOperator
if (IsMultiThreaded3() && (nrTiles > 1) && !res->HasRepetitiveUsers() && (LTF_ElementWeight(argDataA) <= LTF_ElementWeight(res)))
{
auto valuesUnitA = AsUnit(res->GetAbstrValuesUnit()->GetCurrRangeItem());
AsDataItem(resultHolder.GetOld())->m_DataObject = CreateFutureTileCaster(res->GetlazyCalculatedState(), valuesUnitA, argDataA, argUnitA MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + : + GetGroup()->GetName().c_str()"));
AsDataItem(resultHolder.GetOld())->m_DataObject = CreateFutureTileCaster(res->GetLazyCalculatedState(), valuesUnitA, argDataA, argUnitA MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + : + GetGroup()->GetName().c_str()"));
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion clc/dll/include/OperAttrBin.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct AbstrBinaryAttrOper : BinaryOperator
auto tn = e->GetNrTiles();
auto valuesUnitA = AsUnit(res->GetAbstrValuesUnit()->GetCurrRangeItem());
if (IsMultiThreaded3() && (tn > 1) && (LTF_ElementWeight(arg1A) + LTF_ElementWeight(arg2A) <= LTF_ElementWeight(res)))
res->m_DataObject = CreateFutureTileFunctor(res->GetlazyCalculatedState(), valuesUnitA, arg1A, arg2A, af MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + GetGroup()->GetName().c_str()"));
res->m_DataObject = CreateFutureTileFunctor(res->GetLazyCalculatedState(), valuesUnitA, arg1A, arg2A, af MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + GetGroup()->GetName().c_str()"));
else
{
DataWriteLock resLock(res);
Expand Down
2 changes: 1 addition & 1 deletion clc/dll/include/OperAttrTer.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct AbstrTernaryAttrOper : TernaryOperator

auto valuesUnitA = AsUnit(res->GetAbstrValuesUnit()->GetCurrRangeItem());
if (IsMultiThreaded3() && (tn > 1) && (LTF_ElementWeight(arg1A) + LTF_ElementWeight(arg2A) + LTF_ElementWeight(arg3A) <= LTF_ElementWeight(res)))
AsDataItem(resultHolder.GetOld())->m_DataObject = CreateFutureTileFunctor(res->GetlazyCalculatedState(), valuesUnitA, arg1A, arg2A, arg3A, af MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + GetGroup()->GetName().c_str()"));
AsDataItem(resultHolder.GetOld())->m_DataObject = CreateFutureTileFunctor(res->GetLazyCalculatedState(), valuesUnitA, arg1A, arg2A, arg3A, af MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + GetGroup()->GetName().c_str()"));
else
{
DataWriteLock resLock(res);
Expand Down
2 changes: 1 addition & 1 deletion clc/dll/include/OperAttrUni.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct AbstrUnaryAttrOperator: UnaryOperator

auto valuesUnitA = AsUnit(res->GetAbstrValuesUnit()->GetCurrRangeItem());
if (IsMultiThreaded3() && (tn > 1) && (LTF_ElementWeight(arg1A) <= LTF_ElementWeight(res)))
AsDataItem(resultHolder.GetOld())->m_DataObject = CreateFutureTileFunctor(res->GetlazyCalculatedState(), valuesUnitA, arg1A, af MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + GetGroup()->GetName().c_str()"));
AsDataItem(resultHolder.GetOld())->m_DataObject = CreateFutureTileFunctor(res->GetLazyCalculatedState(), valuesUnitA, arg1A, af MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + GetGroup()->GetName().c_str()"));
else
{
DataWriteLock resLock(res);
Expand Down
2 changes: 1 addition & 1 deletion clc/dll/src/RLookup.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public:
const AbstrUnit* arg2Domain = arg2A->GetAbstrDomainUnit();
auto arg2DomainRange = arg2Lock->GetTiledRangeData();
if (IsMultiThreaded3() && (nrTiles > 1) && (LTF_ElementWeight(arg1A) <= LTF_ElementWeight(res)) && (nrTiles > arg2DomainRange->GetNrTiles()))
AsDataItem(resultHolder.GetOld())->m_DataObject = CreateFutureTileIndexer(res->GetlazyCalculatedState(), arg2_DomainUnit, arg1A, arg1HasUndefined, arg2Domain, arg2DomainRange, std::move(index) MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + RLookup()"));
AsDataItem(resultHolder.GetOld())->m_DataObject = CreateFutureTileIndexer(res->GetLazyCalculatedState(), arg2_DomainUnit, arg1A, arg1HasUndefined, arg2Domain, arg2DomainRange, std::move(index) MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + RLookup()"));
else
{
DataWriteLock resLock(res);
Expand Down
2 changes: 1 addition & 1 deletion clc/dll/src/lookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class AbstrLookupOperator : public BinaryOperator
auto tn = domainA->GetNrTiles();
auto wrappedValuesArray = MakeValuesArray(arg2A);
if (IsMultiThreaded3() && (tn > 1) && (LTF_ElementWeight(arg1A) <= LTF_ElementWeight(res)) && tn > arg2DomainA->GetNrTiles())
AsDataItem(resultHolder.GetOld())->m_DataObject = CreateFutureTileFunctor(res->GetlazyCalculatedState(), arg1A, dcmArg1, valuesA, arg2DomainA, wrappedValuesArray MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + : lookup"));
AsDataItem(resultHolder.GetOld())->m_DataObject = CreateFutureTileFunctor(res->GetLazyCalculatedState(), arg1A, dcmArg1, valuesA, arg2DomainA, wrappedValuesArray MG_DEBUG_ALLOCATOR_SRC("res->md_FullName + : lookup"));
else
{
DataWriteLock resLock(res);
Expand Down
2 changes: 1 addition & 1 deletion geo/dll/src/Point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ConvertAttrToPointOperator : public TernaryOperator
auto tn = entity1->GetNrTiles();

if (IsMultiThreaded3() && (tn > 1) && (LTF_ElementWeight(arg1A) + LTF_ElementWeight(arg2A) <= LTF_ElementWeight(res)))
res->m_DataObject = CreateFutureTileFunctor(res->GetlazyCalculatedState(), res->GetAbstrValuesUnit(), arg1A, arg2A);
res->m_DataObject = CreateFutureTileFunctor(res->GetLazyCalculatedState(), res->GetAbstrValuesUnit(), arg1A, arg2A);
else
{
DataWriteLock resLock(res);
Expand Down
14 changes: 8 additions & 6 deletions tic/dll/src/TreeItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ void TreeItem::InitTreeItem(TreeItem* parent, TokenID id)
SetPassor();
if (parent->GetKeepDataState())
SetKeepDataState(true);
if (parent->GetLazyCalculatedState())
SetLazyCalculatedState(true);
if (parent->GetFreeDataState())
SetFreeDataState(true);
if (parent->GetStoreDataState())
Expand Down Expand Up @@ -1041,12 +1043,12 @@ void TreeItem_RemoveInheritedSubItems(TreeItem* self)

void TreeItem::SetReferredItem(const TreeItem* refItem) const
{
dms_assert(IsMetaThread() || !refItem);
assert(IsMetaThread() || !refItem);

dms_assert(!IsDataItem(this) || AsDataItem(this)->GetDataObjLockCount() <= 0); // DON'T MESS WITH SHARED-LOCKED ITEMS
assert(!IsDataItem(this) || AsDataItem(this)->GetDataObjLockCount() <= 0); // DON'T MESS WITH SHARED-LOCKED ITEMS

dms_assert(refItem != this);
dms_assert(!refItem || !refItem->InTemplate());
assert(refItem != this);
assert(!refItem || !refItem->InTemplate());
if (mc_RefItem == refItem)
return;

Expand Down Expand Up @@ -1099,6 +1101,8 @@ void TreeItem::SetReferredItem(const TreeItem* refItem) const
mc_RefItem->DetermineState();
if (GetKeepDataState())
const_cast<TreeItem*>(mc_RefItem.get_ptr())->SetKeepDataState(true); // LET OP: State is niet weggehaald bij vorige refItem (want er zijn misschien nog andere keepers)
if (GetLazyCalculatedState())
const_cast<TreeItem*>(mc_RefItem.get_ptr())->SetLazyCalculatedState(true); // LET OP: State is niet weggehaald bij vorige refItem (want er zijn misschien nog andere keepers)

const UInt32 inheritedFlags = TSF_Depreciated | TSF_Categorical;
m_StatusFlags.SetBits(inheritedFlags, mc_RefItem->m_StatusFlags.GetBits(inheritedFlags));
Expand Down Expand Up @@ -3670,8 +3674,6 @@ void TreeItem::XML_Dump(OutStreamBase* xmlOutStr) const
// TreeItem SetStorageManger Functions
//----------------------------------------------------------------------

//#include "stg/StorageInterface.h"

void TreeItem::SetStorageManager(AbstrStorageManager* storageManager)
{
if (m_StorageManager == storageManager)
Expand Down
2 changes: 1 addition & 1 deletion tic/dll/src/TreeItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ struct TreeItem : Actor, TreeItemList
bool GetKeepDataState () const { return GetTSF(TSF_KeepData); }

TIC_CALL void SetLazyCalculatedState(bool value);
bool GetlazyCalculatedState() const { return GetTSF(TSF_LazyCalculated); }
bool GetLazyCalculatedState() const { return GetTSF(TSF_LazyCalculated); }

bool HasRepetitiveUsers() const { return GetTSF(TSF_KeepData|TSF_THA_Keep); }
TIC_CALL void SetStoreDataState(bool value);
Expand Down
2 changes: 1 addition & 1 deletion tic/dll/src/TreeItemProps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ namespace { // local defs
ApiType GetValue(TreeItem const* ti) const override
{
assert(ti);
return ti->GetlazyCalculatedState();
return ti->GetLazyCalculatedState();
}
void SetValue(TreeItem* ti, ParamType value) override
{
Expand Down

0 comments on commit c40590a

Please sign in to comment.