[dali_1.0.1] Merge branch 'tizen'
[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 // INTERNAL INCLUDES
22 #include <dali/public-api/animation/active-constraint.h>
23
24 namespace Dali
25 {
26
27 namespace Internal
28 {
29
30 namespace SceneGraph
31 {
32
33 ConstraintBase::ConstraintBase( PropertyOwnerSet& ownerSet )
34 : mWeight( Dali::ActiveConstraint::DEFAULT_WEIGHT ),
35   mRemoveAction( Dali::Constraint::DEFAULT_REMOVE_ACTION ),
36   mFirstApply( true ),
37   mDisconnected( true ),
38   mObservedOwners( ownerSet )
39 {
40 }
41
42 ConstraintBase::~ConstraintBase()
43 {
44   if ( !mDisconnected )
45   {
46     StopObservation();
47   }
48
49 // TODO - Override new & delete to provide this for everything
50 #ifdef DEBUG_ENABLED
51   // Fill with garbage pattern to help detect invalid memory access
52   memset ( &mWeight, 0xFA, sizeof(mWeight) );
53 #endif
54 }
55
56 void ConstraintBase::ResetDefaultProperties( BufferIndex updateBufferIndex )
57 {
58   // Not used, since the weight property is reset by PropertyOwner
59   DALI_ASSERT_DEBUG( false );
60 }
61
62 } // namespace SceneGraph
63
64 } // namespace Internal
65
66 } // namespace Dali