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

A container for arcs held by a resource. More...

#include <ArcMap.h>

Inheritance diagram for smtk::graph::ArcMap:
[legend]
Collaboration diagram for smtk::graph::ArcMap:
[legend]

Public Types

using key_type = smtk::common::UUID
 
- Public Types inherited from smtk::common::TypeContainer
using KeyType = smtk::string::Hash
 

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:
 
ArcMapoperator= (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 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)
 
const std::set< smtk::string::Token > & types () const
 Return the type-names of the arc types accepted by this ArcMap instance.
 
- Public Member Functions inherited from smtk::common::TypeContainer
 TypeContainer ()=default
 Construct an empty TypeContainer.
 
 TypeContainer (const TypeContainer &)
 Construct a TypeContainer whose contents are copied from an existing TypeContainer.
 
 TypeContainer (TypeContainer &&)=default
 Move the contents of one TypeContainer into a new TypeContainer.
 
TypeContaineroperator= (const TypeContainer &)
 Copy the contents of an existing TypeContainer into this one.
 
TypeContaineroperator= (TypeContainer &&)=default
 Move the contents of an existing TypeContainer into this one.
 
template<typename Arg , typename... Args, typename std::enable_if<!std::is_base_of< TypeContainer, Arg >::value, int >::type = 0>
 TypeContainer (const Arg &arg, const Args &... args)
 Construct a TypeContainer instance from any number of elements. More...
 
template<typename Type >
KeyType keyId () const
 Return the ID used to index a given Type.
 
template<typename Type >
bool contains () const
 Check if a Type is present in the TypeContainer.
 
template<typename Type >
bool insert (const Type &value)
 Insert a Type instance into the TypeContainer. More...
 
template<typename Type >
bool insert_or_assign (const Type &value)
 Insert a Type instance into the TypeContainer if it does not exist already or replace it if it does.
 
template<typename Type , typename... Args>
bool emplace (Args &&... args)
 Emplace a Type instance into the TypeContainer.
 
template<typename Type >
const Type & get () const
 Access a Type instance, and throw if it is not in the TypeContainer.
 
template<typename Type >
std::enable_if< std::is_default_constructible< Type >::value, Type & >::type get () noexcept
 For default-constructible types, access a Type instance, creating one if it is not in the TypeContainer.
 
template<typename Type >
std::enable_if<!std::is_default_constructible< Type >::value, Type & >::type get ()
 For non-default-constructible types, access a Type instance; throw if it is not in the TypeContainer.
 
template<typename Type >
bool erase ()
 Remove a specific type of object from the container.
 
bool empty () const noexcept
 Return true if the container holds no objects and false otherwise.
 
std::size_t size () const noexcept
 Return the nubmer of objects held by the container.
 
void clear () noexcept
 Erase all objects held by the container.
 
std::set< smtk::string::Tokenkeys () const
 Return a set of keys corresponding to the values in the container. More...
 

Protected Member Functions

template<typename Type >
void insertArcImplementation ()
 
template<typename Entry , typename Functor , typename... Args>
void invokeFunctor (Args &&... args) const
 
template<typename Entry , typename Functor , typename... Args>
void invokeFunctor (Args &&... args)
 
template<typename Tuple >
void insertArcImplementations ()
 

Detailed Description

A container for arcs held by a resource.

This class extends TypeContainer in two ways:

Member Function Documentation

◆ at()

template<typename ArcTraits >
const ArcImplementation<ArcTraits>* smtk::graph::ArcMap::at ( ) const
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.

◆ invoke()

template<typename Tuple , typename Functor , typename... Args>
void smtk::graph::ArcMap::invoke ( Args &&...  args) const
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.


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