<commit_before>#ifndef XMMSCLIENTPP_SIGNAL_H
#define XMMSCLIENTPP_SIGNAL_H

#include <xmmsclient/xmmsclient.h>
#include <boost/signal.hpp>
#include <string>

namespace Xmms
{

	template< typename T >
	struct Signal
	{
		typedef boost::signal< bool( const T& ) > signal_t;
		boost::signal< bool( const std::string& ) > error_signal;
		signal_t signal;
	};

	template<>
	struct Signal< void >
	{
		typedef boost::signal< bool() > signal_t;
		boost::signal< bool( const std::string& ) > error_signal;
		signal_t signal;
	};

	template< typename T >
	inline T* extract_value( xmmsc_result_t* res )
	{
		return new T( res );
	}

	template<>
	inline unsigned int*
	extract_value( xmmsc_result_t* res )
	{
		unsigned int* temp = new unsigned int;
		xmmsc_result_get_uint( res, temp );
		return temp;
	}

	template<>
	inline int*
	extract_value( xmmsc_result_t* res )
	{
		int* temp = new int;
		xmmsc_result_get_int( res, temp );
		return temp;
	}

	template<>
	inline std::string*
	extract_value( xmmsc_result_t* res )
	{
		char* temp = 0;
		xmmsc_result_get_string( res, &temp );
		return new std::string( temp );
	}

	template< typename T >
	inline bool
	callSignal( const Signal< T >* sig, xmmsc_result_t*& res )
	{

		T* value = extract_value< T >( res );
		bool ret = sig->signal( *value );
		delete value;
		return ret;

	}

	template<><commit_msg>OTHER: Specialize extract_value for xmms_playback_status_t* (Playback::Status)<commit_after>#ifndef XMMSCLIENTPP_SIGNAL_H
#define XMMSCLIENTPP_SIGNAL_H

#include <xmmsclient/xmmsclient.h>
#include <boost/signal.hpp>
#include <string>

namespace Xmms
{

	template< typename T >
	struct Signal
	{
		typedef boost::signal< bool( const T& ) > signal_t;
		boost::signal< bool( const std::string& ) > error_signal;
		signal_t signal;
	};

	template<>
	struct Signal< void >
	{
		typedef boost::signal< bool() > signal_t;
		boost::signal< bool( const std::string& ) > error_signal;
		signal_t signal;
	};

	template< typename T >
	inline T* extract_value( xmmsc_result_t* res )
	{
		return new T( res );
	}

	template<>
	inline unsigned int*
	extract_value( xmmsc_result_t* res )
	{
		unsigned int* temp = new unsigned int;
		xmmsc_result_get_uint( res, temp );
		return temp;
	}

	template<>
	inline int*
	extract_value( xmmsc_result_t* res )
	{
		int* temp = new int;
		xmmsc_result_get_int( res, temp );
		return temp;
	}

	template<>
	inline std::string*
	extract_value( xmmsc_result_t* res )
	{
		char* temp = 0;
		xmmsc_result_get_string( res, &temp );
		return new std::string( temp );
	}

	template<>
	inline xmms_playback_status_t*
	extract_value( xmmsc_result_t* res )
	{
		unsigned int temp = 0;
		xmmsc_result_get_uint( res, &temp );
		xmms_playback_status_t* result = new xmms_playback_status_t;
		*result = static_cast< xmms_playback_status_t >( temp );
		return result;
	}

	template< typename T >
	inline bool
	callSignal( const Signal< T >* sig, xmmsc_result_t*& res )
	{

		T* value = extract_value< T >( res );
		bool ret = sig->signal( *value );
		delete value;
		return ret;

	}

	template<>
{'fraction_non_alphanumeric': 0.11791680314444808, 'fraction_numerical': 0.000982640026203734, 'mean_word_length': 4.21160409556314, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '968040', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1179, 'n_words': 291}