wxObject
全ての wxWidgets クラスのルートクラスです。これは、全ての導出されたクラスが必要なときにデストラクタを要求されることを確実にする、仮想デストラクタを宣言しています。
This is the root class of all wxWidgets classes.
It declares a virtual destructor which ensures that
destructors get called for all derived class objects where necessary.
wxObjectは、プログラムにクラス名・クラス階層を問いだすことの出来るクラスのインスタンスの生成を可能にします。
wxObject is the hub of a dynamic object creation
scheme, enabling a program to create instances of a class only knowing
its string class name, and to query the class hierarchy.
クラスには任意のデバッグバージョンの new と delete が含まれます。そしてそれはメモリの取得、開放にまつわる問題をトレースする手助けをすることが出来ます。
The class contains optional debugging versions
of new and delete, which can help trace memory allocation
and deallocation problems.
wxObject は、wxPen、wxBitmap等の参照カウンタオブジェクトを実装するために使うことが出来ます。
wxObject can be used to implement reference counted objects, such as
wxPen, wxBitmap and others.
See also
wxClassInfo, Debugging overview,
wxObjectRefData
Members
wxObject::wxObject
wxObject::~wxObject
wxObject::m_refData
wxObject::CopyObject
wxObject::Dump
wxObject::GetClassInfo
wxObject::GetRefData
wxObject::IsKindOf
wxObject::Ref
wxObject::SetRefData
wxObject::UnRef
wxObject::operator new
wxObject::operator delete
wxObject::wxObject
wxObject()
デフォルトコンストラクタ。
Default constructor.
wxObject::~wxObject
wxObject()
デストラクタ。参照カウンタを使用するオブジェクトのために、参照の解除(dereferencing)を行います。
Destructor. Performs dereferencing, for those objects
that use reference counting.
wxObject::m_refData
wxObjectRefData* m_refData
オブジェクトの参照カウントされたデータへのポインタ。
Pointer to an object which is the object's reference-counted data.
See also
wxObject::Ref, wxObject::UnRef,
wxObject::SetRefData,
wxObject::GetRefData,
wxObjectRefData
wxObject::CopyObject
virtual void CopyObject(wxObject& object_dest)
object_dest にこのオブジェクトのコピーを作成する。このオブジェクトが削除された後、object_dest が有効になるように、自己の十分なコピーを実行しなければなりません。
Create a copy of this object in object_dest. Must perform a full copy of self
so that object_dest will be valid after this object is deleted
wxObject::Dump
void Dump(ostream& stream)
仮想関数。これはメモリダンプを許すために導出されたクラスによって再定義されるでしょう。
A virtual function that should be redefined by derived classes to allow dumping of
memory states.
Parameters
stream
Remarks
現在、wxWidgets は導出されたクラスのためにダンプを定義しません、しかし、プログラマは彼ら自身のアプリケーションのためにそれを使いたいかもしれません。
この機能のインプリメンテーションはデバッグ・ビルド(__WXDEBUG__ を定義)に、オブジェクトのクラス名を書きます、さもなければ、それは何もしません。
Currently wxWidgets does not define Dump for derived classes, but
programmers may wish to use it for their own applications. Be sure to
call the Dump member of the class's base class to allow all information to be dumped.
The implementation of this function just writes the class name of the object
in debug build (__WXDEBUG__ defined), otherwise it does nothing.
wxObject::GetClassInfo
wxClassInfo * GetClassInfo()
この仮想関数は、DECLARE_CLASS マクロが使用されたとき RTTI (run-time type information) を要求する全てのクラスのために再定義されます。
This virtual function is redefined for every class that requires run-time
type information, when using DECLARE_CLASS macros.
wxObject::GetRefData
wxObjectRefData* GetRefData() const
m_refData のポインタを返します。
Returns the m_refData pointer.
See also
wxObject::Ref, wxObject::UnRef, wxObject::m_refData,
wxObject::SetRefData,
wxObjectRefData
wxObject::IsKindOf
bool IsKindOf(wxClassInfo *info)
このクラスが与えられたクラスのサブクラス(あるいは、同じもの)であるかどうか判定します。
Determines whether this class is a subclass of (or the same class as)
the given class.
Parameters
info
CLASSINFO マクロを使うことによって得るクラス情報オブジェクトへのポインター。
A pointer to a class information object, which may be obtained
by using the CLASSINFO macro.
Return value
info によって表現されたクラスがこれと同じクラスであるか、それに由来するならば TRUE を返す。
TRUE if the class represented by info is the same class as
this one or is derived from it.
Example
bool tmp = obj->IsKindOf(CLASSINFO(wxFrame));
wxObject::Ref
void Ref(const wxObject& clone)
このオブジェクトを clone の中のデータを参照させます。
Makes this object refer to the data in clone.
Parameters
clone
Remarks
最初に、この関数は現在参照しているデータをデクリメント(そして、開放)するために、自分自身の
wxObject::UnRef を呼び出します。
それから、自身の
clone へのポインタ m_refData にセットします。そして、内部では参照カウンタをインクリメントします。(?)
First this function calls
wxObject::UnRef on itself
to decrement (and perhaps free) the data it is currently referring to.
It then sets its own m_refData to point to that of clone, and increments the reference count
inside the data.
See also
wxObject::UnRef, wxObject::m_refData,
wxObject::SetRefData, wxObject::GetRefData,
wxObjectRefData
wxObject::SetRefData
void SetRefData(wxObjectRefData* data)
m_refData ポインターにセットする。
Sets the m_refData pointer.
See also
wxObject::Ref, wxObject::UnRef, wxObject::m_refData,
wxObject::GetRefData,
wxObjectRefData
wxObject::UnRef
void UnRef()
関連データの参照カウンタをデクリメントします。もし、それがゼロならデータを削除します。m_refData メンバーは NULL にセットされます。
Decrements the reference count in the associated data, and if it is zero, deletes the data.
The m_refData member is set to NULL.
See also
wxObject::Ref, wxObject::m_refData,
wxObject::SetRefData, wxObject::GetRefData,
wxObjectRefData
wxObject::operator new
void * new(size_t size, const wxString& filename = NULL, int lineNum = 0)
__WXDEBUG__ が定義されるとき、デバックバージョンのライブラリ専用の new オペレータが定義されます。
wxDebugContext オペレーションを許可し、メモリの割り当て操作を引き継ぎます。
The new operator is defined for debugging versions of the library only, when
the identifier __WXDEBUG__ is defined. It takes over memory allocation, allowing
wxDebugContext operations.
wxObject::operator delete
void delete(void buf)
__WXDEBUG__ が定義されるとき、デバックバージョンのライブラリ専用の delete オペレータが定義されます。
wxDebugContext オペレーションを許可し、メモリの開放操作を引き継ぎます。
The delete operator is defined for debugging versions of the library only, when
the identifier __WXDEBUG__ is defined. It takes over memory deallocation, allowing
wxDebugContext operations.