namespace SceneGraph
{
-ConstraintBase::ConstraintBase( PropertyOwnerSet& ownerSet )
+#ifdef DEBUG_ENABLED
+ unsigned int ConstraintBase::mCurrentInstanceCount = 0;
+ unsigned int ConstraintBase::mTotalInstanceCount = 0;
+#endif
+
+ConstraintBase::ConstraintBase( PropertyOwnerContainer& ownerSet )
: mWeight( Dali::ActiveConstraint::DEFAULT_WEIGHT ),
mRemoveAction( Dali::Constraint::DEFAULT_REMOVE_ACTION ),
mFirstApply( true ),
mDisconnected( true ),
mObservedOwners( ownerSet )
{
+#ifdef DEBUG_ENABLED
+ ++mCurrentInstanceCount;
+ ++mTotalInstanceCount;
+#endif
}
ConstraintBase::~ConstraintBase()
StopObservation();
}
-// TODO - Override new & delete to provide this for everything
#ifdef DEBUG_ENABLED
- // Fill with garbage pattern to help detect invalid memory access
- memset ( &mWeight, 0xFA, sizeof(mWeight) );
+ --mCurrentInstanceCount;
+#ifndef EMSCRIPTEN
+ memset ( &mWeight, 0xFA, sizeof(mWeight) ); // Fill with garbage pattern to help detect invalid memory access
+#endif
#endif
}
DALI_ASSERT_DEBUG( false );
}
+unsigned int ConstraintBase::GetCurrentInstanceCount()
+{
+#ifdef DEBUG_ENABLED
+ return mCurrentInstanceCount;
+#else
+ return 0u;
+#endif
+}
+
+unsigned int ConstraintBase::GetTotalInstanceCount()
+{
+#ifdef DEBUG_ENABLED
+ return mTotalInstanceCount;
+#else
+ return 0u;
+#endif
+}
+
} // namespace SceneGraph
} // namespace Internal