Component

Component is a high-level class that proposes an automatic memory managment model based on ownership. It also verifies the requirements to make its instances referencable and serializable.

Ownership: A Component can be created with iz.memory.construct. As constructor parameter another Component can be specified. It's in charge for freeing this "owned" instance. Components that's not owned have to be freed manually. A reference to an owned object can be escaped. To be notified of its destruction, it's possible to observe the component or its owner by adding an observer to the componentSubject.

Referencable: Each Component instance that's properly named is automatically registered in the ReferenceMan, as a void reference. This allows some powerfull features such as the Object property editor or the Serializer to inspect, store, retrieve a Component between two sessions.

Serializable: A Component implements the PropertyPublisher interface. Each field annotated with @SetGet and each setter/getter pair annotated with @Set and @Get is automatically published and is usable by a PropertyBinder, by a Serializer or by any other system based on the PropDescriptor system.

Constructors

this
this()

Destructor

~this
~this()

Destructs this and all the owned instances.

Members

Functions

componentSubject
ComponentSubject componentSubject()

Returns the subject allowing ComponentObservers to observe this instance.

getUniqueName
char[] getUniqueName(in char[] base)

Suggests an unique Component name according to base.

name
void name(const(char)[] value)
const(char)[] name()

Defines the name of this Component.

nameAvailable
bool nameAvailable(in char[] value)

Returns true if a string is available as an unique Component name.

owner
const(Component) owner()

Returns this instance onwer.

qualifiedName
const(char)[] qualifiedName()

Returns the fully qualified name of this component in the owner Component tree.

Static functions

create
C create(Component owner)

Constructs a new instance whose life-time will be managed.

Inherited Members

From PropertyPublisher

publicationCount
size_t publicationCount()

Returns the count of descriptor this class publishes.

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

Returns a pointer to a descriptor according to its name. Similar to the publication() function template excepted that the result type has not to be specified.

publicationFromIndex
GenericDescriptor* publicationFromIndex(size_t index)

Returns a pointer the index-th descriptor. Index must be within the [0 .. publicationCount] range.

declarator
Object declarator()
void declarator(Object value)

Pointer to the object that has created the descriptor leading to this PropertyPublisher instance.

Meta