PropertyPublisherImpl

Default implementation of a PropertyPublisher.

When mixed in an aggregate type, two analyzers can be used to create automatically the PropDescriptors that match the setter and getter pairs anotated with @Set and @Get or that match the fields annotated with @SetGet.

The analyzers are usually called in this(). The template has to be mixed in each class generation that introduces new annotated properties.

The analyzers, propCollectorGetPairs() and propCollectorGetFields(), are function templates that must be instantiated with the type they have to scan (typeof(this)). The two analyzers can be called with a third function template: collectPublications().

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

clearDescriptors
void clearDescriptors()

Destructs each property descriptor and empties their container. After the call new descriptors can still be added.

collectPublications
void collectPublications()

Performs all the possible analysis.

collectPublicationsFromFields
void collectPublicationsFromFields()

Creates the properties descriptors for each field annotated with @SetGet.

collectPublicationsFromPairs
void collectPublicationsFromPairs()

Creates the property descriptors for the setter/getter pairs annotated with @Set/@Get.

declarator
Object declarator()
void declarator(Object value)

see PropertyPublisher

publication
PropDescriptor!T* publication(const(char)[] name, bool createIfMissing = false)

Returns a pointer to a descriptor according to its name.

publicationCount
size_t publicationCount()

see PropertyPublisher

publicationFromIndex
GenericDescriptor* publicationFromIndex(size_t index)

see PropertyPublisher

publicationFromName
GenericDescriptor* publicationFromName(const(char)[] name)

see PropertyPublisher

Variables

_publishedDescriptors
Array!(void*) _publishedDescriptors;

Contains the list of PropDesrcriptors created by the analyzers. Even if it's possible to access directly the array, it's safer to use ($D publication()), ($D publicationFromName()) and ($D publicationFromIndex()).

Meta