Sha256: 6b79d9062094705424a43ec13f6e9b046db2f7c0046d9c4f8c8b30d477ff5ebb

Contents?: true

Size: 914 Bytes

Versions: 4

Compression:

Stored size: 914 Bytes

Contents

// -*- c++ -*-
#pragma once
#ifndef __REFLEX_RUBY_TIMER_H__
#define __REFLEX_RUBY_TIMER_H__


#include <rucy/class.h>
#include <rucy/extension.h>
#include <reflex/timer.h>


namespace Reflex
{


	Rucy::Class timer_class ();
	// class Reflex::Timer


	template <typename T>
	class RubyTimer : public Rucy::ClassWrapper<T>
	{

		typedef Rucy::ClassWrapper<T> Super;

		public:

			virtual void fire ()
			{
				if (this->value.is_kind_of(timer_class()))
				{
					RUCY_SYM(call_timer_block);
					this->value.call(call_timer_block);
				}

				Super::fire();
			}

	};// RubyTimer


}// Reflex


RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(Reflex::Timer)


namespace Rucy
{


	template <> inline Class
	get_ruby_class<Reflex::Timer> ()
	{
		return Reflex::timer_class();
	}

	inline Value
	value (Reflex::Timer::Ref& ref, Value klass = Reflex::timer_class())
	{
		return value(ref.get(), klass);
	}


}// Rucy


#endif//EOH

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reflexion-0.1.32 include/reflex/ruby/timer.h
reflexion-0.1.31 include/reflex/ruby/timer.h
reflexion-0.1.30 include/reflex/ruby/timer.h
reflexion-0.1.29 include/reflex/ruby/timer.h