+++ /dev/null
-#ifndef _SMART_FUNCTION_CALLBACK_H_
-#define _SMART_FUNCTION_CALLBACK_H_
-
-#include "smart_ptr.h"
-#include "function_callback.h"
-
-namespace sfcv {
-
- typedef smart_ptr<fc::function_callback_v> sfc_v;
-
- //--------------------------------------------------------------------------------
- // 各関数コールバッククラス生成関数群の返り値を、
- // 単純にsmart_ptrにしたもの。
- //--------------------------------------------------------------------------------
-
- //引数無し、返り値無しの静的関数のみのコールバック関数クラス作成
-
- inline smart_ptr<fc::function_callback_v> screate(void (*f)(void)) {
- return smart_ptr<fc::function_callback_v>(fc::create(f));
- }
-
- template<class T>
- smart_ptr<fc::function_callback_v> screate(void (T::*f)()) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(T::f));
- }
-
- //引数あり、静的関数のみ
- template<class Arg1>
- smart_ptr<fc::function_callback_v> screate(void (*f)(Arg1),Arg1 a1) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,a1));
- }
-
- template<class Arg1,class Arg2>
- smart_ptr<fc::function_callback_v> screate(void (*f)(Arg1,Arg2),Arg1 a1,Arg2 a2) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,a1,a2));
- }
-
- template<class Arg1,class Arg2,class Arg3>
- smart_ptr<fc::function_callback_v> screate(void (*f)(Arg1,Arg2,Arg3),Arg1 a1,Arg2 a2,Arg3 a3) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,a1,a2,a3));
- }
-
- template<class Arg1,class Arg2,class Arg3,class Arg4>
- smart_ptr<fc::function_callback_v> screate(void (*f)(Arg1,Arg2,Arg3,Arg4),Arg1 a1,Arg2 a2,Arg3 a3,Arg4 a4) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,a1,a2,a3,a4));
- }
-
- template<class Arg1,class Arg2,class Arg3,class Arg4,class Arg5>
- smart_ptr<fc::function_callback_v> screate(void (*f)(Arg1,Arg2,Arg3,Arg4,Arg5),
- Arg1 a1,Arg2 a2,Arg3 a3,Arg4 a4,Arg5 a5) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,a1,a2,a3,a4,a5));
- }
-
- //引数無し、メンバ関数
- template<class obj>
- smart_ptr<fc::function_callback_v> screate(void (obj::*f)(),obj* p) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,p));
- }
-
- template<class obj,class Arg1>
- smart_ptr<fc::function_callback_v> screate(void (obj::*f)(Arg1),obj* p,Arg1 a1) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,p,a1));
- }
-
- template<class obj,class Arg1,class Arg2>
- smart_ptr<fc::function_callback_v> screate(void (obj::*f)(Arg1,Arg2),obj* p,Arg1 a1,Arg2 a2) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,p,a1,a2));
- }
-
- template<class obj,class Arg1,class Arg2,class Arg3>
- smart_ptr<fc::function_callback_v> screate(void (obj::*f)(Arg1,Arg2,Arg3),obj* p,Arg1 a1,Arg2 a2,Arg3 a3) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,p,a1,a2,a3));
- }
-
- template<class obj,class Arg1,class Arg2,class Arg3,class Arg4>
- smart_ptr<fc::function_callback_v> screate(void (obj::*f)(Arg1,Arg2,Arg3,Arg4),obj* p,
- Arg1 a1,Arg2 a2,Arg3 a3,Arg4 a4) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,p,a1,a2,a3,a4));
- }
-
- template<class obj,class Arg1,class Arg2,class Arg3,class Arg4,class Arg5>
- smart_ptr<fc::function_callback_v> screate(void (obj::*f)(Arg1,Arg2,Arg3,Arg4,Arg5),obj* p,
- Arg1 a1,Arg2 a2,Arg3 a3,Arg4 a4,Arg5 a5) {
- return smart_ptr<fc::function_callback_v>(fc::function_callback_v::create(f,p,a1,a2,a3,a4,a5));
- }
-
-
-};
-
-
-namespace sfcr {
-
- template<class T>
- struct sfc_r
- {
- typedef smart_ptr<fc::function_callback_r<T> > type;
- };
-
- //--------------------------------------------------------------------------------
- // 返り値有りの関数コールバックの定義
- // 返り値はそれぞれ自由に設定することができる。
- //--------------------------------------------------------------------------------
-
- template<class Result>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (*f)(void)) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::create(f));
- }
-
- template<class Result, class T>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (T::*f)()) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f));
- }
-
- //非メンバ関数
- template<class Result, class Arg1>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (*f)(Arg1), Arg1 a1) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,a1));
- }
-
- template<class Result, class Arg1,class Arg2>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (*f)(Arg1,Arg2),Arg1 a1,Arg2 a2) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,a1,a2));
- }
-
- template<class Result, class Arg1,class Arg2,class Arg3>
- smart_ptr<fc::function_callback_r<Result> >
- screate(Result (*f)(Arg1,Arg2,Arg3),Arg1 a1,Arg2 a2,Arg3 a3) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,a1,a2,a3));
- }
-
- template<class Result, class Arg1,class Arg2,class Arg3,class Arg4>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (*f)(Arg1,Arg2,Arg3,Arg4),Arg1 a1,Arg2 a2,Arg3 a3,Arg4 a4) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,a1,a2,a3,a4));
- }
-
- template<class Result, class Arg1,class Arg2,class Arg3,class Arg4,class Arg5>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (*f)(Arg1,Arg2,Arg3,Arg4),
- Arg1 a1,Arg2 a2,Arg3 a3,Arg4 a4,Arg5 a5) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,a1,a2,a3,a4,a5));
- }
-
- //メンバ関数
- template<class Result, class T>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (T::*f)(),T* p) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,p));
- }
-
- template<class Result, class T,class Arg1>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (T::*f)(Arg1),T* p,Arg1 a1) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,p,a1));
- }
-
- template<class Result, class T,class Arg1,class Arg2>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (T::*f)(Arg1,Arg2),T* p,Arg1 a1,Arg2 a2) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,p,a1,a2));
- }
-
- template<class Result, class T,class Arg1,class Arg2,class Arg3>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (T::*f)(Arg1,Arg2,Arg3),T* p,Arg1 a1,Arg2 a2,Arg3 a3) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,p,a1,a2,a3));
- }
-
- template<class Result, class T,class Arg1,class Arg2,class Arg3,class Arg4>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (T::*f)(Arg1,Arg2,Arg3,Arg4),T* p,
- Arg1 a1,Arg2 a2,Arg3 a3,Arg4 a4) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,p,a1,a2,a3,a4));
- }
-
- template<class Result, class T,class Arg1,class Arg2,class Arg3,class Arg4,class Arg5>
- smart_ptr<fc::function_callback_r<Result> > screate(Result (T::*f)(Arg1,Arg2,Arg3,Arg4,Arg5),T* p,
- Arg1 a1,Arg2 a2,Arg3 a3,Arg4 a4,Arg5 a5) {
- return smart_ptr<fc::function_callback_r<Result> >(fc::function_callback_r<Result>::create(f,p,a1,a2,a3,a4,a5));
- }
-
-
-};
-
-
-#endif /* _SMART_FUNCTION_CALLBACK_H_ */