HepMC3 event record library
Public Member Functions | Data Fields | Private Member Functions
arg_v Struct Reference

#include <cast.h>

+ Inheritance diagram for arg_v:
+ Collaboration diagram for arg_v:

Public Member Functions

template<typename T >
 arg_v (const char *name, T &&x, const char *descr=nullptr)
 Direct construction with name, default, and description. More...
 
template<typename T >
 arg_v (const arg &base, T &&x, const char *descr=nullptr)
 Called internally when invoking py::arg("a") = value More...
 
arg_vnoconvert (bool flag=true)
 Same as arg::noconvert(), but returns *this as arg_v&, not arg&. More...
 
arg_vnone (bool flag=true)
 Same as arg::nonone(), but returns *this as arg_v&, not arg&. More...
 

Data Fields

object value
 The default value. More...
 
const char * descr
 The (optional) description of the default value. More...
 
std::string type
 The C++ type name of the default value (only available when compiled in debug mode) More...
 
const char * name
 If non-null, this is a named kwargs argument. More...
 
bool flag_noconvert: 1
 If set, do not allow conversion (requires a supporting type caster!) More...
 
bool flag_none: 1
 If set (the default), allow None to be passed to this argument. More...
 

Private Member Functions

template<typename T >
 arg_v (arg &&base, T &&x, const char *descr=nullptr)
 

Detailed Description

Annotation for arguments with values

Definition at line 1861 of file cast.h.

Constructor & Destructor Documentation

◆ arg_v() [1/2]

arg_v ( const char *  name,
T &&  x,
const char *  descr = nullptr 
)
inline

Direct construction with name, default, and description.

Definition at line 1878 of file cast.h.

◆ arg_v() [2/2]

arg_v ( const arg base,
T &&  x,
const char *  descr = nullptr 
)
inline

Called internally when invoking py::arg("a") = value

Definition at line 1883 of file cast.h.

Member Function Documentation

◆ noconvert()

arg_v& noconvert ( bool  flag = true)
inline

Same as arg::noconvert(), but returns *this as arg_v&, not arg&.

Definition at line 1887 of file cast.h.

References arg::noconvert().

◆ none()

arg_v& none ( bool  flag = true)
inline

Same as arg::nonone(), but returns *this as arg_v&, not arg&.

Definition at line 1890 of file cast.h.

References arg::none().

Field Documentation

◆ descr

const char* descr

The (optional) description of the default value.

Definition at line 1895 of file cast.h.

◆ flag_noconvert

bool flag_noconvert
inherited

If set, do not allow conversion (requires a supporting type caster!)

Definition at line 1855 of file cast.h.

◆ flag_none

bool flag_none
inherited

If set (the default), allow None to be passed to this argument.

Definition at line 1856 of file cast.h.

◆ name

const char* name
inherited

If non-null, this is a named kwargs argument.

Definition at line 1854 of file cast.h.

◆ type

std::string type

The C++ type name of the default value (only available when compiled in debug mode)

Definition at line 1898 of file cast.h.

◆ value

object value

The default value.

Definition at line 1893 of file cast.h.


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