Loading...
Searching...
No Matches
ml::Component< First, Rest > Class Template Reference

Primary base class for all user-facing Malena components. More...

#include <Malena/Core/Component.h>

Inheritance diagram for ml::Component< First, Rest >:
[legend]

Detailed Description

template<typename First = void, typename... Rest>
class ml::Component< First, Rest >

Primary base class for all user-facing Malena components.

// No manifest
class HUD : public ml::Component<> {};
// With manifest — gets Resources::get() and alias injection automatically
class MyWidget : public ml::ComponentWith<MyManifest>
{
MyWidget()
{
auto& tex = Resources::get(Images::Background);
auto& title = Resources::get(Text::WindowTitle);
}
};
Primary base class for all user-facing Malena components.
Definition Component.h:275
Component< M, Traits... > ComponentWith
Alias for Component<M, Traits...>.
Definition Component.h:299

If two manifests in the inheritance chain declare the same resource enum (Images, Fonts, Sounds, Text), a compile-time error is emitted with a clear message pointing to the resolution.

Template Parameters
FirstEither a Manifest subclass or the first extra trait.
RestAdditional traits.
See also
ComponentBase, ComponentCore, ComponentWith

Definition at line 271 of file Component.h.


The documentation for this class was generated from the following file: