SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A container for arcs held by a resource. More...
#include <ArcMap.h>
Public Types | |
using | key_type = smtk::common::UUID |
Public Member Functions | |
smtkTypeMacroBase (smtk::graph::ArcMap) | |
smtkSuperclassMacro (smtk::common::TypeMap< smtk::common::UUID >) | |
template<typename List > | |
ArcMap (identity< List >) | |
ArcMap (const ArcMap &)=delete | |
Do not allow the map to be copied: | |
ArcMap & | operator= (const ArcMap &)=delete |
template<typename ArcTraits > | |
const ArcImplementation< ArcTraits > * | at () const |
Return the arc's implementation object given its trait type. More... | |
template<typename ArcTraits > | |
ArcImplementation< ArcTraits > * | at () |
template<typename ImplementationType > | |
const ImplementationType * | at (smtk::string::Token declaredType) const |
template<typename ImplementationType > | |
ImplementationType * | at (smtk::string::Token declaredType) |
template<typename Tuple , typename Functor , typename... Args> | |
void | invoke (Args &&... args) const |
Invoke a Functor (which accepts args) on each arc type in the Tuple. More... | |
template<typename Tuple , typename Functor , typename... Args> | |
void | invoke (Args &&... args) |
template<typename Functor , typename... Args> | |
void | invokeRuntime (Args &&... args) const |
Invoke a Functor (which accepts args) on each run-time arc type in the Tuple. More... | |
template<typename Functor , typename... Args> | |
void | invokeRuntime (Args &&... args) |
const std::set< smtk::string::Token > & | types () const |
Return the type-names of the arc types accepted by this ArcMap instance. | |
bool | insertRuntimeArcType (smtk::graph::ResourceBase *resource, smtk::string::Token arcType, std::unordered_set< smtk::string::Token > fromNodeSpecs, std::unordered_set< smtk::string::Token > toNodeSpecs, Directionality isDirected) |
Insert a run-time arc type. More... | |
std::unordered_set< smtk::string::Token > | runtimeBaseTypes () const |
Return the set of object-types that hold run-time arcs. More... | |
const std::unordered_set< smtk::string::Token > & | runtimeTypeNames (smtk::string::Token baseType) const |
Return the set of run-time arcs given a base object-type. More... | |
template<typename ArcImplementationType > | |
const ArcImplementationType & | getRuntime (smtk::string::Token arcType) const |
Return a reference to an arc-type's storage. | |
template<typename ArcImplementationType > | |
ArcImplementationType & | getRuntime (smtk::string::Token arcType) |
virtual void | copyArcs (const smtk::graph::ResourceBase *source, smtk::resource::CopyOptions &options, smtk::graph::ResourceBase *target) |
Copy arcs from a source resource's arcs. More... | |
A container for arcs held by a resource.
This class extends RuntimeTypeContainer in two ways:
|
inline |
Return the arc's implementation object given its trait type.
This will return null when the arc map does not hold arcs of the given trait-type.
|
virtual |
Copy arcs from a source resource's arcs.
This method is only intended for use from within graph-resource overrides of smtk::resource::Resource::copyRelations(), where the source is a resource sharing the same set of compile-time traits.
This method copies run-time arc types and then copies arcs themselves, translating endpoint component UUIDs via the options provided.
Only explicit arcs are copied.
bool smtk::graph::ArcMap::insertRuntimeArcType | ( | smtk::graph::ResourceBase * | resource, |
smtk::string::Token | arcType, | ||
std::unordered_set< smtk::string::Token > | fromNodeSpecs, | ||
std::unordered_set< smtk::string::Token > | toNodeSpecs, | ||
Directionality | isDirected | ||
) |
Insert a run-time arc type.
The arcType will be used as a "declared typename". If directed is true, arcs will be directed.
The fromNodeSpecs and toNodeSpecs are sets of query-filters that specify components within the resource which may serve as the arc's endpoints. Note that if directed is false, then the union of both node specs is used but a warning will be emitted if they are not identical.
This method will return false if your graph-resource's type traits object does not include the RuntimeArc in its ArcTypes tuple.
This method requires a resource in order to call queryOperation() on the endpoint type-specifiers. (Note that each graph resource's traits object may have a different set of node and arc types which affect the grammar of type-specifier strings.)
|
inline |
Invoke a Functor (which accepts args) on each arc type in the Tuple.
For each arc type, the functor is passed the input arguments (which it may modify). Note that the object passed to each functor will be an ArcImplementation<ArcTraits>, where each ArcTraits is drawn from the Tuple.
|
inline |
Invoke a Functor (which accepts args) on each run-time arc type in the Tuple.
For each RuntimeArc instance, the functor is passed the input arguments (which it may modify). Note that the object passed to each functor will be an ArcImplementationBase (a pure virtual base class for ArcImplementation<T>). This is less efficient than the compile-time arc support, but is more flexible.
std::unordered_set< smtk::string::Token > smtk::graph::ArcMap::runtimeBaseTypes | ( | ) | const |
Return the set of object-types that hold run-time arcs.
Each object-type may have multiple corresponding run-time arcs.
const std::unordered_set< smtk::string::Token > & smtk::graph::ArcMap::runtimeTypeNames | ( | smtk::string::Token | baseType | ) | const |
Return the set of run-time arcs given a base object-type.