lsst.afw gba399f52f3+9b61cfce8e
Loading...
Searching...
No Matches
lsst::afw::typehandling Namespace Reference

Namespaces

namespace  _GenericMap
namespace  _SimpleGenericMap
namespace  detail
namespace  test
namespace  testUtils

Classes

class  GenericMap
 Interface for a heterogeneous map. More...
class  Key
 Key for type-safe lookup in a GenericMap. More...
class  MutableGenericMap
 Interface for a GenericMap that allows element addition and removal. More...
class  PolymorphicValue
 Container that passes Storable objects by value while preserving type. More...
class  SimpleGenericMap
 A GenericMap that allows insertion and deletion of arbitrary values. More...
class  StorableHelper
 "Trampoline" for Storable to let it be used as a base class in Python. More...

Functions

template<typename V, typename K>
constexpr Key< K, V > makeKey (K const &id)
 Factory function for Key, to enable type parameter inference.
template<typename K, typename V>
std::ostream & operator<< (std::ostream &os, Key< K, V > const &key)
 Output operator for Key.
void swap (PolymorphicValue &lhs, PolymorphicValue &rhs) noexcept
 Swap specialization for PolymorphicValue.
std::string declareGenericMapRestrictions (std::string const &className, std::string const &keyName)
LSST_EXCEPTION_TYPE(UnsupportedOperationException, pex::exceptions::RuntimeError, lsst::afw::typehandling::UnsupportedOperationException) class Storable std::ostream & operator<< (std::ostream &os, Storable const &storable)
 Exception thrown by Storable operations for unimplemented operations.
template<typename V, typename K>
constexpr Key< K, V > makeKey (K const &id)
 Factory function for Key, to enable type parameter inference.
template<typename K, typename V>
std::ostream & operator<< (std::ostream &os, Key< K, V > const &key)
 Output operator for Key.
void swap (PolymorphicValue &lhs, PolymorphicValue &rhs) noexcept
 Swap specialization for PolymorphicValue.

Function Documentation

◆ declareGenericMapRestrictions()

std::string lsst::afw::typehandling::declareGenericMapRestrictions ( std::string const & className,
std::string const & keyName )

Definition at line 37 of file python.cc.

◆ makeKey() [1/2]

template<typename V, typename K>
Key< K, V > makeKey ( K const & id)
related

Factory function for Key, to enable type parameter inference.

Parameters
idthe key ID to create.
Returns
a key of the desired type
Exception Safety
Provides the same exception safety as the copy-constructor of K.

Calling this function prevents you from having to explicitly name the key type:

auto key = makeKey<int>("foo");

Definition at line 173 of file Key.h.

◆ operator<<() [1/3]

template<typename K, typename V>
std::ostream & operator<< ( std::ostream & os,
Key< K, V > const & key )
related

Output operator for Key.

The output will use C++ template notation for the key; for example, a key "foo" pointing to an int may print as "foo<int>".

Parameters
osthe desired output stream
keythe key to print
Returns
a reference to os
Exception Safety
Provides basic exception safety if the output operator of K is exception-safe.
Warning
the type name is compiler-specific and may be mangled or unintuitive; for example, some compilers say "i" instead of "int"

Definition at line 196 of file Key.h.

◆ operator<<() [2/3]

LSST_EXCEPTION_TYPE(UnsupportedOperationException, pex::exceptions::RuntimeError, lsst::afw::typehandling::UnsupportedOperationException) class Storable std::ostream & lsst::afw::typehandling::operator<< ( std::ostream & os,
Storable const & storable )
inline

Exception thrown by Storable operations for unimplemented operations.

As with all RuntimeError, callers should assume that this exception may be thrown at any time. Interface supporting iteration over heterogenous containers.

Storable may be subclassed by either C++ or Python classes. Many operations defined by Storable are optional, and may throw UnsupportedOperationException if they are not defined.

Note
Any C++ subclass X of Storable that supports Python subclasses must have a pybind11 wrapper that uses StorableHelper<X> (or a subclass) and lsst::cpputils::python::PySharedPtr. Output operator for Storable.
Parameters
osthe desired output stream
storablethe object to print
Returns
a reference to os
Exceptions
UnsupportedOperationExceptionThrown if storable does not have an implementation of Storable::toString.

Definition at line 174 of file Storable.h.

◆ swap() [1/2]

void swap ( PolymorphicValue & lhs,
PolymorphicValue & rhs )
inlinenoexcept

Swap specialization for PolymorphicValue.

Definition at line 152 of file PolymorphicValue.h.