約 5,058,270 件
https://w.atwiki.jp/squirrel_code/pages/21.html
続 template × mix-in last update 2010/12/28 (Tue) しかし面倒な...なんとかならないのだろうか というわけで,なんとかしてみる. その2 その前に,少し落ち着いて考えてみる.そもそもメソッドのオーバーロードが必要となったのは,MixInA と MixInB が「ほぼ同じ」機能を持っていたからだ.MixInA と MixInB が全く異なる機能を持っているなら,そもそも同名のメソッドがあること自体,筋が悪い.同名のメソッドが無いならば,複数のクラスを Mix-in してもあまり問題はなさそうだ(実はあるんだが^^). なので,対処すべきは,複数 Mix-in されるクラスが, 全て同名のメソッド群を持ち ただし引数 or 戻り値が全て異なる 場合だろう. となれば, Mix-in されるクラスは template 化されているべきだろう.やってみる.MixInA と MixInB の実装をまとめられる以外に,何かご利益があるだろうか. // mixin.h #include list // for std list #include algorithm // for std find // コンテナに格納されるクラス class A { /* 省略 */ } class B { /* 省略 */ } // コンテナ機能を付加する Mix-in のテンプレート template typename T class MixIn { std list T ts; public MixIn() {} ~MixIn() {} void add(T* t); void remove(T* t); }; // MixIn の実装 template typename T void MixIn T add(T* t) { ts.push_back(t); } template typename T void MixIn remove(T* t); { typedef typename std list T iterator iter; iter i = std find(ts.begin(), ts.end(), t); if (i != ts.end()) ts.erase(i++); } // Mix-in されるクラス class Container private MixIn A , private MixIn B { public Container() MixIn A (), MixIn B () {} ~Container() {} template typename T void add(T* t) { MixIn T add(t); } template typename T void remove(T* t) { MixIn T remove(t); } }; // mixin.cpp #include "mixin.h" テンプレート化されたので,list iterator の typedef 時に typename が必要になることに注意. テンプレート化にともない, Container クラス内での名前の輸出をテンプレート関数にすることが可能となる.これで複数の Mix-in で提供されるメソッドの名前を全て輸出しなくてもよくなる. とはいえ,やっぱり名前の輸出が必要なことに代わりはない.なんとかならないだろうか. その3 ここで呼吸をととのえて,さらに考えてみる.Container クラス内での名前の輸出は,当然ながら Container クラスの public スコープへの干渉操作となる.これを public 継承で実現してはならないのは「その1」で見た通り.これをなんとかするには,続続 pImpl × 継承 でやったように,テンプレートを用いる. ところが,続続 pImpl × 継承 で使った名前の輸出テンプレートは,各 Mix-in を private/protected 継承している必要がある.よって,MixIn A と MixIn B を同時に Mix-in するためには,この2つを Mix-in するための専用のテンプレートが必要だ.Mix-in の種類が増えてくると,様々な Mix-in の組み合わせ全てに専用のテンプレートを用意しなくてはならない. そこでうーんと考えた.Mix-in の組み合わせを private 継承する操作を,Mix-in 1つの protected 継承と public 継承に置き換えられないだろうか.書いてみる. // mixin.h #include list // for std list #include algorithm // for std find // コンテナに格納されるクラス class A { /* 省略 */ } class B { /* 省略 */ } // コンテナ機能を付加する Mix-in のテンプレート template typename T class MixIn { std list T ts; public MixIn() {} ~MixIn() {} void add(T* t); void remove(T* t); }; // MixIn の実装 template typename T void MixIn T add(T* t) { ts.push_back(t); } template typename T void MixIn remove(T* t); { typedef typename std list T iterator iter; iter i = std find(ts.begin(), ts.end(), t); if (i != ts.end()) ts.erase(i++); } // デフォルトの基底クラス class DummyBase {}; // 1つづつ Mix-in するテンプレート template typename M, typename Base = DummyBase class Mix public Base, protected M {}; // Mix-in しつつ名前の輸出もするテンプレート template typename M, typename Base = DummyBase clas MixExport public Base, protected M { public template typename T void add(T* t) { MixIn T add(t); } void remove(T* t) { MixIn T remove(t); } }; // Mix-in されるクラス class Container public MixExport MixIn A , Mix MixIn B { public Container() {} ~Container() {} }; // mixin.cpp #include "mixin.h" MixIn C も Mix-in する場合は MixExport MixIn A , Mix MixIn B , Mix MixIn C を public 継承すればよい.あるいは Container がクラス Interface を public 継承している場合, MixExport MixIn a , Mix MixIn B , Interface のようになる.Interface がある場合でのデストラクタまわりがややこしかったが, Mix テンプレートや MixExport テンプレートに仮想デストラクタを書かずとも,Container クラスが Interface クラスのポインタ経由で delete されたとしてもちゃんと Container のデストラクタが呼ばれているようだ @ gcc. ここで注意点として,Interface クラスはその名の通り実装を持ってはならない.いや,持ってもいいのだが,持っていたとしても Interface クラスのデフォルトコンストラクタ以外のコンストラクタを呼ぶことはできない.ただこの制限は,public 継承で実装を再利用しないという方針を考えると問題ないし, 続続 pImpl × 継承 のようなやり方も使える. もう一つは,MixIn テンプレートを実体化したクラスもデフォルトコンストラクタ以外を呼べない点だ.MixIn A や MixIn B は実装だから,この制限は問題だ.・・・のだが,うまく回避する方法が思いつかない.あまり美しくないが,コンストラクタ以外の初期化関数を定義して Container クラスのコンストラクタで呼んでやるか,素直に Container クラス内で名前の輸出をするしかなさそうだ. 追記 テンプレート引数に初期値の情報を含んだクラスを入れてやるという方法がありますね. さて,これで十分だろうか.いやいや,問題は残っている.Java の interface はそのまま型として使える.つまり Interface インターフェイスを implement したクラスのインスタンスは, Interface 型の変数に放り込める. 上記の C++ Mix-in ではこれは不可能だ.Container クラスは Mix MixIn B として扱えるが,add や remove は呼べない.MixExport MixIn B なら add B と remove B が輸出されるが,これに Container クラスのインスタンスを入れることはできない. というかそもそも,Container が Interface を継承しているとき,今のままでは Interface のポインタ経由で add とか remove を呼び出せない.(なにせ Interface を書いてないからね)で,どう書けばいいんじゃい. なんとかならないだろうか(えー,もういいじゃん^^). trackback 参考 C++でMix-inもどき template で Mix-in コメント コメントの投稿テスト -- (tossy_squirrel) 2010-12-29 03 35 18 名前 コメント すべてのコメントを見る 関連ページ トップページ 続続 template × mix-in 関連ブログ #blogsearch
https://w.atwiki.jp/squirrel_code/pages/20.html
template × mix-in last update 2010/12/28 (Tue) さて,この記事のテーマとは template と mix-in でどちらが攻○でどちらが受○か,ではない! なんてタイトルをつけやがる….期待させて申し訳ないが(絶対違う)Mix-in とは,継承を用いて既存のクラスに機能を後付けしたいときに使う.簡単なコードは以下の通り. // mixin.h #include list // for std list #include algorithm // for std find // コンテナに格納されるクラス class A { /* 省略 */ } // コンテナ機能を付加する Mix-in class MixIn { std list A as; public MixIn() {} virtual ~MixIn() {} void add(A* a); void remove(A* a); }; // Mix-in されるクラス class Container public MixIn { public Container() MixIn() {} ~Container() {} }; // mixin.cpp #include "mixin.h" // MixIn の実装 void MixIn add(A* a) { as.push_back(a); } void MixIn remove(A* a); { typedef std list A iterator iter; iter i = std find(as.begin(), as.end(), a); if (i != as.end()) as.erase(i++); } コンテナのデストラクタの実装はサボり^^.こんな感じで,Container クラスに後付けでクラス A のコンテナ機能を付加できる. Mix-in が便利なのは,複数の Mix-in を用意して,それをがんがん後付けしていけること.試しにクラス B のコンテナ機能も付加してみる. その1 // mixin.h #include list // for std list #include algorithm // for std find // コンテナに格納されるクラス class A { /* 省略 */ } class B { /* 省略 */ } // A のコンテナ機能を付加する Mix-in class MixInA { std list A as; public MixInA() {} virtual ~MixInA() {} void add(A* a); void remove(A* a); }; // B のコンテナ機能を付加する Mix-in class MixInB { std list B bs; public MixInB() {} virtual ~MixInB() {} void add(B* b); void remove(B* b); }; // Mix-in されるクラス class Container public MixInA, public MixInB { public Container() MixInA(), MixInB() {} ~Container() {} }; // mixin.cpp #include "mixin.h" // MixInA の実装 void MixInA add(A* a) { as.push_back(a); } void MixInA remove(A* a); { typedef std list A iterator iter; iter i = std find(as.begin(), as.end(), a); if (i != as.end()) as.erase(i++); } // MixInB の実装 void MixInB add(B* b) { bs.push_back(b); } void MixInB remove(B* b); { typedef std list B iterator iter; iter i = std find(bs.begin(), bs.end(), b); if (i != bs.end()) bs.erase(i++); } main 関数から Cointainer add を呼んでやって,これを gcc でコンパイルすると error request for member add is ambiguous と怒られる. MixInA から継承した add(A* a) と MixInB から継承した add(B* a) では引数の型が違うのにもかかわらず,自動ではオーバーロードされない.これは template を用いた mix-in でも同じで,最後に Mix-in したメソッド以外は名前修飾してやらないとメソッドが見つからないというエラーになる. pImpl × 継承 の(その2)でもメソッドのオーバーライドをしているが,やはり C++ で実装の再利用に public 継承を用いてはいけないのである(たぶん). C++ の教義に従えば,ここは Mix-in を private 継承し, Container 内でそれを呼ぶのがスマートである(ような気がする). その2 // mixin.h #include list // for std list #include algorithm // for std find // コンテナに格納されるクラス class A { /* 省略 */ } class B { /* 省略 */ } // A のコンテナ機能を付加する Mix-in class MixInA { std list A as; public MixInA() {} ~MixInA() {} void add(A* a); void remove(A* a); }; // B のコンテナ機能を付加する Mix-in class MixInB { std list B bs; public MixInB() {} ~MixInB() {} void add(B* b); void remove(B* b); }; // Mix-in されるクラス class Container private MixInA, private MixInB { public Container() MixInA(), MixInB() {} ~Container() {} // MixInA の呼び出し void add(A* a) { MixInA add(a); } void remove(A* a) { MixInA remove(a); } // MixInB の呼び出し void add(B* b) { MixInB add(b); } void remove(B* a) { MixInB remove(b); } }; // mixin.cpp #include "mixin.h" // MixInA の実装 void MixInA add(A* a) { as.push_back(a); } void MixInA remove(A* a); { typedef std list A iterator iter; iter i = std find(as.begin(), as.end(), a); if (i != as.end()) as.erase(i++); } // MixInB の実装 void MixInB add(B* b) { bs.push_back(b); } void MixInB remove(B* b); { typedef std list B iterator iter; iter i = std find(bs.begin(), bs.end(), b); if (i != bs.end()) bs.erase(i++); } Mix-in クラスはもはや public 継承されないので,デストラクタの virtual は外している. しかし面倒な.なんとかならんものか... trackback 参考 C++でMix-inもどき template で Mix-in コメント コメントの投稿テスト -- (tossy_squirrel) 2010-12-29 03 35 18 名前 コメント すべてのコメントを見る 関連ページ トップページ 続 template × mix-in 関連ブログ #blogsearch
https://w.atwiki.jp/websozai/pages/16.html
template template
https://w.atwiki.jp/ageofconan/pages/66.html
Combos Level Cooldown Stamina 要Feat 方向 Combo名 説明 0 0 0 - - Combo Placeholder 2 10 20 - - Sweep 複数の敵に当たる攻撃を行う 4 15 22 - - Slam 敵をknock downさせる攻撃を行う 5 8 152 - - Enraging Strike I A combination of low blow and verbal goading intended to infuriate an attacker and lock them into combat with the soldier. Useful in a battle, the actions of an enraged enemy can be predicted and dealt with more easily. 11 10 217 - - Enraging Strike II 17 10 217 - - Enraging Strike III 5 60 173 - - Shield Sweep I The guardian flings an enemy backwards by sweeping their shield through them and following up the momentum with a vicious strike. 52 60 173 - - Shield Sweep III 76 60 195 - - Shield Sweep IV 7 9 195 - - Brutal Enraging Strike I The soldier taunts their enemy as they attack to lock them into combat with the soldier. Useful in a battle, the actions of an enraged enemy can be predicted and dealt with more easily. 13 11 173 - - Brutal Enraging Strike II 19 13 303 - - Brutal Enraging Strike III 5 10 ? - - Leech Life I This savage attack also triggers a lifetap effect. For a short time, a portion of the damage inflicted by the dark templar will be converted into healing 24 10 ? - - Leech Life II 40 10 ? - - Leech Life III 56 10 ? - - Leech Life IV 64 10 ? - - Leech Life V 80 10 ? - - Leech Life VI 7 15 ? - - Blood for Aid I The Dark Templar dedicates the blood spilled by this strike to the dark powers of the underworld. The victim is more susceptible to crushing and slashing attacks, and all melee attacks against them have an increased chance to hit. 20 15 ? - - Blood for Aid II 36 15 ? - - Blood for Aid III 60 15 ? - - Blood for Aid IV 76 15 ? - - Blood for Aid V 15 60 ? - - A Soul for our Feast I The Dark Templar drains life essence from their target. As an added blasphemy, the essence is also bestowed upon the Dark Templar s teammates. Foul incantations accompany this blow. 52 60 ? - - A Soul for our Feast II 17 12 ? - - Mystical Bane I After striking with a Mystical bane combo, for a brief time the Dark Templar s attacks have a chance of triggering mana restoration effect. 28 12 ? - - Mystical Bane II 44 12 ? - - Mystical Bane III 68 12 ? - - Mystical Bane IV 32 20 ? - - Unhallowed Blight I This strike spills blood and weakens the victim s resistance to unholy damage. 48 20 ? - - Unhallowed Blight II 72 20 ? - - Unhallowed Blight III Spells Level Mana 要Feat Spell名 説明 10 120 - Aura of Dread Fury (Rank 1) A long lasting invocation, it grants the caster and any of their company a chance of inflicting bonus unholy damage with melee and ranged attacks. Only one Aura may be active at any time. 30 325 - Aura of Dread Fury (Rank 2) 50 475 - Aura of Dread Fury (Rank 3) 70 715 - Aura of Dread Fury (Rank 4) 13 120 - Drain Life (Rank 1) This blood rite enables the dark templar to absorb blood spilled by them in battle. A fraction of the damage the caster inflicts will be converted into instant healing. 25 280 - Drain Life (Rank 2) 40 405 - Drain Life (Rank 3) 55 515 - Drain Life (Rank 4) 70 715 - Drain Life (Rank 5) 20 245 - Aura of Infusion (Rank 1) A long lasting invocation, it grants the caster and any of their company a chance of recovering health when attacked. Only one Aura may be active at any time. 35 365 - Aura of Infusion (Rank 2) 50 480 - Aura of Infusion (Rank 3) 65 660 - Aura of Infusion (Rank 4) 80 825 - Aura of Infusion (Rank 5) 20 20 - Martyrdom (Rank 1) The dark templar sacrifices a fountain of their own blood, infusing both themselves and their brethren with unnatural regeneration for a brief time. 35 30 - Martyrdom (Rank 2) 50 40 - Martyrdom (Rank 3) 65 55 - Martyrdom (Rank 4) 80 65 - Martyrdom (Rank 5) 50 475 - Covenant of Invulnerability (Rank 1) The dark templar gains protection in a fountain of blood and crimson runes. Some of the health damage inflicted on them in battle is converted into mana damage instead (while they have mana left). Only one Soul Covenant spell may be active at any time. 65 669 - Covenant of Invulnerability (Rank 2) 80 820 - Covenant of Invulnerability (Rank 3) 20 0 - Pact of Malacodor Grants all melee attacks additional unholy damage for a short period of time. This spell costs no mana to cast, but requires a significant sacrifice of health that can kill a reckless caster. 25 0 - Dark Burden The dark templar calls upon the victim s own sins, using them to weigh them down, briefly slowing them.
https://w.atwiki.jp/tetoteconnect/pages/135.html
ジャンル バーチャル タイトル TEMPLATE アーティスト 星街すいせい(ホロライブ) コレオグラファー SOLID CUBE BPM 解禁方法 2023/01/10 追加配信2023/12/05 MANIAC譜面追加 公式MV https //youtu.be/mBuHQeL-OO8 著作権情報 © 2016 COVER Corp. 詳細 難易度 楽曲Lv ノーツ数 STANDARD 4 193 EXPERT 8 206 ULTIMATE 10 228 MANIAC 15 263 CONNECT - - 星街(ほしまち)すいせいは、カバー株式会社が運営するバーチャルアイドル事務所「ホロライブ」に所属するVtuber。 歌とアイドルをこよなく愛する永遠の18歳のアイドルVTuber(プロフィール原文ママ)。 2018年3月に個人勢としてデビュー後、「イノナカミュージック(カバーが展開していた音楽レーベル)」への参加を経て 0期生として2019年12月に「ホロライブ」へ転属となった。 当該曲は2022/03/31の3Dライブ配信「Selfish of a Rough Stone【#星街すいせい4周年LIVE】」の終盤にて 突如発表され、同日24時(=22/04/01の午前0時)に発売されたデジタルシングルの表題曲。 作詞/作曲/編曲を作曲家・シンガーソングライターのキタニタツヤが担当している。 攻略等 動画 ULTIMATE譜面 (ALL PERFECT)① ULTIMATE(ALL PERFECT)② EXPERT(ALL PERFECT) STANDARD(ALL PERFECT)
https://w.atwiki.jp/encodememo/pages/70.html
2010/09/11 06 04 15 Template 解像度 CRF値 フレームレート ソース解像度 放送局 1280x720 話数 CPU fps 容量 備考 #01 #02 #03 #04 #05 #06 #07 #08 #09 #10 #11 #12 #13 #14 #15 #16 #17 #18 #19 #20 #21 #22 #23 #24 #25 #26 #01 「」 #02 「」 #03 「」 #04 「」 #05 「」 #06 「」 #07 「」 #08 「」 #09 「」 #10 「」 #11 「」 #12 「」 #13 「」 #14 「」 #15 「」 #16 「」 #17 「」 #18 「」 #19 「」 #20 「」 #21 「」 #22 「」 #23 「」 #24 「」 #25 「」 #26 「」
https://w.atwiki.jp/hellgate_london/pages/942.html
Monster Template [部分編集] 生息地 (出現するマップ名) Lv Normal (Nightmare ) Rank Greater Demon Caste (Demon/Beast/Spectral/Necroの区分) 関連クエスト Named Item (ボスの名前つきの固有アイテムがあれば以下の行に追加する) (固有アイテム1) (固有アイテム2) ※上記に画像がないときは名前.jpgでアップロードしてください。 攻略法 [部分編集] ボスの倒し方の他、いわゆる「回し方」の情報も募集しています。 Drop情報 Normal [部分編集] アイテム1 アイテム2 Nightmare [部分編集] アイテム1 アイテム2
https://w.atwiki.jp/squirrel_code/pages/23.html
続続続 template × mix-in last update 2010/12/28 (Tue) さて, 前回 でテンプレートを用いた Mix-in についてはほぼカタがついたはずだ.なに?ソースが長い? Mix-in を定義するたびに IMix だの Mix だのを定義するのがめんどい? なんとかならんのか,だって? というわけで,なんとかしてみる^^. その6 まず, template を使ったテクニックではある程度長くなるのは仕方がない.というか,前回のコードでも裏で結構頑張って短くしているのだ.なので,これを越えるためにはいろいろと禁断の秘儀^^を用いる必要がある. こういう場面で C のプログラマが真っ先に思いつくのはプリプロセッサマクロだろう.私もそう思う.だが,今回のコードを展開するマクロを作るには,マクロが Mix-in するメソッド名のリスト(add と remove)を取り扱える必要がある. そこでまたまたいろいろ調べていたら, boost/preprocessor という秘法を見つけた(たぶんインドの奥地かどっかで) 書いてみる. // mixin.hpp #include list // for std list #include algorithm // for std find #include boost/mpl/list.hpp #include boost/mpl/iter_fold.hpp #include boost/mpl/deref.hpp #include boost/type.hpp #include boost/preprocessor/seq/for_each.hpp // === ここから汎用 Mix-in フレームワーク #define _DEF_DUMMYBASE_METHOD(r, data, elem) \ void elem(); #define _DEF_INTERFACE_USING(r, data, elem) \ using _BASE elem; using _MIXIN elem; #define MIXIN(ns, seq) \ namespace mixin { \ namespace ns { \ class idummy {}; \ template typename _BASE \ class ibase public _BASE \ { \ public \ BOOST_PP_SEQ_FOR_EACH(_DEF_DUMMYBASE_METHOD, _, seq) \ }; \ template typename _MITER, typename _BASE \ class _IMIX1 \ public _BASE, public boost mpl deref _MITER type \ { \ public \ typedef typename boost mpl deref _MITER type _MIXIN; \ BOOST_PP_SEQ_FOR_EACH(_DEF_INTERFACE_USING, _, seq) \ }; \ template typename _TLIST, typename _BASE = idummy \ class imix \ public boost mpl iter_fold \ _TLIST, ibase _BASE , \ _IMIX1 boost mpl _2, boost mpl _1 type \ {}; \ }} #define _DEF_CLASS_USING(r, data, elem) \ using _BASE elem; #define DEF_MIXIN_CALL_BEGIN(ns, tname, seq) \ namespace mixin { \ namespace ns { \ class dummy {}; \ template typename _BASE \ class base public _BASE \ { \ public \ BOOST_PP_SEQ_FOR_EACH(_DEF_DUMMYBASE_METHOD, _, seq) \ }; \ template typename _MITER, typename _BASE class _MIX1; \ template typename _TLIST, typename _BASE = dummy \ class mix \ public boost mpl iter_fold \ _TLIST, base _BASE , \ _MIX1 boost mpl _2, boost mpl _1 type \ {}; \ template typename _MITER, typename _BASE \ class mix1 \ public _BASE, private boost mpl deref _MITER type \ { \ public \ typedef typename boost mpl deref _MITER type tname; \ BOOST_PP_SEQ_FOR_EACH(_DEF_CLASS_USING, _, seq) #define DEF_MIXIN_CALL_END \ }; \ }} // === 汎用 Mix-in フレームワークここまで === class A { /* 省略 */ }; class B { /* 省略 */ }; /* Mix-in インターフェイスの定義. * 最初に MIXIN(名前空間名, メソッド名リスト) を宣言する. * 名前空間名は,同名メソッドを持つ Mix-in の系列に対し,一意に決める. */ MIXIN(c, (add) (remove)) template typename T class MI { public virtual ~MI() {} virtual void add(T* t) = 0; virtual void remove(T* t) = 0; }; /** Mix-in の実装の定義. * 最初に MIXIN_CALL_BEGIN(名前空間名, 型名, メソッド名リスト)を宣言 * 次に private 継承されている Mix-in のメソッドを * public スコープに輸出するコードを書く. * Mix-in した実装は型名で参照できる. * 輸出コードの終わりに MIXIN_CALL_END を宣言 */ DEF_MIXIN_CALL_BEGIN(c, mixin_t, (add) (remove)) void add(typename mixin_t t_type* t) { mixin_t add(t); } void remove(typename mixin_t t_type* t) { mixin_t remove(t); } DEF_MIXIN_CALL_END template typename T class MixIn { std list T* ts; public typedef T t_type; MixIn() {} ~MixIn() {} void add(T* t); void remove(T* t); }; template typename T void MixIn T add(T* t) { ts.push_back(t); } template typename T void MixIn T remove(T* t) { typedef typename std list T* iterator iterator; iterator iter = std find(ts.begin(), ts.end(), t); if (iter != ts.end()) ts.erase(iter++); } /** Mix-in フレームワークにより, * mixin 名前空間名 imix と mixin 名前空間名 mix が定義されている. * これに Mix-in の mpl list を渡して public 継承すればよい. */ using namespace mixin c; namespace mpl = boost mpl; class Interface public imix mpl list MI A , MI B { public virtual ~Interface() {} }; class Container public mix mpl list MixIn A , MixIn B , Interface { public Container() {} ~Container() {} }; // mixin.cpp #include "mixin.h" いきなりコードの変態度が上がってしまった^^.上のコードが何言ってるのかわからねーと思うが,俺も何書いてるのかわからねー.頭がどうかなりそうなんだが,使うだけなら「汎用 Mix-in フレームワーク」 としてあるところはそのままコピってヘッダファイルか何かに放り込んでしまえば良い.やるべきことは,それ以外の部分をがりがり書くだけ. BOOST.PP により,任意個数のメソッドを持つ Mix-in に対応している.インターフェイスが別のインターフェイスを継承する場合は,mixin c imix の第2引数に基底インターフェイスを指定すればよい. インターフェイスがいらなければ MIXIN の宣言もインターフェイスの定義も必要ない. mixin c mix の第2引数はデフォルトで mixin c dummy なので,単に第2引数を省略してやればよい. 注意点としては, mixin c 名前空間の中にクラス名 idummy, dummy, 及びクラステンプレート名 ibase, imix, base, mix が展開される.ここで名前の輸出コードは mixin c 中に展開されるので,この中で他で定義した idummy とかを使っているとおかしなことになる.問題になる場合はよそで定義したほうのクラスを名前空間に入れて,修飾名で指定してほしい. また引数を取らないメソッドには対応していない.mix の中で各 Mix-in の完全修飾名を typedef することも考えたんだが,ちょっとめんどそうなので,ダミーの引数を取るとかで回避してくれ. ついでに, Mix-in が protected なメソッドを提供する場合のフレームワークも提供しておこうか(あまり使わないと思うが). #define DEF_MIXIN_CALL_BEGIN_WITH_PROTECTED(ns, tname, seq, pseq) \ namespace mixin { \ namespace ns { \ class dummy {}; \ template typename _BASE \ class base public _BASE \ { \ public \ BOOST_PP_SEQ_FOR_EACH(_DEF_DUMMYBASE_METHOD, _, seq) \ protected \ BOOST_PP_SEQ_FOR_EACH(_DEF_DUMMYBASE_METHOD, _, pseq) \ }; \ template typename _MITER, typename _BASE class _MIX1; \ template typename _TLIST, typename _BASE = dummy \ class mix \ public boost mpl iter_fold \ _TLIST, base _BASE , \ _MIX1 boost mpl _2, boost mpl _1 type \ {}; \ template typename _MITER, typename _BASE \ class _MIX1 \ public _BASE, \ private boost mpl deref _MITER type \ { \ public \ typedef typename boost mpl deref _MITER type tname; \ protected \ BOOST_PP_SEQ_FOR_EACH(_DEF_CLASS_USING, _, pseq) \ public \ BOOST_PP_SEQ_FOR_EACH(_DEF_CLASS_USING, _, seq) メソッド void pmethod(T* t) が protected なメソッドとして,使い方は DEF_MIXIN_CALL_BEGIN_WITH_PROTECTED(c, mixin_t, (add) (remove), (pmethod)) void add(typename mixin_t t_type* t) { mixin_t add(t); } void remove(typename mixin_t t_type* t) { mixin_t remove(t); } protected void pmethod(typename mixin_t t_type* t) { mixin_t pmethod(t); } DEF_MIXIN_CALL_END だ. Container クラスで template typename T void method(T* t) { pmethod(t); } みたいに使ってくれ. もう問題は残ってない・・・よな? trackback 参考 C++でMix-inもどき template で Mix-in コメント コメントの投稿テスト -- (tossy_squirrel) 2010-12-29 03 35 18 名前 コメント すべてのコメントを見る 関連ページ トップページ 続続 template × mix-in 関連ブログ #blogsearch
https://w.atwiki.jp/kakeibo/pages/13.html
編集する Template 価格 9999円 Lite/Free版 有・無 シンプルさ 簡単 ☆☆☆★★ 複雑 難易度 易 ☆☆☆★★ 難 取引登録までの最短タップ数 x回 リンク 有料版 http //itunes.apple.com/jp/app/ 機能 対応 備考 パスコード設定 ○・× 締め日設定 ○・× 複数アカウント ○・× 資産移動 ○・× 収入管理 ○・× 予算管理 ○・× カテゴリ別予算管理 ○・× 入力時の計算機能 ○・× カテゴリ設定 ○・× サブカテゴリ設定 ○・× テンプレート ○・× 定期支出設定 ○・× 残高繰越 ○・× メモ機能 ○・× 集計機能 ○・× グラフ表示 ○・× バックアップ ○・× データインポート ○・× データエクスポート ○・× PCと同期 ○・× 【備考】
https://w.atwiki.jp/o8sxm8o/pages/9.html
Template Window 最初から入っている各種有機化合物や実験器具等の図を貼り付けることが出来る。 Save User Template 作った図をテンプレートとして保存し、いつでも呼び出せるように出来る。 Table of Radicals 各種ラジカルのテンプレートが入っている。 Periodic Table 元素周期表を呼び出して、各元素のプロフィールを参照できる。