Update copyright year to 2015 for public api: core
[platform/core/uifw/dali-core.git] / dali / public-api / signals / connection-tracker.h
1 #ifndef __DALI_CONNECTION_TRACKER_H__
2 #define __DALI_CONNECTION_TRACKER_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/public-api/common/vector-wrapper.h>
24 #include <dali/public-api/signals/connection-tracker-interface.h>
25
26 namespace Dali
27 {
28
29 class CallbackBase;
30 class SlotObserver;
31 class SlotConnection;
32
33 /**
34  * @brief Connection tracker concrete implementation
35  */
36 class DALI_IMPORT_API ConnectionTracker : public ConnectionTrackerInterface
37 {
38 public:
39
40   /**
41    * @brief Constructor.
42    */
43   ConnectionTracker();
44
45   /**
46    * @brief Virtual destructor.
47    */
48   virtual ~ConnectionTracker();
49
50   /**
51    * @brief Disconnect all signals from this object.
52    */
53   void DisconnectAll();
54
55   /**
56    * @copydoc ConnectionTrackerInterface::SignalConnected
57    */
58   virtual void SignalConnected( SlotObserver* slotObserver, CallbackBase* callback );
59
60   /**
61    * @copydoc ConnectionTrackerInterface::SignalDisconnected
62    */
63   virtual void SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback );
64
65   /**
66    * @brief returns the connection count
67    * @return the connection count
68    */
69   std::size_t GetConnectionCount() const;
70
71 private:
72
73   ConnectionTracker( const ConnectionTracker& );            ///< undefined copy constructor
74   ConnectionTracker& operator=( const ConnectionTracker& ); ///< undefined assignment operator
75
76 private:
77
78   std::vector< SlotConnection* > mConnections; ///< Vector of connection pointers
79 };
80
81 } // namespace Dali
82
83 #endif // __DALI_CONNECTION_TRACKER_H__