LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Public Member Functions | List of all members
lsst::afw::typehandling::StorableHelper< Base > Class Template Reference

"Trampoline" for Storable to let it be used as a base class in Python. More...

#include <python.h>

Inheritance diagram for lsst::afw::typehandling::StorableHelper< Base >:

Public Member Functions

std::shared_ptr< StorablecloneStorable () const override
 
std::string toString () const override
 
std::size_t hash_value () const override
 
bool equals (Storable const &other) const noexcept override
 

Detailed Description

template<class Base = Storable>
class lsst::afw::typehandling::StorableHelper< Base >

"Trampoline" for Storable to let it be used as a base class in Python.

Subclasses of Storable that are wrapped in pybind11 should have a similar helper that subclasses StorableHelper<subclass>. This helper can be skipped if the subclass neither adds any virtual methods nor implements any abstract methods.

Template Parameters
Basethe exact (most specific) class being wrapped
See also
pybind11 documentation

Definition at line 50 of file python.h.

Member Function Documentation

◆ cloneStorable()

template<class Base = Storable>
std::shared_ptr<Storable> lsst::afw::typehandling::StorableHelper< Base >::cloneStorable ( ) const
inlineoverride

Definition at line 54 of file python.h.

54  {
55  /* __deepcopy__ takes an optional dict, but PYBIND11_OVERLOAD_* won't
56  * compile unless you give it arguments that work for the C++ method
57  */
58  PYBIND11_OVERLOAD_NAME(std::shared_ptr<Storable>, Base, "__deepcopy__", cloneStorable, );
59  }
std::shared_ptr< Storable > cloneStorable() const override
Definition: python.h:54

◆ equals()

template<class Base = Storable>
bool lsst::afw::typehandling::StorableHelper< Base >::equals ( Storable const &  other) const
inlineoverridenoexcept

Definition at line 69 of file python.h.

69  {
70  PYBIND11_OVERLOAD_NAME(bool, Base, "__eq__", equals, other);
71  }
bool equals(Storable const &other) const noexcept override
Definition: python.h:69
ItemVariant const * other
Definition: Schema.cc:56

◆ hash_value()

template<class Base = Storable>
std::size_t lsst::afw::typehandling::StorableHelper< Base >::hash_value ( ) const
inlineoverride

Definition at line 65 of file python.h.

65  {
66  PYBIND11_OVERLOAD_NAME(std::size_t, Base, "__hash__", hash_value, );
67  }
std::size_t hash_value() const override
Definition: python.h:65

◆ toString()

template<class Base = Storable>
std::string lsst::afw::typehandling::StorableHelper< Base >::toString ( ) const
inlineoverride

Definition at line 61 of file python.h.

61  {
62  PYBIND11_OVERLOAD_NAME(std::string, Base, "__repr__", toString, );
63  }
STL class.
std::string toString() const override
Definition: python.h:61

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