<commit_before><commit_msg>add macro for client implementation<commit_after>#ifndef INCLUDE_NET_MFCLIENT_HELPER_MACROS_H
#define INCLUDE_NET_MFCLIENT_HELPER_MACROS_H
/**
 * @file include/net/MFClientHelperMacros.h
 * @author <NAME>
 * @date Created <2010-07-08 11:23:24>
 */

#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/enum_params.hpp>
#include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/stringize.hpp>

#define MF_CLIENT_IMPL_CONNECT(agentInfo, serviceName) \
const std::string kMFClientImplAgentInfo(agentInfo); \
const std::string kMFClientImplServiceName(serviceName)

#define MF_CLIENT_IMPL_SET_serialize(r, req, ind, arg) \
::message_framework::mf_serialize(arg, req, ind);

#define MF_CLIENT_IMPL_SET(args) \
::messageframework::ServiceRequestInfoPtr req( \
    new ::messageframework::ServiceRequestInfo \
); \
req->setServiceName(kMFClientImplServiceName); \
BOOST_PP_SEQ_FOR_EACH_I(MF_CLIENT_IMPL_SET_serialize,req,args) \

#define MF_CLIENT_IMPL_RETURN_deserialize(r, res, ind, arg) \
::messageframework::mf_deserialize(arg, res, ind);

#define MF_CLIENT_IMPL_RETURN_res(args) \
ServiceResultPtr res; \
if (requestService(kMFClientImplAgentInfo, kMFClientImplServiceName, req, res)) \
{ \
    BOOST_PP_SEQ_FOR_EACH_I(MF_CLIENT_IMPL_RETURN_deserialize,res,args) \
    return true; \
} \
return false

#define MF_CLIENT_IMPL_RETURN_nores(args) \
return requestService(kMFClientImplAgentInfo, kMFClientImplServiceName, req)

#define MF_CLIENT_IMPL_RETURN(args) \
BOOST_PP_IF( \
    BOOST_PP_EQUAL(0, BOOST_PP_SEQ_SIZE(args)), \
    MF_CLIENT_IMPL_RETURN_nores, \
    MF_CLIENT_IMPL_RETURN_res \
)(args)

#endif // INCLUDE_NET_MFCLIENT_HELPER_MACROS_H
{'fraction_non_alphanumeric': 0.11369509043927649, 'fraction_numerical': 0.007751937984496124, 'mean_word_length': 7.380952380952381, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 15, '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': '5880621', 'n_tokens_mistral': 722, 'n_tokens_neox': 706, 'n_words': 97}