SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Member Functions | Public Attributes | List of all members
smtk::operation::Metadata Class Reference

Operations are registered to an operation manager at runtime with an instance of smtk::operation::Metadata. More...

#include <Metadata.h>

Public Types

using Observer = MetadataObserver
 
using Observers = MetadataObservers
 
using Association = smtk::attribute::ConstReferenceItemDefinitionPtr
 

Public Member Functions

 Metadata (const std::string &typeName, Operation::Index index, Operation::Specification specification, std::function< std::shared_ptr< smtk::operation::Operation >(void)> createFunctor)
 
const std::string & typeName () const
 
const Operation::Index & index () const
 
Operation::Specification specification () const
 
bool acceptsComponent (const smtk::resource::ComponentPtr &c) const
 
std::string label () const
 Return the user-facing label for the operation.
 
Association primaryAssociation () const
 Return the ReferenceItemDefinition to use when finding available operations. More...
 
std::set< std::string > groups () const
 

Public Attributes

std::function< std::shared_ptr< smtk::operation::Operation >void)> create
 

Detailed Description

Operations are registered to an operation manager at runtime with an instance of smtk::operation::Metadata.

Instances of this class must provide typeName, a unique (to the manager) string used to describe the operation within the manager. They must also provide a functor for the creation of the operation.

Member Function Documentation

◆ primaryAssociation()

Association smtk::operation::Metadata::primaryAssociation ( ) const
inline

Return the ReferenceItemDefinition to use when finding available operations.

While an operation is associated with an entire attribute resource, and that resource may define multiple attribute types, applications should be able to identify whether an operation is suitable for a selection using a single reference item. This method will return that item or, if the operation takes no persistent objects, a null pointer.

For now, the item is inferred; it is assumed to be the associationRule() entry of the operator's parameters() definition. A null pointer is returned if there is no association rule. In the future, this may change so that operations can specify how selections should be used to determine suitability.


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