SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A factory for badges that appear in descriptive phrases. More...
#include <BadgeFactory.h>
Additional Inherited Members | |
Public Member Functions inherited from smtk::common::Factory< Badge, void, smtk::common::factory::Inputs< BadgeSet &, const Configuration::Component & > > | |
bool | registerType () |
Register a Type to the factory. | |
bool | registerType (Metadata &&metadata) |
Register a Typeusing the Type's Metadata. | |
bool | registerTypes () |
Register a tuple of Types. | |
bool | unregisterType () |
Unregister a Type. | |
bool | unregisterType (const std::string &typeName) |
Unregister a Type using its type name. | |
bool | unregisterType (const std::size_t &typeIndex) |
Unregister a Type using its type index. | |
bool | unregisterTypes () |
Unregister a tuple of Types. | |
bool | contains () const |
Determine whether or not a Type is available. | |
bool | contains (const std::string &typeName) const |
Determine whether or not a Type is available using its type name. | |
bool | contains (const std::size_t typeIndex) const |
Determine whether or not a Type is available using its type index. | |
std::unique_ptr< Type > | create (Args &&... args) const |
Create an instance of a Type. | |
std::unique_ptr< Badge > | createFromName (const std::string &typeName, Args &&... args) const |
Create an instance of a Type using its type name. | |
std::unique_ptr< Badge > | createFromIndex (const std::size_t &typeIndex, Args &&... args) const |
Create an instance of a Type using its type name. | |
std::shared_ptr< Type > | make (Args &&... args) const |
Make a shared instance of a Type. | |
std::shared_ptr< Badge > | makeFromName (const std::string &typeName, Args &&... args) const |
Make a shared instance of a Type using its type name. | |
std::shared_ptr< Badge > | makeFromIndex (const std::size_t &typeIndex, Args &&... args) const |
Create an instance of a Type using its type name. | |
Interface< TagType, true > | get () const |
Access a convenience Interface for creating objects that singles out one of the three modes of creation: by type, by type name and by type index. | |
A factory for badges that appear in descriptive phrases.
A badge factory creates badges for use in PhraseModel views. A "badge" in this context is an object that takes an input descriptive phrase and returns an SVG icon with an optional tooltip and action to be performed when clicked by a user. A badge may indicate it is not applicable to a descriptive phrase.
Badges are owned by a BadgeSet, which is in turn owned by a PhraseModel, Thus, there is a single Badge instance per PhraseModel rather than one per DescriptivePhrase. To register a Badge subclass, it must have a default constructor and a constructor that takes references to a BadgeSet and a Configuration::Component.