cppyabm  1.0.17
An agent-based library to integrate C++ and Python
Public Types | Public Member Functions | Static Public Member Functions | List of all members
duration_caster< type > Class Template Reference

#include <chrono.h>

Public Types

using rep = typename type::rep
 
using period = typename type::period
 
using days = std::chrono::duration< uint_fast32_t, std::ratio< 86400 > >
 

Public Member Functions

bool load (handle src, bool)
 
 PYBIND11_TYPE_CASTER (type, _("datetime.timedelta"))
 

Static Public Member Functions

static const std::chrono::duration< rep, period > & get_duration (const std::chrono::duration< rep, period > &src)
 
template<typename Clock >
static std::chrono::duration< rep, periodget_duration (const std::chrono::time_point< Clock, std::chrono::duration< rep, period >> &src)
 
static handle cast (const type &src, return_value_policy, handle)
 

Detailed Description

template<typename type>
class duration_caster< type >

Definition at line 33 of file chrono.h.

Member Typedef Documentation

◆ days

template<typename type >
using duration_caster< type >::days = std::chrono::duration<uint_fast32_t, std::ratio<86400> >

Definition at line 38 of file chrono.h.

◆ period

template<typename type >
using duration_caster< type >::period = typename type::period

Definition at line 36 of file chrono.h.

◆ rep

template<typename type >
using duration_caster< type >::rep = typename type::rep

Definition at line 35 of file chrono.h.

Member Function Documentation

◆ cast()

template<typename type >
static handle duration_caster< type >::cast ( const type src,
return_value_policy  ,
handle   
)
inlinestatic

Definition at line 73 of file chrono.h.

◆ get_duration() [1/2]

template<typename type >
static const std::chrono::duration<rep, period>& duration_caster< type >::get_duration ( const std::chrono::duration< rep, period > &  src)
inlinestatic

Definition at line 64 of file chrono.h.

◆ get_duration() [2/2]

template<typename type >
template<typename Clock >
static std::chrono::duration<rep, period> duration_caster< type >::get_duration ( const std::chrono::time_point< Clock, std::chrono::duration< rep, period >> &  src)
inlinestatic

Definition at line 69 of file chrono.h.

◆ load()

template<typename type >
bool duration_caster< type >::load ( handle  src,
bool   
)
inline

Definition at line 40 of file chrono.h.

◆ PYBIND11_TYPE_CASTER()

template<typename type >
duration_caster< type >::PYBIND11_TYPE_CASTER ( type  ,
_("datetime.timedelta")   
)

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