class RepeatedScalarFieldProxy

Overview

Proxy class implementing a list-like python wrapper for a protobuf repeated scalar field (ie. not of Message type) More…

#include <repeated_field_proxy.h>

class RepeatedScalarFieldProxy {
public:
    // construction

    RepeatedScalarFieldProxy(gpb::Message& msg, const gpb::FieldDescriptor* field);

    // methods

    static void create();
    int Len();
    bpy::object GetItem(PyObject* indices);
    void SetItem(PyObject* indices, PyObject* value);
    bpy::object Iter();
    void Append(const bpy::object& value);
    void Extend(const bpy::object& value);
    void Clear();
    void Pop();
};

Detailed Documentation

Proxy class implementing a list-like python wrapper for a protobuf repeated scalar field (ie. not of Message type)

Construction

RepeatedScalarFieldProxy(gpb::Message& msg, const gpb::FieldDescriptor* field)

Constructor.

Parameters:

msg

Message storing the wrapped field

field

Field descriptor

Methods

static void create()

Creates the python wrapper.

The python wrapper supports the usual python “list” index get/set operations and iteration. It does not support the next list methods: ‘ delitem ‘, ‘copy’, ‘count’, ‘index’, ‘insert’, ‘remove’, ‘reverse’, ‘sort’. It does not support comparison with a list.

int Len()

/brief len

bpy::object GetItem(PyObject* indices)

/brief getitem

void SetItem(PyObject* indices, PyObject* value)

/brief setitem

bpy::object Iter()

/brief iter

void Append(const bpy::object& value)

/brief append

void Extend(const bpy::object& value)

/brief extend

void Clear()

/brief clear

void Pop()

/brief pop