Merge remote-tracking branch 'origin/tizen' into devel/new_mesh
[platform/core/uifw/dali-core.git] / dali / internal / update / animation / scene-graph-constraint-base.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/update/animation/scene-graph-constraint.h>
20
21 namespace Dali
22 {
23
24 namespace Internal
25 {
26
27 namespace SceneGraph
28 {
29
30 #ifdef DEBUG_ENABLED
31   unsigned int ConstraintBase::mCurrentInstanceCount = 0;
32   unsigned int ConstraintBase::mTotalInstanceCount   = 0;
33 #endif
34
35 ConstraintBase::ConstraintBase( PropertyOwnerContainer& ownerSet )
36 : mRemoveAction( Dali::Constraint::DEFAULT_REMOVE_ACTION ),
37   mFirstApply( true ),
38   mDisconnected( true ),
39   mObservedOwners( ownerSet )
40 {
41 #ifdef DEBUG_ENABLED
42   ++mCurrentInstanceCount;
43   ++mTotalInstanceCount;
44 #endif
45 }
46
47 ConstraintBase::~ConstraintBase()
48 {
49   if ( !mDisconnected )
50   {
51     StopObservation();
52   }
53
54 #ifdef DEBUG_ENABLED
55   --mCurrentInstanceCount;
56 #endif
57 }
58
59 void ConstraintBase::ResetDefaultProperties( BufferIndex updateBufferIndex )
60 {
61   DALI_ASSERT_DEBUG( false );
62 }
63
64 unsigned int ConstraintBase::GetCurrentInstanceCount()
65 {
66 #ifdef DEBUG_ENABLED
67   return mCurrentInstanceCount;
68 #else
69   return 0u;
70 #endif
71 }
72
73 unsigned int ConstraintBase::GetTotalInstanceCount()
74 {
75 #ifdef DEBUG_ENABLED
76   return mTotalInstanceCount;
77 #else
78   return 0u;
79 #endif
80 }
81
82 } // namespace SceneGraph
83
84 } // namespace Internal
85
86 } // namespace Dali