|
Ruby 4.0.7p0 (2026-09-15 revision 229531a6cfbf07e3caef30dbac24a2a3f3fed482)
|
This is the struct that holds necessary info for a struct. More...
#include <rtypeddata.h>
Data Structures | |
| struct | [struct].function |
| Function pointers. More... | |
Data Fields | |
| const char * | wrap_struct_name |
| Name of structs of this kind. | |
| struct | function |
| const rb_data_type_t * | parent |
| Parent of this class. | |
| void * | data |
| Type-specific static data. | |
| VALUE | flags |
| Type-specific behavioural characteristics. | |
This is the struct that holds necessary info for a struct.
It roughly resembles a Ruby level class; multiple objects can share a rb_data_type_t instance.
Definition at line 208 of file rtypeddata.h.
| void* rb_data_type_struct::data |
Type-specific static data.
This area can be used for any purpose by a programmer who define the type. Ruby does not manage this at all.
Definition at line 304 of file rtypeddata.h.
| VALUE rb_data_type_struct::flags |
Type-specific behavioural characteristics.
This is a bitfield. It is an EXTREMELY WISE IDEA to leave this field blank. It is designed so that setting zero is the safest thing to do. If you risk to set any bits on, you have to know exactly what you are doing.
Definition at line 317 of file rtypeddata.h.
| const rb_data_type_t* rb_data_type_struct::parent |
Parent of this class.
Sometimes C structs have inheritance-like relationships. An example is struct sockaddr and its family. If you design such things, make rb_data_type_t for each of them and connect using this field. Ruby can then transparently cast your data back and forth when you call TypedData_Get_Struct().
Definition at line 298 of file rtypeddata.h.
Referenced by rb_typeddata_inherited_p().
| const char* rb_data_type_struct::wrap_struct_name |
Name of structs of this kind.
This is used for diagnostic purposes. This has to be unique in the process, but doesn't has to be a valid C/Ruby identifier.
Definition at line 215 of file rtypeddata.h.
Referenced by rb_check_typeddata().