<commit_before>/**
 * \file
 * \brief SoftwareTimer class header
 *
 * \author Copyright (C) 2015 <NAME> http://www.distortec.com http://www.freddiechopin.info
 *
 * \par License
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
 * distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * \date 2015-11-15
 */

#ifndef INCLUDE_DISTORTOS_SOFTWARETIMER_HPP_
#define INCLUDE_DISTORTOS_SOFTWARETIMER_HPP_

#include "distortos/scheduler/SoftwareTimerControlBlock.hpp"

namespace distortos
{

/// SoftwareTimer is a base for software timers
class SoftwareTimer : private scheduler::SoftwareTimerControlBlock
{
public:

	/**
	 * \brief SoftwareTimer's constructor
	 */

	SoftwareTimer() :
			SoftwareTimerControlBlock{softwareTimerRunner, *this}
	{

	}

	using SoftwareTimerControlBlock::isRunning;

	using SoftwareTimerControlBlock::start;

	using SoftwareTimerControlBlock::stop;

protected:

	/**
	 * \brief SoftwareTimer's destructor
	 *
	 * \note Polymorphic objects of SoftwareTimer type must not be deleted via pointer/reference
	 */<commit_msg>SoftwareTimer::isRunning(): provide real function instead of "using ..."<commit_after>/**
 * \file
 * \brief SoftwareTimer class header
 *
 * \author Copyright (C) 2015 <NAME> http://www.distortec.com http://www.freddiechopin.info
 *
 * \par License
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
 * distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * \date 2015-11-15
 */

#ifndef INCLUDE_DISTORTOS_SOFTWARETIMER_HPP_
#define INCLUDE_DISTORTOS_SOFTWARETIMER_HPP_

#include "distortos/scheduler/SoftwareTimerControlBlock.hpp"

namespace distortos
{

/// SoftwareTimer is a base for software timers
class SoftwareTimer : private scheduler::SoftwareTimerControlBlock
{
public:

	/**
	 * \brief SoftwareTimer's constructor
	 */

	SoftwareTimer() :
			SoftwareTimerControlBlock{softwareTimerRunner, *this}
	{

	}

	/**
	 * \return true if the timer is running, false otherwise
	 */

	bool isRunning() const
	{
		return SoftwareTimerControlBlock::isRunning();
	}

	using SoftwareTimerControlBlock::start;

	using SoftwareTimerControlBlock::stop;

protected:

	/**
	 * \brief SoftwareTimer's destructor
	 *
	 * \note Polymorphic objects of SoftwareTimer type must not be deleted via pointer/reference
	 */
{'fraction_non_alphanumeric': 0.0990990990990991, 'fraction_numerical': 0.013104013104013105, 'mean_word_length': 4.253763440860215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '2958757', 'n_tokens_mistral': 803, 'n_tokens_neox': 718, 'n_words': 217}