|
책에 __classid의 역할에 대해
C++ Builder's representation of the Object Pascal class-reference type.
The TMetaClass for a given class can be acquired by using the __classid operator.
The Compiler uses the __classid operator to generate a pointer to the vtable
(virtual table) for the given classname.
이렇게 설명되어 있는데요. 예로,
RegisterComponentEditor(__classid(TAppLock), __classid(TAppLockEditor));
여기서,
1. __classid(TAppLock)가 TMetaClass* TAppLock라는 뜻인가요?
2. 그렇다면 TMetaClass* TAppLock로 안 쓰고 __class(TAppLock)로 쓰는 이유는 먼가요?
3. vtable를 가리키는 포인터를 생성한다고 했는데요. 저는 virtual function을 가지는
경우 이런 포인터가 생성된다고 알고 있었는데요. __classid 연산과 vtable과 무슨
관계가 있나요?
|