Archicad 27 C++ API
Loading...
Searching...
No Matches
API_Guid Struct Reference

Represents a GS::Guid in the API layer. More...

#include <API_Guid.hpp>

Public Member Functions

ULong GenerateHashValue () const
 

Public Attributes

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]
 

Detailed Description

Represents a GS::Guid in the API layer.

Remarks
API_Guid is essentially a GS::Guid. It has the same size and structure, and only exists because of certain C++ language limitations: namely that a union (like API_Element) cannot contain a class which has a constructor or destructor. Since API_Elem_Head needs to contain a Guid member, and it cannot be a GS::Guid, the API_Guid structure was introduced. This means that you should treat API_Guid structures as GS::Guid in your code, and use the following provided functions to convert between the two:
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)
API_Guid & GSGuid2APIGuid(GS::Guid &guid)
Definition: API_Guid.hpp:75
GS::Guid & APIGuid2GSGuid(API_Guid &guid)
Definition: API_Guid.hpp:61
Represents a GS::Guid in the API layer.
Definition: API_Guid.hpp:45
All these functions do two things:
  • check that API_Guid and GS::Guid are the same size at compile time and
  • reinterpret_cast the input API_Guid reference to a GS::Guid reference, or vice versa. There are comparison operators (==,!=, <, >=, >, >=) defined to compare API_Guids with each other or with GS::Guid s. There's also a macro called APINULLGuid for the API_Guid representation of the GS::NULLGuid constant. From Archicad 12 you are able to use API_Guid for GS::HashTable key because it has GenerateHashValue method.