<commit_before>#ifndef __DALI_SIGNAL_H__
#define __DALI_SIGNAL_H__

/*
 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

/**
 * The class should implement Dali::ConnectionTrackerInterface, or inherit from Dali::ConnectionTracker.
 * This enforces automatic disconnection when an object is destroyed, so you don't have
 * to manually disconnect from signals.
 *
 * Alternatively, you can use a Dali::SlotDelegate if you don't want to inherit.
 *
 * E.g:
 * @code
 * class MyClass : public ConnectionTracker
 * {
 *
 *   void Callback( Actor actor, const TouchEvent& event )
 *   {
 *     ...
 *   }
 *
 *   void Init()
 *   {
 *     Actor actor = Actor::New();
 *
 *     actor.TouchedSignal().Connect( this, &MyClass::Callback );
 *   }
 *
 *   ~MyClass()
 *   {
 *     // ConnectionTracker base class automatically disconnects
 *   }
 * }
 * @endcode
 */

// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/signals/callback.h>
#include <dali/public-api/signals/signal-slot-connections.h>
#include <dali/public-api/signals/slot-delegate.h>
#include <dali/public-api/signals/base-signal.h>

namespace Dali
{

/**
 * @brief Base Template class to provide signals.
 */
template< typename _Signature >
class Signal
{
};<commit_msg>Documentation on how to create a Signal<commit_after>#ifndef __DALI_SIGNAL_H__
#define __DALI_SIGNAL_H__

/*
 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

/**
 * The class should implement Dali::ConnectionTrackerInterface, or inherit from Dali::ConnectionTracker.
 * This enforces automatic disconnection when an object is destroyed, so you don't have
 * to manually disconnect from signals.
 *
 * Alternatively, you can use a Dali::SlotDelegate if you don't want to inherit.
 *
 * E.g:
 * @code
 * class MyClass : public ConnectionTracker
 * {
 *
 *   void Callback( Actor actor, const TouchEvent& event )
 *   {
 *     ...
 *   }
 *
 *   void Init()
 *   {
 *     Actor actor = Actor::New();
 *
 *     actor.TouchedSignal().Connect( this, &MyClass::Callback );
 *   }
 *
 *   ~MyClass()
 *   {
 *     // ConnectionTracker base class automatically disconnects
 *   }
 * }
 * @endcode
 */

// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/signals/callback.h>
#include <dali/public-api/signals/signal-slot-connections.h>
#include <dali/public-api/signals/slot-delegate.h>
#include <dali/public-api/signals/base-signal.h>

namespace Dali
{

/**
 * @brief Base Template class to provide signals.
 *
 * To create a signal for this class, you first have to define a typedef within your handle's scope:
 * @code
 * class MyHandle : public Handle
 * {
 * public:
 *
 *   // Typedefs
 *
 *   typedef Signal< void ()> VoidSignalType;         ///< For signals that require no parameters and no return value
 *   typedef Signal< bool ()> BoolSignalType;         ///< For signals that do not need parameters but require a boolean return
 *   typedef Signal< void ( float )> ParamSignalType; ///< For signals that need a float as a parameter but no return value
 *
 *   ...
 *
 * public:
 *
 *   // Signals
 *
 *   VoidSignalType&  VoidSignal();
 *   BoolSignalType&  BoolSignal();
 *   ParamSignalType& ParamSignal();
 *
 *   ...
 * };
 * @endcode
 * The methods are required in the handle class so that the application writer can retrieve the Signal in order to connect/disconnect.
 *
 * In the implementation class, the members should be defined and the methods should be provided to retrieve the signal itself.
 * These will be called by the equivalent methods in the MyHandle class.
 * @code
 * class MyObject : public Object
 * {
 *   ...
 *
 * public:
 *
 *   MyHandle::VoidSignalType&  VoidSignal()
 *   {
 *     return mVoidSignal;
 *   }
 *
 *   MyHandle::BoolSignalType&  BoolSignal()
 *   {
 *     return mBoolSignal;
 *   }
 *
 *   MyHandle::ParamSignalType& ParamSignal()
 *   {
 *     return mParamSignal;
 *   }
 *
 * private:
 *
 *   // Signals
 *   MyHandle::VoidSignalType   mVoidSignal;
 *   MyHandle::BoolSignalType   mBoolSignal;
 *   MyHandle::ParamSignalType  mParamSignal;
 *
 *   ...
 * };
 * @endcode
 */
template< typename _Signature >
class Signal
{
};
{'fraction_non_alphanumeric': 0.11023325808878856, 'fraction_numerical': 0.0030097817908201654, 'mean_word_length': 3.298302344381568, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3207812', 'n_tokens_mistral': 1617, 'n_tokens_neox': 1564, 'n_words': 532}