<commit_before>/*!
  \copyright (c) RDO-Team, 2011
  \file      std_fun.inl
  \author      (<EMAIL>)
  \date      31.07.2011
  \brief       
  \indent    4T
*/

// ----------------------------------------------------------------------- INCLUDES
// ----------------------------------------------------------------------- SYNOPSIS
#include "simulator/runtime/rdocalc.h"
#include "simulator/runtime/rdo_runtime.h"
// --------------------------------------------------------------------------------

OPEN_RDO_RUNTIME_NAMESPACE

// --------------------------------------------------------------------------------
// -------------------- RDOFunCalcStd
// --------------------------------------------------------------------------------
template <class F>
inline RDOFunCalcStd<F>::RDOFunCalcStd(CREF(function_type) pFunction)
	: m_pFunction(pFunction)
{}

template <class F>
REF(RDOValue) RDOFunCalcStd<F>::doCalc(CREF(LPRDORuntime) pRuntime)
{
	calc<F::arity>(pRuntime);
	return m_value;
}

template <>
void calc<1>(CREF(LPRDORuntime) pRuntime)
{
	m_value = m_pFunction(getParam<F::arg1_type>(pRuntime, 0));
}

template <>
void calc<2>(CREF(LPRDORuntime) pRuntime)
{
	m_value = m_pFunction(getParam<F::arg1_type>(pRuntime, 0), getParam<F::arg2_type>(pRuntime, 1));
}

template <>
double getParam<double>(CREF(LPRDORuntime) pRuntime, ruint paramNumber)
{
	return pRuntime->getFuncArgument(paramNumber).getDouble();
}

template <>
int getParam<int>(CREF(LPRDORuntime) pRuntime, ruint paramNumber)
{
	return pRuntime->getFuncArgument(paramNumber).getInt();
}

CLOSE_RDO_RUNTIME_NAMESPACE
<commit_msg> - added typename in calc std_fun.inl<commit_after>/*!
  \copyright (c) RDO-Team, 2011
  \file      std_fun.inl
  \author      (<EMAIL>)
  \date      31.07.2011
  \brief       
  \indent    4T
*/

// ----------------------------------------------------------------------- INCLUDES
// ----------------------------------------------------------------------- SYNOPSIS
#include "simulator/runtime/rdocalc.h"
#include "simulator/runtime/rdo_runtime.h"
// --------------------------------------------------------------------------------

OPEN_RDO_RUNTIME_NAMESPACE

// --------------------------------------------------------------------------------
// -------------------- RDOFunCalcStd
// --------------------------------------------------------------------------------
template <class F>
inline RDOFunCalcStd<F>::RDOFunCalcStd(CREF(function_type) pFunction)
	: m_pFunction(pFunction)
{}

template <class F>
REF(RDOValue) RDOFunCalcStd<F>::doCalc(CREF(LPRDORuntime) pRuntime)
{
	calc<F::arity>(pRuntime);
	return m_value;
}

template <>
void calc<1>(CREF(LPRDORuntime) pRuntime)
{
	m_value = m_pFunction(getParam<typename F::arg1_type>(pRuntime, 0));
}

template <>
void calc<2>(CREF(LPRDORuntime) pRuntime)
{
	m_value = m_pFunction(getParam<typename F::arg1_type>(pRuntime, 0), getParam<F::arg2_type>(pRuntime, 1));
}

template <>
double getParam<double>(CREF(LPRDORuntime) pRuntime, ruint paramNumber)
{
	return pRuntime->getFuncArgument(paramNumber).getDouble();
}

template <>
int getParam<int>(CREF(LPRDORuntime) pRuntime, ruint paramNumber)
{
	return pRuntime->getFuncArgument(paramNumber).getInt();
}

CLOSE_RDO_RUNTIME_NAMESPACE

{'fraction_non_alphanumeric': 0.3457159976033553, 'fraction_numerical': 0.012582384661473937, 'mean_word_length': 1.5547054322876817, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 41, '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': '4737034', 'n_tokens_mistral': 1056, 'n_tokens_neox': 1025, 'n_words': 149}