Class ComponentDefinition

Class Documentation

class sixtyfps::interpreter::ComponentDefinition

ComponentDefinition is a representation of a compiled component from .60 markup.

It can be constructed from a .60 file using the ComponentCompiler::build_from_path() or ComponentCompiler::build_from_source() functions. And then it can be instantiated with the create() function.

The ComponentDefinition acts as a factory to create new instances. When you’ve finished creating the instances it is safe to destroy the ComponentDefinition.

Public Functions

inline ComponentDefinition(const ComponentDefinition &other)

Constructs a new ComponentDefinition as a copy of other.

inline ComponentDefinition &operator=(const ComponentDefinition &other)

Assigns other to this ComponentDefinition.

inline ~ComponentDefinition()

Destroys this ComponentDefinition.

inline ComponentHandle<ComponentInstance> create() const

Creates a new instance of the component and returns a shared handle to it.

inline sixtyfps::SharedVector<PropertyDescriptor> properties() const

Returns a vector of that contains PropertyDescriptor instances that describe the list of public properties that can be read and written using ComponentInstance::set_property and ComponentInstance::get_property.

inline sixtyfps::SharedVector<sixtyfps::SharedString> callbacks() const

Returns a vector of strings that describe the list of public callbacks that can be invoked using ComponentInstance::invoke_callback and set using ComponentInstance::set_callback.

inline sixtyfps::SharedString name() const

Returns the name of this Component as written in the .60 file.