static_smart_ptr_cast Method
static_castを使ってsmart_ptrクラスライブラリリファレンス>クラス>smart_ptrをTType, TDestTypeにキャストします。
構文
template<typename TDestType, typename="" TType="">
inline smart_ptr<TDestType> static_smart_ptr_cast( smart_ptr<TType> op2 )
名前 | 説明 |
---|---|
op2 | TDestTypeにキャストされるsmart_ptr |
戻り値
static_castを実行した結果
備考
op2が実際にTDestType型 である必要があります。そうでない場合の動作は未定義です。
インフォメーション
ネームスペース: DShowLib
IC Imaging Control 3.5より導入。
サンプル
Grabber::getSinkTypePtrクラスライブラリリファレンス>クラス>Grabber>Grabber::getSinkTypePtr Methodから返されたGrabberSinkTypeクラスライブラリリファレンス>クラス>GrabberSinkTypeを実際の型にキャストする方法です。
grabber.setSinkType( FrameQueueSink::create( /* ... */ ) );
// ...
smart_ptr<FrameQueueSink> pSink = static_smart_ptr_cast<FrameQueueSink>( grabber.getSinkTypePtr() );