NRP Core  1.4.1
proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES > Class Template Reference

Class implementing python wrappers for protobuf Message types. More...

#include <proto_python_bindings.h>

Public Member Functions

 proto_python_bindings ()
 

Static Public Member Functions

static void throw_python_error (PyObject *error, std::string msg)
 
static bpy::object GetAttribute (MSG_TYPE &m, char const *name)
 getattr More...
 
static void SetAttribute (MSG_TYPE &m, char const *name, const bpy::object &value)
 setattr More...
 
static bpy::object WhichOneof (MSG_TYPE &m, char const *name)
 WhichOneof. More...
 
static void ClearField (MSG_TYPE &m, char const *name)
 ClearField. More...
 
static bool HasField (MSG_TYPE &m, char const *name)
 HasField. More...
 
static bpy::list GetFieldNames (MSG_TYPE &m)
 GetFieldNames. More...
 
static bpy::str GetFieldTypeName (MSG_TYPE &m, char const *name)
 GetFieldTypeName. More...
 
static bpy::class_< MSG_TYPE > create ()
 Creates bindings for Protobuf Message type MSG_TYPE. More...
 

Detailed Description

template<class MSG_TYPE, class ... FIELD_MSG_TYPES>
class proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >

Class implementing python wrappers for protobuf Message types.

The main access point is "create", which effectively creates bindings for a MSG_TYPE class. The generated Python class resembles the original Protobuf Python API as described here:

with the next limitations:

Constructor & Destructor Documentation

◆ proto_python_bindings()

template<class MSG_TYPE , class ... FIELD_MSG_TYPES>
proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >::proto_python_bindings ( )
inline

Member Function Documentation

◆ ClearField()

template<class MSG_TYPE , class ... FIELD_MSG_TYPES>
static void proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >::ClearField ( MSG_TYPE &  m,
char const *  name 
)
inlinestatic

ClearField.

◆ create()

template<class MSG_TYPE , class ... FIELD_MSG_TYPES>
static bpy::class_<MSG_TYPE> proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >::create ( )
inlinestatic

Creates bindings for Protobuf Message type MSG_TYPE.

◆ GetAttribute()

template<class MSG_TYPE , class ... FIELD_MSG_TYPES>
static bpy::object proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >::GetAttribute ( MSG_TYPE &  m,
char const *  name 
)
inlinestatic

getattr

◆ GetFieldNames()

template<class MSG_TYPE , class ... FIELD_MSG_TYPES>
static bpy::list proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >::GetFieldNames ( MSG_TYPE &  m)
inlinestatic

GetFieldNames.

◆ GetFieldTypeName()

template<class MSG_TYPE , class ... FIELD_MSG_TYPES>
static bpy::str proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >::GetFieldTypeName ( MSG_TYPE &  m,
char const *  name 
)
inlinestatic

GetFieldTypeName.

◆ HasField()

template<class MSG_TYPE , class ... FIELD_MSG_TYPES>
static bool proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >::HasField ( MSG_TYPE &  m,
char const *  name 
)
inlinestatic

HasField.

◆ SetAttribute()

template<class MSG_TYPE , class ... FIELD_MSG_TYPES>
static void proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >::SetAttribute ( MSG_TYPE &  m,
char const *  name,
const bpy::object &  value 
)
inlinestatic

setattr

◆ throw_python_error()

template<class MSG_TYPE , class ... FIELD_MSG_TYPES>
static void proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >::throw_python_error ( PyObject *  error,
std::string  msg 
)
inlinestatic

◆ WhichOneof()

template<class MSG_TYPE , class ... FIELD_MSG_TYPES>
static bpy::object proto_python_bindings< MSG_TYPE, FIELD_MSG_TYPES >::WhichOneof ( MSG_TYPE &  m,
char const *  name 
)
inlinestatic

WhichOneof.


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