次の方法で共有


Module::MethodReleaseNotifier クラス

現在のモジュール内の最後のオブジェクトが解放されると、イベント ハンドラーを呼び出します。 イベント ハンドラーを指定するには、オブジェクトと、そのメソッドへのポインター メンバーを使います。

構文

template<typename T>
class MethodReleaseNotifier : public ReleaseNotifier;

パラメーター

T
メンバー関数がイベント ハンドラーであるオブジェクトの型。

メンバー

パブリック コンストラクター

名前 説明
Module::MethodReleaseNotifier::MethodReleaseNotifier Module::MethodReleaseNotifier クラスの新しいインスタンスを初期化します。

パブリック メソッド

名前 説明
Module::MethodReleaseNotifier::Invoke 現在の Module::MethodReleaseNotifier オブジェクトに関連付けられたイベント ハンドラーを呼び出します。

プロテクト データ メンバー

名前 説明
Module::MethodReleaseNotifier::method_ 現在の Module::MethodReleaseNotifier オブジェクトに対するイベント ハンドラーへのポインターを保持します。
Module::MethodReleaseNotifier::object_ メンバー関数が現在の Module::MethodReleaseNotifier オブジェクトに対するイベント ハンドラーであるオブジェクトへのポインターを保持します。

継承階層

ReleaseNotifier

MethodReleaseNotifier

必要条件

ヘッダー: module.h

名前空間: Microsoft::WRL

Module::MethodReleaseNotifier::Invoke

現在の Module::MethodReleaseNotifier オブジェクトに関連付けられたイベント ハンドラーを呼び出します。

void Invoke();

Module::MethodReleaseNotifier::method_

現在の Module::MethodReleaseNotifier オブジェクトに対するイベント ハンドラーへのポインターを保持します。

void (T::* method_)();

Module::MethodReleaseNotifier::MethodReleaseNotifier

Module::MethodReleaseNotifier クラスの新しいインスタンスを初期化します。

MethodReleaseNotifier(
   _In_ T* object,
   _In_ void (T::* method)(),
   bool release) throw() :
            ReleaseNotifier(release), object_(object),
            method_(method);

パラメーター

object
メンバー関数がイベント ハンドラーであるオブジェクト。

method
イベント ハンドラーであるパラメーター object のメンバー関数。

release
基になる Module::ReleaseNotifier::Release() メソッドの呼び出しを有効にするには、true を指定します。それ以外の場合は、false を指定します。

Module::MethodReleaseNotifier::object_

メンバー関数が現在の Module::MethodReleaseNotifier オブジェクトに対するイベント ハンドラーであるオブジェクトへのポインターを保持します。

T* object_;