Constructs a property descriptor from a PropSetter and a PropGetter.
Constructs a property descriptor from a PropSetterConst and a PropGetter.
Constructs a property descriptor from a PropSetter and as getter a pointer to a variable.
Constructs a property descriptor from a pointer to a variable used as a setter and getter.
A destructor is present on this object, but not explicitly documented in the source.
Copying this object is disabled.
A postblit is present on this object, but not explicitly documented in the source.
getter prototype
getter prototype
setter proptotype
setter proptotype
alternative setter prototype.
alternative setter prototype.
Returns this descriptor casted as pointer to a descriptor of the type given by template parameter.
The object that declares this property. When really needed, this value is set automatically.
Defines a property descriptor from a PropSetter and a PropGetter.
Defines a property descriptor from a PropSetter and as getter a pointer to a variable.
Defines a property descriptor from a pointer to a variable used as a setter and getter.
Returns this descriptor casted as pointer to a GenericDescriptor.
Gets the property value
Sets the property getter using a standard method.
Returns the hints for this property.
Sets of gets the string used to identify the property
Returns the RuntimeTypeInfo struct for the property type.
Sets the property value
Sets the property getter using a pointer to a variable
Sets the property setter using a pointer to a variable
Sets the property setter using a standard method.
1 static struct Foo 2 { 3 private int _value = 1; 4 PropDescriptor!int valueDescriptor; 5 6 void value(int v){_value = v;} 7 int value(){return _value;} 8 } 9 10 Foo foo; 11 // defines the property using the setter and the getter. 12 foo.valueDescriptor.define(&foo.value, &foo.value, "foo.value"); 13 // defines the property using the setter and a pointer to the field. 14 foo.valueDescriptor.define(&foo.value, &foo._value, "foo.value"); 15 // .get and .set allow to access the property value 16 foo.valueDescriptor.set(2); 17 assert(foo.valueDescriptor.get == 2); 18 // getter() and setter() too but they are used to set/get the delegates. 19 foo.valueDescriptor.setter()(1); 20 assert(foo.valueDescriptor.getter()() == 1); 21 // a descriptor has a fixed size, whatever is it's specialization, 22 // that allows to cast safely to any other descriptor type. 23 PropDescriptor!float* fpDescr = cast(PropDescriptor!float*) &foo.valueDescriptor; 24 // that's why the halper "as" is provided to cast 25 PropDescriptor!byte* byteDescr = fpDescr.as!byte; 26 // and the actual type can be retrieved with the rtti 27 assert(fpDescr.rtti is getRtti!int); 28 assert(byteDescr.rtti is getRtti!int);
Describes a property declared in an aggregate.
A property is described by a name, a setter and a getter. Several constructors allow to define the descriptor using a setter, a getter but also a pointer to the targeted field. Another useful member is the pointer to the Rtti structure matching to the descriptor specialization.