API_Guid
API 계층의 GS::Guid를 표현합니다.
typedef struct { UInt32 time_low; unsigned short time_mid; unsigned short time_hi_and_version; unsigned char clock_seq_hi_and_reserved; unsigned char clock_seq_low; unsigned char node[6]; } API_Guid;
설명
API_Guid는 본질적으로 GS::Guid입니다. 동일한 크기와 구조를 가지고 있으며 특정 c++ 언어 제한 때문에 존재하는 것입니다: 즉 (API_Element 같은) union은 생성자 또는 소멸자를 가진 클래스를 포함할 수 없습니다. API_Elem_Head가 Guid 멤버를 포함할 필요가 있으며 GS::Guid가 될 수 없으므로, API_Guid structure가 도입되었습니다.
이것은 당신이 코드에서 API_Guid structure들을 GS::Guid로 취급해야 하며, 양쪽 사이에서 변환하기 위해 다음 제공되는 함수들을 사용해야 한다는 것을 의미합니다:
inline GS::Guid& APIGuid2GSGuid (API_Guid& guid)
inline const GS::Guid& APIGuid2GSGuid (const API_Guid& guid)
inline API_Guid& GSGuid2APIGuid (GS::Guid& guid)
inline const API_Guid& GSGuid2APIGuid (const GS::Guid& guid)
이 모든 함수들은 다음 2가지를 수행합니다:
- 컴파일 시간에 API_Guid와 GS::Guid가 같은 크기인지 확인합니다. 그리고
- 입력 API_Guid 레퍼런스를 GS::Guid 레퍼런스로, 혹은 반대로
reinterpret_cast
합니다.
API_Guid와 API_Guid 또는 GS::Guid와 비교하기 위해 정의된 비교 연산자들(==, !=, <, <=, >, >=)이 있습니다.
GS::NULLGuid
상수의 API_Guid 표현을 위한 매크로 호출 APINULLGuid
도 있습니다.
ArchiCAD 12부터 GS::HashTable
키를 위한 API_Guid
를 사용할 수 있습니다. 왜냐하면 GenerateHashValue
메서드를 가지고 있기 때문입니다.
요구사항
- 버전: API 11.01 또는 이후
- 헤더: API_Guid.hpp