Remove a few exports by getting rid of two std::vectors and two std::sets
[platform/core/uifw/dali-core.git] / dali / internal / update / animation / scene-graph-constraint-base.cpp
index 5c0f481..56cd82c 100644 (file)
@@ -30,13 +30,22 @@ namespace Internal
 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()
@@ -46,10 +55,11 @@ 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
 }
 
@@ -59,6 +69,24 @@ void ConstraintBase::ResetDefaultProperties( BufferIndex updateBufferIndex )
   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