Registry Declaration
A registry is used to share implementations of a certain interface. The declaration of the registry is typically found in the same header file that defines the interface.
The declaration of a registry is placed between the two .hxx files generated for the given header file. The registry is defined using the MAXON_REGISTRY attribute. It defines:
// --------------------------------------------------------------------- // Simple class to store a color. // --------------------------------------------------------------------- class ColorInterface : MAXON_INTERFACE_BASES (maxon::ObjectInterface) { MAXON_INTERFACE (ColorInterface, MAXON_REFERENCE_NORMAL , "net.maxonexample.interface.color" );
// --------------------------------------------------------------------- // Returns the RGB value of the color. // --------------------------------------------------------------------- MAXON_METHOD maxon::Color32 GetRGB() const ; };
// Define registry "ColorClasses" to give access to implementations of the ColorInterface interface MAXON_REGISTRY ( maxon::Class<ColorRef> , ColorClasses, "net.maxonexample.registry.colors" ); #include "example_registry2.hxx"