SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | Protected Member Functions | List of all members
smtk::markup::TagIndividual Class Reference

Create an ontology node that tags the associated objects as individual instances of a class. More...

#include <TagIndividual.h>

Inheritance diagram for smtk::markup::TagIndividual:
[legend]
Collaboration diagram for smtk::markup::TagIndividual:
[legend]

Public Member Functions

 smtkTypeMacro (smtk::markup::TagIndividual)
 
 smtkCreateMacro (TagIndividual)
 
 smtkSharedFromThisMacro (smtk::operation::Operation)
 
 smtkSuperclassMacro (smtk::operation::XMLOperation)
 
- Public Member Functions inherited from smtk::operation::XMLOperation
 smtkTypeMacro (XMLOperation)
 
 smtkSharedFromThisMacro (smtk::operation::Operation)
 
- Public Member Functions inherited from smtk::operation::Operation
 smtkTypeMacroBase (smtk::operation::Operation)
 
virtual Index index () const
 
virtual bool configure (const smtk::attribute::AttributePtr &changedAttribute=smtk::attribute::AttributePtr(), const smtk::attribute::ItemPtr &changedItem=smtk::attribute::ItemPtr())
 Update the operation's specification and operations to be consistent. More...
 
virtual bool ableToOperate ()
 Check if the operation's attribute resource is valid. More...
 
Result operate ()
 Execute the operation, log its outcome and return its results. More...
 
Outcome safeOperate ()
 Execute the operation in an asynchronous environment. More...
 
Outcome safeOperate (Handler handler)
 
virtual bool releaseResult (Result &result)
 Release the operation result returned by operate(). More...
 
virtual smtk::io::Loggerlog () const
 Retrieve the operation's logger. More...
 
Specification specification ()
 This accessor facilitates the lazy construction of the specification, allowing for derived implementations of its creation. More...
 
Parameters parameters ()
 Access the operation's input parameters, constructing them if necessary. More...
 
Parameters parameters () const
 
Result createResult (Outcome)
 Create an attribute representing this operation's result type. More...
 
ManagerPtr manager () const
 Operations that are managed have a non-null pointer to their manager.
 
bool restoreTrace (const std::string &trace)
 restore operation parameters from the trace of a previously run operation.
 
void setManagers (const std::shared_ptr< smtk::common::Managers > &m)
 Operations may be passed application state in the form of a Managers type-container.
 
std::shared_ptr< smtk::common::Managersmanagers () const
 
virtual bool threadSafe () const
 Is this type of operation safe to launch in a thread?
 
smtk::resource::ManagerPtr resourceManager ()
 retrieve the resource manager, if available.
 
Result operate (Key)
 

Protected Member Functions

Result operateInternal () override
 Perform the actual operation and construct the result.
 
smtk::markup::OntologyIdentifier::Ptr findOrCreateTag (smtk::markup::Resource *resource, const std::string &nodeName, const std::string &ontologyName, const std::string &nodeURL, const smtk::attribute::ComponentItem::Ptr &created, const smtk::attribute::ComponentItem::Ptr &modified, bool &createdIdentifier)
 Find or create an OntologyIdentifier with the given nodeName, ontologyName, and nodeURL. More...
 
std::size_t tagNodes (const smtk::markup::OntologyIdentifier::Ptr &tag, const smtk::attribute::ReferenceItem::Ptr &assocs, const smtk::attribute::ComponentItem::Ptr &modified)
 For each object in assocs, connect it to tag and append it to the modified values. More...
 
std::size_t untagNodes (const smtk::markup::OntologyIdentifier::Ptr &tag, const smtk::attribute::ReferenceItem::Ptr &assocs, const smtk::attribute::ComponentItem::Ptr &modified, const smtk::attribute::ComponentItem::Ptr &expunged)
 For each object in assocs, disconnect it from tag and append it to the modified nodes. More...
 
const char * xmlDescription () const override
 
- Protected Member Functions inherited from smtk::operation::XMLOperation
Specification createSpecification () override
 
- Protected Member Functions inherited from smtk::operation::Operation
virtual ResourceAccessMap identifyLocksRequired ()
 Identify resources to lock, and whether to lock them for reading or writing. More...
 
virtual void postProcessResult (Result &)
 
virtual void markModifiedResources (Result &)
 
virtual bool unmanageResources (Result &)
 
virtual void generateSummary (Result &)
 
Specification createBaseSpecification () const
 

Additional Inherited Members

- Public Types inherited from smtk::operation::Operation
enum  Outcome {
  Outcome::UNABLE_TO_OPERATE, Outcome::CANCELED, Outcome::FAILED, Outcome::SUCCEEDED,
  Outcome::UNKNOWN = -1
}
 
typedef std::size_t Index
 
typedef std::shared_ptr< smtk::attribute::AttributeParameters
 
typedef std::shared_ptr< smtk::attribute::AttributeResult
 
typedef std::shared_ptr< smtk::attribute::ResourceSpecification
 
typedef std::shared_ptr< smtk::attribute::DefinitionDefinition
 
- Public Attributes inherited from smtk::operation::Operation
friend Manager
 
friend ImportPythonOperation
 
- Protected Attributes inherited from smtk::operation::Operation
int m_debugLevel { 0 }
 
std::weak_ptr< Managerm_manager
 
std::shared_ptr< smtk::common::Managersm_managers
 

Detailed Description

Create an ontology node that tags the associated objects as individual instances of a class.

Member Function Documentation

◆ findOrCreateTag()

smtk::markup::OntologyIdentifier::Ptr smtk::markup::TagIndividual::findOrCreateTag ( smtk::markup::Resource resource,
const std::string &  nodeName,
const std::string &  ontologyName,
const std::string &  nodeURL,
const smtk::attribute::ComponentItem::Ptr &  created,
const smtk::attribute::ComponentItem::Ptr &  modified,
bool &  createdIdentifier 
)
protected

Find or create an OntologyIdentifier with the given nodeName, ontologyName, and nodeURL.

This may also create an Ontology node. If it does, it will be added to created, as will the identifier (if created rather than found).

◆ tagNodes()

std::size_t smtk::markup::TagIndividual::tagNodes ( const smtk::markup::OntologyIdentifier::Ptr &  tag,
const smtk::attribute::ReferenceItem::Ptr &  assocs,
const smtk::attribute::ComponentItem::Ptr &  modified 
)
protected

For each object in assocs, connect it to tag and append it to the modified values.

This returns the number of entries in assocs that were tagged.

◆ untagNodes()

std::size_t smtk::markup::TagIndividual::untagNodes ( const smtk::markup::OntologyIdentifier::Ptr &  tag,
const smtk::attribute::ReferenceItem::Ptr &  assocs,
const smtk::attribute::ComponentItem::Ptr &  modified,
const smtk::attribute::ComponentItem::Ptr &  expunged 
)
protected

For each object in assocs, disconnect it from tag and append it to the modified nodes.

If tag is unused after this, remove it from the resource (via a Delete operation) and add the tag to the expunged item.

This returns the number of entries in assocs that were untagged.


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