From 89e56aa866546e94237d4383960eeaae2fe9e12e Mon Sep 17 00:00:00 2001 From: myun2 Date: Fri, 21 Sep 2012 21:24:54 +0900 Subject: [PATCH] =?utf8?q?=E3=82=B4=E3=83=9F=E3=81=AF=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../roast/adapter/_old/iterator_adapter.hpp | 178 ------------------- .../linear_iterator_base.hpp | 113 ------------ .../33__unlimited_recursive/ptr_iterator_base.hpp | 55 ------ .../container/33__unlimited_recursive/tokenize.hpp | 73 -------- .../roast/std/_exile/myu_class_func_ptr.core | 22 --- .../include/roast/std/_exile/myu_class_func_ptr.h | 84 --------- roast/include/roast/std/parallelable.core | 20 --- roast/include/roast/std/parallelable.hpp | 196 --------------------- roast/include/roast/std/parallelable_.hpp | 157 ----------------- 9 files changed, 898 deletions(-) delete mode 100644 roast/include/roast/adapter/_old/iterator_adapter.hpp delete mode 100644 roast/include/roast/container/33__unlimited_recursive/linear_iterator_base.hpp delete mode 100644 roast/include/roast/container/33__unlimited_recursive/ptr_iterator_base.hpp delete mode 100644 roast/include/roast/container/33__unlimited_recursive/tokenize.hpp delete mode 100644 roast/include/roast/std/_exile/myu_class_func_ptr.core delete mode 100644 roast/include/roast/std/_exile/myu_class_func_ptr.h delete mode 100644 roast/include/roast/std/parallelable.core delete mode 100644 roast/include/roast/std/parallelable.hpp delete mode 100644 roast/include/roast/std/parallelable_.hpp diff --git a/roast/include/roast/adapter/_old/iterator_adapter.hpp b/roast/include/roast/adapter/_old/iterator_adapter.hpp deleted file mode 100644 index 86deaf29..00000000 --- a/roast/include/roast/adapter/_old/iterator_adapter.hpp +++ /dev/null @@ -1,178 +0,0 @@ -// Roast+ License - -#ifndef __SFJP_ROAST__adapter__iterator_adapter_HPP__ -#define __SFJP_ROAST__adapter__iterator_adapter_HPP__ - -#include "roast/std/comparable_n.hpp" -#include "roast/type_traits.hpp" - -#define roast_iloop(it) for(; it.is_valid(); it.next()) -#define roast_ifor(it) for(; it.is_valid(); it.next()) - -//#define _ROAST_ITERATOR_DISABLE_IN_WHILE - -namespace roast{ - - //////////////////////////////////////////////////////////// - - /* - _Impl implement: - - [example]: - - class iterator_impl_sample - { - public: - // Next (Like iterator ++) - void next(){ anything; } - - // Iterator pointer iValid? - bool is_valid(){ anything; } - - // Value - ValueType& get_value_ref(){ anything; } - }; - */ - - /////////////////////////////////////////////////////////////// - - template - class iterator_adapter : public _Impl, - public comparable_n< const iterator_adapter<_Impl>& > - { - private: - typedef _Impl _Base,_Impl,Impl; - public: - typedef _Impl __Base__iterator; - public: - //typedef typename _Impl::ValueType _ValueType,ValueType; - //typedef typename to_ref::type _ValueTypeRef,ValueTypeRef; - typedef typename _Impl::ValueTypeRef _ValueTypeRef,ValueTypeRef; - typedef typename remove_ref::type _ValueType,ValueType; - typedef typename to_ptr::type _ValueTypePtr,ValueTypePtr; - typedef typename to_const::type _CValueType,CValueType; - typedef typename to_const::type _CValueTypeRef,CValueTypeRef; - typedef typename to_const::type _CValueTypePtr,CValueTypePtr; - - //typedef typename _Impl::IndexType _IndexType,IndexType; - //typedef typename _Impl::ListType _ListType,ListType; - - protected: - int _compare(const iterator_adapter<_Impl>& target) const - { - return _Impl::compare(target); - } - - private: -#ifndef _ROAST_indexer_iterator_DISABLE_IN_WHILE - bool m_first_in_while; -#endif - public: - ////////////////////////////////////////// - - // Constructors - iterator_adapter() - { -#ifndef _ROAST_indexer_iterator_DISABLE_IN_WHILE - m_first_in_while = true; -#endif - } - ////////// - iterator_adapter(const _Impl& impl) - : _Base(impl) - { -#ifndef _ROAST_indexer_iterator_DISABLE_IN_WHILE - m_first_in_while = true; -#endif - } - /* - ////////// - iterator_adapter(ListType &array_in, IndexType length) - : _Base(&array_in, length) - { -#ifndef _ROAST_indexer_iterator_DISABLE_IN_WHILE - m_first_in_while = true; -#endif - } - ////////// - iterator_adapter(ListType &array_in, IndexType start, IndexType end) - : _Base(&start, start, end) - { -#ifndef _ROAST_indexer_iterator_DISABLE_IN_WHILE - m_first_in_while = true; -#endif - } - */ - - ////////////////////////////////////////// - - // Next - iterator_adapter operator ++() { - iterator_adapter old = *this; - next(); - return old; - } - iterator_adapter operator ++(int) { - next(); - return *this; - } - - // next() and is_valid() call. - // [for example]: - // do { /* anything */ } while(hoge.in_dowhile()); - bool in_dowhile() { - next(); - return is_valid(); - } - -#ifndef _ROAST_indexer_iterator_DISABLE_IN_WHILE - // next() and is_valid() call. - // [for example]: - // while(hoge.in_while()) { /* anything */ } - bool in_while() { - if ( m_first_in_while ) - m_first_in_while = false; - else - next(); - return is_valid(); - } -#endif - ////////////////////////////////////////// - - ////////////////////////////////////////// - - // Value - - //operator const ValueType() const { return get_value_ref(); } - ValueType get_value(){ return get_value_ref(); } - ValueTypePtr get_value_ptr() { return &get_value_ref(); } - - CValueType get_value() const { return get_value_ref(); } - CValueTypePtr get_value_ptr() const { return &get_value_ref(); } - - ValueTypeRef operator *() { return get_value_ref(); } - ValueTypePtr operator ->() { return &get_value_ref(); } - - CValueTypeRef operator *() const { return get_value_ref(); } - CValueTypePtr operator ->() const { return &get_value_ref(); } - - operator ValueType() { return get_value_ref(); } - operator ValueTypeRef() { return get_value_ref(); } - operator ValueTypePtr() { return &get_value_ref(); } - - operator CValueType() const { return get_value_ref(); } - operator CValueTypeRef() const { return get_value_ref(); } - operator CValueTypePtr() const { return &get_value_ref(); } - - iterator_adapter operator =(const iterator_adapter& from){ - _Impl::operator =(from); - return *this; - } - }; - - //////////////////////////////////////////////// - -}//end of roast namespace - -#endif//__SFJP_ROAST__adapter__iterator_adapter_HPP__ - diff --git a/roast/include/roast/container/33__unlimited_recursive/linear_iterator_base.hpp b/roast/include/roast/container/33__unlimited_recursive/linear_iterator_base.hpp deleted file mode 100644 index 84cc345c..00000000 --- a/roast/include/roast/container/33__unlimited_recursive/linear_iterator_base.hpp +++ /dev/null @@ -1,113 +0,0 @@ -// Roast+ License - -/* - -*/ -#ifndef __SFJP_ROAST__container__linear_iterator_base_HPP__ -#define __SFJP_ROAST__container__linear_iterator_base_HPP__ - -#include "roast/container/iterator_base.hpp" - -namespace roast -{ - ///////////////////////////////////////////////////////// - - // !! Not Implemented is_valid() Method. !! - - template - class _linear_iterator_impl_base - { - public: - typedef T _IteratorType, IteratorType; - typedef T _ValueType, ValueType; - protected: - T m_it; - - public: - _linear_iterator_impl_base(){} - _linear_iterator_impl_base(const T& _beg) - : m_it(_beg) - {} - /////////////////////////////////////////////////////////////////////// - - void setup(const T& _beg) - { - m_it = _beg; - } - - /////////////////////////////////////////////////////////////////////// - - int compare(const _linear_iterator_impl_base& target) const - { - return m_it - target.m_it; - } - - // Next (Like iterator ++) - void next() { - m_it++; - } - - // Value - T& get_value_ref() const - { - return m_it; - } - - /////////////////////////////////////////////////////////////////////// - - // Arithmetic operators - - _Self operator -(const _Self& target) const - { - return _Self(m_it - target.m_it); - } - _Self operator -(const T& target) const - { - return _Self(m_it - target); - } - _Self operator -(int n) const - { - return _Self(m_it - n); - } - _Self operator --() { - _Self old = *this; - m_it--; - return old; - } - _Self operator --(int) { - m_it--; - return *this; - } - - _Self operator +(const _Self& target) const - { - return _Self(m_it + target.m_it); - } - _Self operator +(const T& target) const - { - return _Self(m_it + target); - } - _Self operator +(int n) const - { - return _Self(m_it + n); - } - }; - - ///////////////////////////////////////////////////////// - - template - class linear_iterator_base : - public _iterator< _linear_iterator_impl_base > - { - private: - typedef _linear_iterator_impl_base _Impl; - typedef _iterator<_Impl> _Base; - public: - linear_iterator_base(){} - linear_iterator_base(const _Impl& impl) : _Base(impl){} - linear_iterator_base(T& _beg) - : _Base(_Impl(_beg)) {} - }; -} - -#endif//__SFJP_ROAST__container__linear_iterator_base_HPP__ diff --git a/roast/include/roast/container/33__unlimited_recursive/ptr_iterator_base.hpp b/roast/include/roast/container/33__unlimited_recursive/ptr_iterator_base.hpp deleted file mode 100644 index c6a0fc04..00000000 --- a/roast/include/roast/container/33__unlimited_recursive/ptr_iterator_base.hpp +++ /dev/null @@ -1,55 +0,0 @@ -// Roast+ License - -/* - -*/ -#ifndef __SFJP_ROAST__container__ptr_iterator_base_HPP__ -#define __SFJP_ROAST__container__ptr_iterator_base_HPP__ - -#include "roast/container/linear_iterator_base.hpp" - -namespace roast -{ - ///////////////////////////////////////////////////////// - - // !! Not Implemented is_valid() Method. !! - - template - class _ptr_iterator_impl_base : public _linear_iterator_impl_base - { - public: - typedef T _ValueType, ValueType; - private: - typedef _linear_iterator_impl_base _Base; - public: - _ptr_iterator_impl_base(){} - _ptr_iterator_impl_base(T* _beg) - : _Base(_beg) - {} - /////////////////////////////////////////////////////////////////////// - - // Value - T& get_value_ref() const - { - return *m_it; - } - }; - - ///////////////////////////////////////////////////////// - - template - class ptr_iterator_base : - public _iterator< _ptr_iterator_impl_base > - { - private: - typedef _ptr_iterator_impl_base _Impl; - typedef _iterator<_Impl> _Base; - public: - ptr_iterator_base(){} - ptr_iterator_base(const _Impl& impl) : _Base(impl){} - ptr_iterator_base(T* _beg) - : _Base(_Impl(_beg)) {} - }; -} - -#endif//__SFJP_ROAST__container__ptr_iterator_base_HPP__ diff --git a/roast/include/roast/container/33__unlimited_recursive/tokenize.hpp b/roast/include/roast/container/33__unlimited_recursive/tokenize.hpp deleted file mode 100644 index 70c8d52e..00000000 --- a/roast/include/roast/container/33__unlimited_recursive/tokenize.hpp +++ /dev/null @@ -1,73 +0,0 @@ -// Roast+ License - -/* - -*/ -#ifndef __SFJP_ROAST__container__tokenize_HPP__ -#define __SFJP_ROAST__container__tokenize_HPP__ - -#include - -namespace roast -{ - //template - template - class _tokenize_iterator_impl - { - protected: - _Iterator m_token_head; - _Iterator m_it; - _Separaters m_seps; - - int compare(const _tokenize_iterator_impl& target) const - { - return m_it - target.m_it; - } - - public: - typedef ::std::pair<_Iterator,_Iterator> _IteratorPair, IteratorPair, _ValueType, ValueType; - - ///////////////////////////////////////////////// - - _tokenize_iterator_impl(){} - _tokenize_iterator_impl(const _Iterator& it_start, const _Separaters& _seps) - : m_it(it_start), m_seps(_seps) - { - next(); - } - - ///////////////////////////////////////////////// - - // Next (Like iterator ++) - __forceinline void next() - { - // Head Iterator Backup - m_token_head = m_it; - - // Find Separater - while( m_it.is_valid() ) - { - m_it++; - if ( m_seps.find(*m_it).is_valid() ){ - m_it++; - break; - } - } - } - - // Iterator pointer iValid? - bool is_valid() const { - //return ( m_it != m_end ); - //return ( m_token_head != m_end ); - return m_token_head.is_valid(); - } - - // Value (::std::pair) - ValueType get_value_ref() const { - return ::std::make_pair(m_token_head, m_it); } - - ////////////////////////////////////////// - }; -} - -#endif//__SFJP_ROAST__container__tokenize_HPP__ diff --git a/roast/include/roast/std/_exile/myu_class_func_ptr.core b/roast/include/roast/std/_exile/myu_class_func_ptr.core deleted file mode 100644 index b3109432..00000000 --- a/roast/include/roast/std/_exile/myu_class_func_ptr.core +++ /dev/null @@ -1,22 +0,0 @@ -template -class __CMyuClassFuncPtr_CLASS_NAME : public CMyuClassFuncPtrBase -{ -public: - typedef _R (_CDummyBase::*CLASS_FUNC_PTR)(__CMyuClassFuncPtr_FUNC_ARGS__); - typedef CMyuClassFuncPtrBase _CORE; - -public: - __CMyuClassFuncPtr_CLASS_NAME(){} - virtual ~__CMyuClassFuncPtr_CLASS_NAME(){} - - _R Call(__CMyuClassFuncPtr_FUNC_ARGS__){ - return (((_CClassFuncDummy*)m_pInstance)->*(m_pFunc))(__CMyuClassFuncPtr_CALL_ARGS__); } -}; - - -#undef __CMyuClassFuncPtr_TMPL_ARGS__ -#undef __CMyuClassFuncPtr_FUNC_ARGS__ -#undef __CMyuClassFuncPtr_CALL_ARGS__ -#undef __CMyuClassFuncPtr_CLASS_NAME - -#undef __CMyuClassFuncPtr_NUM diff --git a/roast/include/roast/std/_exile/myu_class_func_ptr.h b/roast/include/roast/std/_exile/myu_class_func_ptr.h deleted file mode 100644 index 1f5b233c..00000000 --- a/roast/include/roast/std/_exile/myu_class_func_ptr.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef __ROAST__myu_class_func_ptr_H__ -#define __ROAST__myu_class_func_ptr_H__ - -#define _CMyuClassFuncPtr_TMPL_ARGS_(X) typename _ARG ##X -#define _CMyuClassFuncPtr_FUNC_ARGS_(X) _ARG ##X arg ##X -#define _CMyuClassFuncPtr_CALL_ARGS_(X) arg ##X - -// public CMyuClassFuncPtrBase<_R ()( -// ROAST_PP_COMMA_REPEAT_INC(NUM,_CMyuClassFuncPtr_FUNC_ARGS_))> - -// void Set(void* pInstance, CLASS_FUNC_PTR pFunc){ \ -// CMyuClassFuncPtrBase::Set(pInstance,(void*)pFunc); \ -// } \ -// \ -// - -#define _CMyuClassFuncPtr_X(NUM) \ - template \ - class CMyuClassFuncPtr##NUM \ - { \ - public: \ - class _CDummyBase{}; /* ƒ_ƒ~[ƒNƒ‰ƒXiƒRƒ“ƒpƒCƒ‰‚ðŒë–‚‰»‚·‚½‚ß‚¾‚¯‚ɁEEE */ \ - typedef _R (_CDummyBase::*CLASS_FUNC_PTR)( \ - ROAST_PP_COMMA_REPEAT_INC(NUM, _CMyuClassFuncPtr_FUNC_ARGS_)); \ - \ - protected: \ - void* m_pInstance; \ - CLASS_FUNC_PTR m_pFunc; \ - \ - public: \ - CMyuClassFuncPtr##NUM(){} \ - virtual ~CMyuClassFuncPtr##NUM(){} \ - \ - void Set(void* pInstance, CLASS_FUNC_PTR pFunc){ \ - m_pInstance = pInstance; \ - m_pFunc = pFunc; \ - } \ - \ - _R Call( \ - ROAST_PP_COMMA_REPEAT_INC(NUM,_CMyuClassFuncPtr_FUNC_ARGS_) ) \ - { \ - return (((_CDummyBase*)m_pInstance)->*(m_pFunc))( \ - ROAST_PP_COMMA_REPEAT_INC(NUM,_CMyuClassFuncPtr_CALL_ARGS_) ); } \ - }; - -#define _CMyuClassFuncPtr_0(NUM) \ - template \ - class CMyuClassFuncPtr##NUM \ - { \ - public: \ - class _CDummyBase{}; /* ƒ_ƒ~[ƒNƒ‰ƒXiƒRƒ“ƒpƒCƒ‰‚ðŒë–‚‰»‚·‚½‚ß‚¾‚¯‚ɁEEE */ \ - typedef _R (_CDummyBase::*CLASS_FUNC_PTR)( \ - ROAST_PP_COMMA_REPEAT_INC(NUM, _CMyuClassFuncPtr_FUNC_ARGS_)); \ - \ - protected: \ - void* m_pInstance; \ - CLASS_FUNC_PTR m_pFunc; \ - \ - public: \ - CMyuClassFuncPtr##NUM(){} \ - virtual ~CMyuClassFuncPtr##NUM(){} \ - \ - void Set(void* pInstance, CLASS_FUNC_PTR pFunc){ \ - m_pInstance = pInstance; \ - m_pFunc = pFunc; \ - } \ - \ - _R Call( \ - ROAST_PP_COMMA_REPEAT_INC(NUM,_CMyuClassFuncPtr_FUNC_ARGS_) ) \ - { \ - return (((_CDummyBase*)m_pInstance)->*(m_pFunc))( \ - ROAST_PP_COMMA_REPEAT_INC(NUM,_CMyuClassFuncPtr_CALL_ARGS_) ); } \ - }; - -_CMyuClassFuncPtr_0(0) -//_CMyuClassFuncPtr_X(1) - -ROAST_PP_REPEAT_INC(63,_CMyuClassFuncPtr_X) -// ƒeƒ“ƒvƒŒ[ƒgˆø”‚̍őå‚Í64ŒÂ‚Ü‚Å‚Ý‚½‚¢‚Å‚·Bi­‚È‚­‚Æ‚àVC++6.0‚̏ꍇ‚ł́j -// ‚¿‚È‚Ý‚Éboost‚Í50ŒÂ‚ðÅ‘å‚É‚µ‚Ä‚¢‚é‚Ý‚½‚¢‚¾‚ˁB“¯‚¶‚É‚µ‚½•û‚ª‚¢‚¢‚ñ‚¾‚낤‚©H - -#endif//__ROAST__myu_class_func_ptr_H__ diff --git a/roast/include/roast/std/parallelable.core b/roast/include/roast/std/parallelable.core deleted file mode 100644 index 51e5e916..00000000 --- a/roast/include/roast/std/parallelable.core +++ /dev/null @@ -1,20 +0,0 @@ -// Roast+ License - - -template -class parallelable ## _ROAST_PARALLELABLE__N -{ -public: - // Constructor/Destructor - parallelable ## _ROAST_PARALLELABLE__N(){} - virtual ~parallelable ## _ROAST_PARALLELABLE__N(){} - - //////////////////////////////////////// - - enum { - TYPE_DEFAULT = ROAST_PARALLELABLE_TYPE_DEFAULT, - TYPE_THREAD = ROAST_PARALLELABLE_TYPE_THREAD, - TYPE_GPGPU = ROAST_PARALLELABLE_TYPE_GPGPU, - TYPE_SIMD = ROAST_PARALLELABLE_TYPE_SIMD - }; -}; diff --git a/roast/include/roast/std/parallelable.hpp b/roast/include/roast/std/parallelable.hpp deleted file mode 100644 index 98ec251d..00000000 --- a/roast/include/roast/std/parallelable.hpp +++ /dev/null @@ -1,196 +0,0 @@ -// Roast+ License -/* - -*/ -#ifndef __SFJP_OPENMGL_roast_parallelable_HPP__ -#define __SFJP_OPENMGL_roast_parallelable_HPP__ - -//#include "roast/std/thread.hpp" - -#define ROAST_PARALLELABLE_TYPE_NULL (0) -#define ROAST_PARALLELABLE_TYPE_THREAD (10) -#define ROAST_PARALLELABLE_TYPE_GPGPU (20) - -#define ROAST_PARALLELABLE_TYPE_SIMD_AUTO (60) -#define ROAST_PARALLELABLE_TYPE_SIMD (ROAST_PARALLELABLE_TYPE_SIMD_AUTO) -#define ROAST_PARALLELABLE_TYPE_SIMD_MMX (ROAST_PARALLELABLE_TYPE_SIMD+1) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE (ROAST_PARALLELABLE_TYPE_SIMD+2) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE2 (ROAST_PARALLELABLE_TYPE_SIMD+3) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE3 (ROAST_PARALLELABLE_TYPE_SIMD+4) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE4 (ROAST_PARALLELABLE_TYPE_SIMD+5) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE41 (ROAST_PARALLELABLE_TYPE_SIMD+6) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE42 (ROAST_PARALLELABLE_TYPE_SIMD+7) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE_END (ROAST_PARALLELABLE_TYPE_SIMD+15) -#define ROAST_PARALLELABLE_TYPE_SIMD_AVX (ROAST_PARALLELABLE_TYPE_SIMD+16) - -#define ROAST_PARALLELABLE_TYPE_SIMD_3DNOW (ROAST_PARALLELABLE_TYPE_SIMD+30) - -#define ROAST_PARALLELABLE_TYPE_DEFAULT (ROAST_PARALLELABLE_TYPE_THREAD) -#define ROAST_PARALLELABLE_TYPE_AUTO (ROAST_PARALLELABLE_TYPE_DEFAULT) - - -#define ROAST_PARALLELABLE_MAX_PARALLEL_DEFAULT (-1) -#define ROAST_PARALLELABLE_MAX_PARALLEL_AUTO (ROAST_PARALLELABLE_MAX_PARALLEL_DEFAULT) -#define ROAST_PARALLELABLE_MAX_PARALLEL_CPU_COUNT (-2) - - -//////////////////////////////////////////////////// - -#define _ROAST_parallelable__TMPL_ARGS_CALLBACK(N) typename PARAM_T ## N -#define _ROAST_parallelable__FUNC_ARGS_CALLBACK(N) PARAM_T ## N param ## N -#define _ROAST_parallelable__CALL_ARGS_CALLBACK(N) param ## N - - -#define _ROAST_parallelable__CLASS_DECLARE_X(N) \ - template \ - class parallelable ## N \ - { \ - public: \ - typedef RET_T (CLASS_T::*CLASS_FUNC_PTR)( \ - ROAST_PP_COMMA_REPEAT_INC(N, _ROAST_parallelable__FUNC_ARGS_CALLBACK)); \ - protected: \ - CLASS_T* m_pClassInstance; \ - CLASS_FUNC_PTR m_pFunc; \ - RET_T m_ret; \ - \ - public: \ - /* Constructor/Destructor */ \ - parallelable ## N(CLASS_T* pClassInstance, CLASS_FUNC_PTR pFunc){ \ - set(pClassInstance, pFunc); \ - } \ - virtual ~parallelable ## N(){} \ - \ - void set(CLASS_T* pClassInstance, CLASS_FUNC_PTR pFunc){ \ - m_pClassInstance = pClassInstance; \ - m_pFunc = pFunc;\ - } \ - \ - RET_T& call( \ - ROAST_PP_COMMA_REPEAT_INC(N, _ROAST_parallelable__FUNC_ARGS_CALLBACK) ) \ - { \ - m_ret = (m_pClassInstance->*(m_pFunc))( \ - ROAST_PP_COMMA_REPEAT_INC(N, _ROAST_parallelable__CALL_ARGS_CALLBACK) ); \ - return m_ret; \ - } \ - RET_T& get_ret(){ return m_ret; } \ - \ - enum { \ - TYPE_DEFAULT = ROAST_PARALLELABLE_TYPE_DEFAULT, \ - TYPE_THREAD = ROAST_PARALLELABLE_TYPE_THREAD, \ - TYPE_GPGPU = ROAST_PARALLELABLE_TYPE_GPGPU, \ - TYPE_SIMD = ROAST_PARALLELABLE_TYPE_SIMD \ - }; \ - enum { \ - MAX_PARALLEL_DEFAULT = ROAST_PARALLELABLE_MAX_PARALLEL_DEFAULT, \ - MAX_PARALLEL_CPU_COUNT = ROAST_PARALLELABLE_MAX_PARALLEL_CPU_COUNT, \ - }; \ - }; - -///////////////////////////////////////////////////// - - -namespace roast{ - - - template - class parallelable0 - { - public: - typedef RET_T (CLASS_T::*CLASS_FUNC_PTR)(); - - protected: - CLASS_T* m_pClassInstance; - CLASS_FUNC_PTR m_pFunc; - RET_T m_ret; - - public: - // Constructor/Destructor - parallelable0(CLASS_T* pClassInstance, CLASS_FUNC_PTR pFunc){ - set(pClassInstance, pFunc); - } - virtual ~parallelable0(){} - - //////////////////////////////////////// - - void set(CLASS_T* pClassInstance, CLASS_FUNC_PTR pFunc){ - m_pClassInstance = pClassInstance; - m_pFunc = pFunc; - } - - RET_T& call() - { - m_ret = (m_pClassInstance->*(m_pFunc))(); - return m_ret; - } - - RET_T& get_ret(){ return m_ret; } - - enum { - TYPE_DEFAULT = ROAST_PARALLELABLE_TYPE_DEFAULT, - TYPE_THREAD = ROAST_PARALLELABLE_TYPE_THREAD, - TYPE_GPGPU = ROAST_PARALLELABLE_TYPE_GPGPU, - TYPE_SIMD = ROAST_PARALLELABLE_TYPE_SIMD - }; - enum { - MAX_PARALLEL_DEFAULT = ROAST_PARALLELABLE_MAX_PARALLEL_DEFAULT, - MAX_PARALLEL_CPU_COUNT = ROAST_PARALLELABLE_MAX_PARALLEL_CPU_COUNT, - }; - }; - - -//_ROAST_parallelable__CLASS_DECLARE_X(1) -ROAST_PP_REPEAT_INC(63, _ROAST_parallelable__CLASS_DECLARE_X) - - /////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/* - template - class parallelable_fast - { - public: - typedef FUNCOBJ_T._CDummyBase CLASS_TYPE; - typedef FUNCOBJ_T.CLASS_FUNC_PTR CLASS_FUNC_PTR; - typedef FUNCOBJ_T.RET_T RET_T; - - protected: - void* m_pClassInstance; - CLASS_FUNC_PTR m_pFunc; - RET_T m_ret; - - public: - // Constructor/Destructor - parallelable_fast(CLASS_TYPE pClassInstance, CLASS_FUNC_PTR pFunc){ - set(pClassInstance, pFunc); - } - virtual ~parallelable_fast(){} - - void set(CLASS_TYPE pClassInstance, CLASS_FUNC_PTR pFunc){ - m_pClassInstance = pClassInstance; - m_pFunc = pFunc; - } - - RET_T& call( - ROAST_PP_COMMA_REPEAT_INC(N, _ROAST_parallelable__FUNC_ARGS_CALLBACK) ) - { - m_ret = (((_CDummyBase*)m_pClassInstance)->*(m_pFunc))( - ROAST_PP_COMMA_REPEAT_INC(N, _ROAST_parallelable__CALL_ARGS_CALLBACK) ); - return m_ret; - } - RET_T& get_ret(){ return m_ret; } - - //////////////////////////////////////// - - enum { - TYPE_DEFAULT = ROAST_PARALLELABLE_TYPE_DEFAULT, - TYPE_THREAD = ROAST_PARALLELABLE_TYPE_THREAD, - TYPE_GPGPU = ROAST_PARALLELABLE_TYPE_GPGPU, - TYPE_SIMD = ROAST_PARALLELABLE_TYPE_SIMD - }; - }; -*/ -} - -#endif//__SFJP_OPENMGL_roast_parallelable_HPP__ diff --git a/roast/include/roast/std/parallelable_.hpp b/roast/include/roast/std/parallelable_.hpp deleted file mode 100644 index de01de9c..00000000 --- a/roast/include/roast/std/parallelable_.hpp +++ /dev/null @@ -1,157 +0,0 @@ -// Roast+ License -/* - -*/ -#ifndef __SFJP_OPENMGL_roast_parallelable_HPP__ -#define __SFJP_OPENMGL_roast_parallelable_HPP__ - -//#include "roast/std/thread.hpp" - -#define ROAST_PARALLELABLE_TYPE_NULL (0) -#define ROAST_PARALLELABLE_TYPE_THREAD (10) -#define ROAST_PARALLELABLE_TYPE_GPGPU (20) - -#define ROAST_PARALLELABLE_TYPE_SIMD_AUTO (60) -#define ROAST_PARALLELABLE_TYPE_SIMD (ROAST_PARALLELABLE_TYPE_SIMD_AUTO) -#define ROAST_PARALLELABLE_TYPE_SIMD_MMX (ROAST_PARALLELABLE_TYPE_SIMD+1) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE (ROAST_PARALLELABLE_TYPE_SIMD+2) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE2 (ROAST_PARALLELABLE_TYPE_SIMD+3) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE3 (ROAST_PARALLELABLE_TYPE_SIMD+4) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE4 (ROAST_PARALLELABLE_TYPE_SIMD+5) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE41 (ROAST_PARALLELABLE_TYPE_SIMD+6) -#define ROAST_PARALLELABLE_TYPE_SIMD_SSE42 (ROAST_PARALLELABLE_TYPE_SIMD+7) -#define ROAST_PARALLELABLE_TYPE_SIMD_AVX (ROAST_PARALLELABLE_TYPE_SIMD+16) - -#define ROAST_PARALLELABLE_TYPE_SIMD_3DNOW (ROAST_PARALLELABLE_TYPE_SIMD+30) - -#define ROAST_PARALLELABLE_TYPE_DEFAULT (ROAST_PARALLELABLE_TYPE_THREAD) -#define ROAST_PARALLELABLE_TYPE_AUTO (ROAST_PARALLELABLE_TYPE_DEFAULT) - - -//////////////////////////////////////////////////// - -#define _ROAST_parallelable__TMPL_ARGS_CALLBACK(N) typename PARAM_T ## N -#define _ROAST_parallelable__FUNC_ARGS_CALLBACK(N) PARAM_T ## N param ## N -#define _ROAST_parallelable__CALL_ARGS_CALLBACK(N) param ## N - - -#define _ROAST_parallelable__CLASS_DECLARE_X(N) \ - template \ - class parallelable ## N \ - { \ - public: \ - class _CDummyBase{}; /* ƒ_ƒ~[ƒNƒ‰ƒXiƒRƒ“ƒpƒCƒ‰‚ðŒë–‚‰»‚·‚½‚ß‚¾‚¯‚ɁEEE */ \ - typedef RET_T (_CDummyBase::*CLASS_FUNC_PTR)( \ - ROAST_PP_COMMA_REPEAT_INC(N, _ROAST_parallelable__FUNC_ARGS_CALLBACK)); \ - protected: \ - void* m_pClassInstance; \ - CLASS_FUNC_PTR m_pFunc; \ - RET_T m_ret; \ - \ - public: \ - /* Constructor/Destructor */ \ - parallelable ## N(void* pClassInstance, CLASS_FUNC_PTR pFunc){ \ - set(pClassInstance, pFunc); \ - } \ - virtual ~parallelable ## N(){} \ - \ - void set(void* pClassInstance, CLASS_FUNC_PTR pFunc){ \ - m_pClassInstance = pClassInstance; \ - m_pFunc = pFunc;\ - } \ - \ - RET_T& call( \ - ROAST_PP_COMMA_REPEAT_INC(N, _ROAST_parallelable__FUNC_ARGS_CALLBACK) ) \ - { \ - m_ret = (((_CDummyBase*)m_pClassInstance)->*(m_pFunc))( \ - ROAST_PP_COMMA_REPEAT_INC(N, _ROAST_parallelable__CALL_ARGS_CALLBACK) ); \ - return m_ret; \ - } \ - RET_T& get_ret(){ return m_ret; } \ - \ - enum { \ - TYPE_DEFAULT = ROAST_PARALLELABLE_TYPE_DEFAULT, \ - TYPE_THREAD = ROAST_PARALLELABLE_TYPE_THREAD, \ - TYPE_GPGPU = ROAST_PARALLELABLE_TYPE_GPGPU, \ - TYPE_SIMD = ROAST_PARALLELABLE_TYPE_SIMD \ - }; \ - }; - -///////////////////////////////////////////////////// - - -namespace roast{ - - template - class parallelable0 - { - public: - // Constructor/Destructor - parallelable0(){} - virtual ~parallelable0(){} - - //////////////////////////////////////// - - enum { - TYPE_DEFAULT = ROAST_PARALLELABLE_TYPE_DEFAULT, - TYPE_THREAD = ROAST_PARALLELABLE_TYPE_THREAD, - TYPE_GPGPU = ROAST_PARALLELABLE_TYPE_GPGPU, - TYPE_SIMD = ROAST_PARALLELABLE_TYPE_SIMD - }; - }; - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/* - template - class parallelable_fast - { - public: - typedef FUNCOBJ_T._CDummyBase CLASS_TYPE; - typedef FUNCOBJ_T.CLASS_FUNC_PTR CLASS_FUNC_PTR; - typedef FUNCOBJ_T.RET_T RET_T; - - protected: - void* m_pClassInstance; - CLASS_FUNC_PTR m_pFunc; - RET_T m_ret; - - public: - // Constructor/Destructor - parallelable_fast(CLASS_TYPE pClassInstance, CLASS_FUNC_PTR pFunc){ - set(pClassInstance, pFunc); - } - virtual ~parallelable_fast(){} - - void set(CLASS_TYPE pClassInstance, CLASS_FUNC_PTR pFunc){ - m_pClassInstance = pClassInstance; - m_pFunc = pFunc; - } - - RET_T& call( - ROAST_PP_COMMA_REPEAT_INC(N, _ROAST_parallelable__FUNC_ARGS_CALLBACK) ) - { - m_ret = (((_CDummyBase*)m_pClassInstance)->*(m_pFunc))( - ROAST_PP_COMMA_REPEAT_INC(N, _ROAST_parallelable__CALL_ARGS_CALLBACK) ); - return m_ret; - } - RET_T& get_ret(){ return m_ret; } - - //////////////////////////////////////// - - enum { - TYPE_DEFAULT = ROAST_PARALLELABLE_TYPE_DEFAULT, - TYPE_THREAD = ROAST_PARALLELABLE_TYPE_THREAD, - TYPE_GPGPU = ROAST_PARALLELABLE_TYPE_GPGPU, - TYPE_SIMD = ROAST_PARALLELABLE_TYPE_SIMD - }; - };*/ - -_ROAST_parallelable__CLASS_DECLARE_X(1) - -} - -#endif//__SFJP_OPENMGL_roast_parallelable_HPP__ -- 2.11.0