<commit_before>/** @file
    @brief Implementation

    @date 2014

    @author
    <NAME>
    <<EMAIL>>
    <http://sensics.com>
*/

// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Version 2.0)

// Internal Includes
#include <osvr/Client/ClientInterface.h>
#include <osvr/Util/Verbosity.h>

// Library/third-party includes
// - none

// Standard includes
#include <boost/range/algorithm.hpp>

OSVR_ClientInterfaceObject::OSVR_ClientInterfaceObject(
    ::osvr::client::ClientContext *ctx, std::string const &path,
    OSVR_ClientInterfaceObject::PrivateConstructor const &)
    : m_ctx(ctx), m_path(path) {
    OSVR_DEV_VERBOSE("Interface initialized for " << m_path);
}

std::string const &OSVR_ClientInterfaceObject::getPath() const {
    return m_path;
}

::osvr::client::ClientContext &OSVR_ClientInterfaceObject::getContext() {
    return *m_ctx;
}
void OSVR_ClientInterfaceObject::registerCallback(OSVR_PoseCallback cb,
                                                  void *userdata) {
    using namespace std::placeholders;
    m_trackerCB.push_back(std::bind(cb, userdata, _1, _2));
}
void
OSVR_ClientInterfaceObject::triggerCallbacks(const OSVR_TimeValue &timestamp,
                                             const OSVR_PoseReport &report) {

    boost::for_each(
        m_trackerCB,
        [&](std::function<void(OSVR_TimeValue, const OSVR_PoseReport)> const &
                f) { f(timestamp, report); });
}

void OSVR_ClientInterfaceObject::update() {}<commit_msg>Simpler code using range-based for.<commit_after>/** @file
    @brief Implementation

    @date 2014

    @author
    <NAME>
    <<EMAIL>>
    <http://sensics.com>
*/

// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Version 2.0)

// Internal Includes
#include <osvr/Client/ClientInterface.h>
#include <osvr/Util/Verbosity.h>

// Library/third-party includes
// - none

// Standard includes
#include <boost/range/algorithm.hpp>

OSVR_ClientInterfaceObject::OSVR_ClientInterfaceObject(
    ::osvr::client::ClientContext *ctx, std::string const &path,
    OSVR_ClientInterfaceObject::PrivateConstructor const &)
    : m_ctx(ctx), m_path(path) {
    OSVR_DEV_VERBOSE("Interface initialized for " << m_path);
}

std::string const &OSVR_ClientInterfaceObject::getPath() const {
    return m_path;
}

::osvr::client::ClientContext &OSVR_ClientInterfaceObject::getContext() {
    return *m_ctx;
}
void OSVR_ClientInterfaceObject::registerCallback(OSVR_PoseCallback cb,
                                                  void *userdata) {
    using namespace std::placeholders;
    m_trackerCB.push_back(std::bind(cb, userdata, _1, _2));
}
void
OSVR_ClientInterfaceObject::triggerCallbacks(const OSVR_TimeValue &timestamp,
                                             const OSVR_PoseReport &report) {
    for (auto const &f : m_trackerCB) {
        f(timestamp, report);
    }
}

void OSVR_ClientInterfaceObject::update() {}
{'fraction_non_alphanumeric': 0.12153796024763766, 'fraction_numerical': 0.007820136852394917, 'mean_word_length': 3.311797752808989, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4422579', 'n_tokens_mistral': 965, 'n_tokens_neox': 925, 'n_words': 194}