Unions and enums working.
This commit is contained in:
@@ -31,11 +31,25 @@ cdef extern from "capnp/message.h" namespace "::capnp":
|
|||||||
uint size()
|
uint size()
|
||||||
|
|
||||||
cdef extern from "schema.capnp.h" namespace "::capnp::schema":
|
cdef extern from "schema.capnp.h" namespace "::capnp::schema":
|
||||||
|
{%- for node_dict in enum_types %}
|
||||||
|
enum {{node_name|capitalize}}:
|
||||||
|
{%- for member_name, member_dict in node_dict['members'].items() %}
|
||||||
|
{{node_dict['full_name_cython']}}_{{member_name}} "::capnp::schema::{{node_dict['full_name']}}::{{member_name|upper_and_under}}"
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- for node_dict in union_types %}
|
||||||
|
enum {{node_dict['full_name_cython']}}_Which:
|
||||||
|
{%- for member_name, member_dict in node_dict['members'].items() %}
|
||||||
|
{{node_dict['full_name_cython']}}_{{member_name}} "::capnp::schema::{{node_dict['full_name']|replace('.', '::')}}::Which::{{member_name|upper_and_under}}"
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endfor %}
|
||||||
{%- for node_name, node_dict in nodes.items() %}
|
{%- for node_name, node_dict in nodes.items() %}
|
||||||
cdef cppclass {{node_name|capitalize}}
|
{% if node_dict['body'] != 'enum' %}cdef cppclass {{node_name|capitalize}}{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
{%- for node_name, node_dict in nodes.items() recursive %}
|
{%- for node_name, node_dict in nodes.items() recursive %}
|
||||||
|
|
||||||
|
{%- if node_dict['body'] != 'enum' %}
|
||||||
{{ 'cdef ' if loop.depth == 1 }}cppclass {{node_name|capitalize}}:
|
{{ 'cdef ' if loop.depth == 1 }}cppclass {{node_name|capitalize}}:
|
||||||
|
|
||||||
{%- for node_name, node_dict in node_dict['nestedNodes'].items() %}
|
{%- for node_name, node_dict in node_dict['nestedNodes'].items() %}
|
||||||
@@ -44,10 +58,12 @@ cdef extern from "schema.capnp.h" namespace "::capnp::schema":
|
|||||||
|
|
||||||
{{ loop(node_dict['nestedNodes'].items()) | indent }}
|
{{ loop(node_dict['nestedNodes'].items()) | indent }}
|
||||||
cppclass Reader:
|
cppclass Reader:
|
||||||
|
{{'int which()' if node_dict['body'] == 'union'}}
|
||||||
{%- for member_name, member_dict in node_dict['members'].items() %}
|
{%- for member_name, member_dict in node_dict['members'].items() %}
|
||||||
{{member_dict['type']}}{{'.Reader' if member_dict.get('type', '').startswith('List') }} get{{member_name|capitalize}}()
|
{{member_dict['type']}}{{'.Reader' if member_dict.get('type', '').startswith('List') }} get{{member_name|capitalize}}()
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
cppclass Builder:
|
cppclass Builder:
|
||||||
|
{{'int which()' if node_dict['body'] == 'union'}}
|
||||||
{%- for member_name, member_dict in node_dict['members'].items() %}
|
{%- for member_name, member_dict in node_dict['members'].items() %}
|
||||||
{{member_dict['type']}}{{'.Builder' if member_dict.get('type', '').startswith('List') }} get{{member_name|capitalize}}()
|
{{member_dict['type']}}{{'.Builder' if member_dict.get('type', '').startswith('List') }} get{{member_name|capitalize}}()
|
||||||
{%- if member_dict.get('type', '').startswith('List') %}
|
{%- if member_dict.get('type', '').startswith('List') %}
|
||||||
@@ -56,6 +72,7 @@ cdef extern from "schema.capnp.h" namespace "::capnp::schema":
|
|||||||
{{' ' if not member_dict['type']}}void set{{member_name|capitalize}}({{member_dict['type']}})
|
{{' ' if not member_dict['type']}}void set{{member_name|capitalize}}({{member_dict['type']}})
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
cdef extern from "capnp/message.h" namespace "::capnp":
|
cdef extern from "capnp/message.h" namespace "::capnp":
|
||||||
@@ -65,13 +82,17 @@ cdef extern from "capnp/message.h" namespace "::capnp":
|
|||||||
|
|
||||||
cdef cppclass MessageBuilder:
|
cdef cppclass MessageBuilder:
|
||||||
{%- for name, values in nodes.items() %}
|
{%- for name, values in nodes.items() %}
|
||||||
|
{%- if values['body'] != 'enum' %}
|
||||||
{{name}}.Builder getRoot{{name}}'getRoot<{{namespace}}::{{name}}>'()
|
{{name}}.Builder getRoot{{name}}'getRoot<{{namespace}}::{{name}}>'()
|
||||||
{{name}}.Builder initRoot{{name}}'initRoot<{{namespace}}::{{name}}>'()
|
{{name}}.Builder initRoot{{name}}'initRoot<{{namespace}}::{{name}}>'()
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
cdef cppclass MessageReader:
|
cdef cppclass MessageReader:
|
||||||
{%- for name, values in nodes.items() %}
|
{%- for name, values in nodes.items() %}
|
||||||
|
{%- if values['body'] != 'enum' %}
|
||||||
{{name}}.Reader getRoot{{name}}'getRoot<{{namespace}}::{{name}}>'()
|
{{name}}.Reader getRoot{{name}}'getRoot<{{namespace}}::{{name}}>'()
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
cdef cppclass MallocMessageBuilder(MessageBuilder):
|
cdef cppclass MallocMessageBuilder(MessageBuilder):
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
# distutils: libraries = capnp
|
# distutils: libraries = capnp
|
||||||
|
|
||||||
cimport capnp_schema as capnp
|
cimport capnp_schema as capnp
|
||||||
from capnp_schema cimport {% for node_name, node_dict in nodes.items() %}{{node_name|capitalize}} as C_{{node_name|capitalize}}{{',' if not loop.last}}{% endfor %}
|
from capnp_schema cimport {% for node_name, node_dict in nodes.items() %}{% if node_dict['body'] != 'enum' %}{{node_name|capitalize}} as C_{{node_name|capitalize}}{{',' if not loop.last}}{%- endif %}{% endfor %}
|
||||||
|
from capnp_schema cimport {% for node_dict in enum_types %}{%- for member_name, member_dict in node_dict['members'].items() %}{{node_dict['full_name_cython']}}_{{member_name}}{{',' if not loop.last}}{%- endfor %}{{',' if not loop.last}}{%- endfor %}
|
||||||
|
from capnp_schema cimport {% for node_dict in union_types %}{%- for member_name, member_dict in node_dict['members'].items() %}{{node_dict['full_name_cython']}}_{{member_name}}{{',' if not loop.last}}{%- endfor %}{{',' if not loop.last}}{% endfor %}
|
||||||
|
|
||||||
# from capnp_schema cimport *
|
# from capnp_schema cimport *
|
||||||
# Not doing this since we want to namespace away the class names
|
# Not doing this since we want to namespace away the class names
|
||||||
@@ -50,7 +52,7 @@ cdef class _{{ list_name |replace('[', '_')|replace(']','_')|replace('.','_')}}R
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
{%- if list_dict['elem_type'] in built_in_types %}
|
{%- if list_dict['elem_type'] in built_in_types %}
|
||||||
@@ -68,7 +70,7 @@ cdef class _{{ list_name |replace('[', '_')|replace(']','_')|replace('.','_')}}B
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
{%- if list_dict['elem_type'] in built_in_types %}
|
{%- if list_dict['elem_type'] in built_in_types %}
|
||||||
@@ -83,11 +85,18 @@ cdef class _{{ list_name |replace('[', '_')|replace(']','_')|replace('.','_')}}B
|
|||||||
{{ loop(node_dict['nestedNodes'].items()) }}
|
{{ loop(node_dict['nestedNodes'].items()) }}
|
||||||
|
|
||||||
{%- if node_dict['body'] != 'enum' %}
|
{%- if node_dict['body'] != 'enum' %}
|
||||||
|
{%- if node_dict['body'] == 'union' %}
|
||||||
|
{{ node_dict['full_name_cython'] }}_Which = make_enum('{{ node_dict['full_name_cython'] }}_Which', {%- for member_name, member_dict in node_dict['members'].items() %}{{member_name}} = <int>{{node_dict['full_name_cython']}}_{{member_name}},{%- endfor %})
|
||||||
|
{%- endif %}
|
||||||
cdef class {{ node_dict['full_name_cython'] }}Reader:
|
cdef class {{ node_dict['full_name_cython'] }}Reader:
|
||||||
cdef C_{{ node_dict['full_name'] }}.Reader thisptr
|
cdef C_{{ node_dict['full_name'] }}.Reader thisptr
|
||||||
cdef init(self, C_{{ node_dict['full_name'] }}.Reader other):
|
cdef init(self, C_{{ node_dict['full_name'] }}.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
{% if node_dict['body'] == 'union' %}
|
||||||
|
cpdef int which(self):
|
||||||
|
return self.thisptr.which()
|
||||||
|
{%- endif %}
|
||||||
{%- for member_name, member_dict in node_dict['members'].items() %}
|
{%- for member_name, member_dict in node_dict['members'].items() %}
|
||||||
property {{member_name}}:
|
property {{member_name}}:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
@@ -107,6 +116,10 @@ cdef class {{ node_dict['full_name_cython'] }}Builder:
|
|||||||
cdef init(self, C_{{ node_dict['full_name'] }}.Builder other):
|
cdef init(self, C_{{ node_dict['full_name'] }}.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
{% if node_dict['body'] == 'union' %}
|
||||||
|
cpdef int which(self):
|
||||||
|
return self.thisptr.which()
|
||||||
|
{%- endif %}
|
||||||
{%- for member_name, member_dict in node_dict['members'].items() %}
|
{%- for member_name, member_dict in node_dict['members'].items() %}
|
||||||
property {{member_name}}:
|
property {{member_name}}:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
@@ -130,6 +143,8 @@ cdef class {{ node_dict['full_name_cython'] }}Builder:
|
|||||||
pass
|
pass
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
{%- else %}
|
||||||
|
{{ node_dict['full_name_cython'] }} = make_enum('{{ node_dict['full_name_cython'] }}', {%- for member_name, member_dict in node_dict['members'].items() %}{{member_name}} = <int>{{node_dict['full_name_cython']}}_{{member_name}},{%- endfor %})
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
|
|||||||
655
capnp_schema.pxd
Normal file
655
capnp_schema.pxd
Normal file
@@ -0,0 +1,655 @@
|
|||||||
|
# schema.capnp.cpp.pyx
|
||||||
|
# distutils: language = c++
|
||||||
|
# distutils: extra_compile_args = --std=c++11
|
||||||
|
# distutils: libraries = capnp
|
||||||
|
|
||||||
|
from libc.stdint cimport *
|
||||||
|
ctypedef unsigned int uint
|
||||||
|
ctypedef uint8_t UInt8
|
||||||
|
ctypedef uint16_t UInt16
|
||||||
|
ctypedef uint32_t UInt32
|
||||||
|
ctypedef uint64_t UInt64
|
||||||
|
ctypedef int8_t Int8
|
||||||
|
ctypedef int16_t Int16
|
||||||
|
ctypedef int32_t Int32
|
||||||
|
ctypedef int64_t Int64
|
||||||
|
|
||||||
|
ctypedef char * Data
|
||||||
|
ctypedef char * Object
|
||||||
|
ctypedef char * Text
|
||||||
|
ctypedef bint Bool
|
||||||
|
ctypedef float Float32
|
||||||
|
ctypedef double Float64
|
||||||
|
|
||||||
|
cdef extern from "capnp/message.h" namespace "::capnp":
|
||||||
|
cdef cppclass List[T]:
|
||||||
|
cppclass Reader:
|
||||||
|
T operator[](uint)
|
||||||
|
uint size()
|
||||||
|
cppclass Builder:
|
||||||
|
T operator[](uint)
|
||||||
|
uint size()
|
||||||
|
|
||||||
|
cdef extern from "schema.capnp.h" namespace "::capnp::schema":
|
||||||
|
enum :
|
||||||
|
_ElementSize_inlineComposite "::capnp::schema::ElementSize::INLINE_COMPOSITE"
|
||||||
|
_ElementSize_eightBytes "::capnp::schema::ElementSize::EIGHT_BYTES"
|
||||||
|
_ElementSize_pointer "::capnp::schema::ElementSize::POINTER"
|
||||||
|
_ElementSize_bit "::capnp::schema::ElementSize::BIT"
|
||||||
|
_ElementSize_twoBytes "::capnp::schema::ElementSize::TWO_BYTES"
|
||||||
|
_ElementSize_fourBytes "::capnp::schema::ElementSize::FOUR_BYTES"
|
||||||
|
_ElementSize_byte "::capnp::schema::ElementSize::BYTE"
|
||||||
|
_ElementSize_empty "::capnp::schema::ElementSize::EMPTY"
|
||||||
|
enum _Value_Body_Which:
|
||||||
|
_Value_Body_uint32Value "::capnp::schema::Value::Body::Which::UINT32_VALUE"
|
||||||
|
_Value_Body_float64Value "::capnp::schema::Value::Body::Which::FLOAT64_VALUE"
|
||||||
|
_Value_Body_voidValue "::capnp::schema::Value::Body::Which::VOID_VALUE"
|
||||||
|
_Value_Body_dataValue "::capnp::schema::Value::Body::Which::DATA_VALUE"
|
||||||
|
_Value_Body_listValue "::capnp::schema::Value::Body::Which::LIST_VALUE"
|
||||||
|
_Value_Body_int32Value "::capnp::schema::Value::Body::Which::INT32_VALUE"
|
||||||
|
_Value_Body_enumValue "::capnp::schema::Value::Body::Which::ENUM_VALUE"
|
||||||
|
_Value_Body_int8Value "::capnp::schema::Value::Body::Which::INT8_VALUE"
|
||||||
|
_Value_Body_boolValue "::capnp::schema::Value::Body::Which::BOOL_VALUE"
|
||||||
|
_Value_Body_int16Value "::capnp::schema::Value::Body::Which::INT16_VALUE"
|
||||||
|
_Value_Body_float32Value "::capnp::schema::Value::Body::Which::FLOAT32_VALUE"
|
||||||
|
_Value_Body_interfaceValue "::capnp::schema::Value::Body::Which::INTERFACE_VALUE"
|
||||||
|
_Value_Body_uint16Value "::capnp::schema::Value::Body::Which::UINT16_VALUE"
|
||||||
|
_Value_Body_uint8Value "::capnp::schema::Value::Body::Which::UINT8_VALUE"
|
||||||
|
_Value_Body_int64Value "::capnp::schema::Value::Body::Which::INT64_VALUE"
|
||||||
|
_Value_Body_structValue "::capnp::schema::Value::Body::Which::STRUCT_VALUE"
|
||||||
|
_Value_Body_textValue "::capnp::schema::Value::Body::Which::TEXT_VALUE"
|
||||||
|
_Value_Body_uint64Value "::capnp::schema::Value::Body::Which::UINT64_VALUE"
|
||||||
|
_Value_Body_objectValue "::capnp::schema::Value::Body::Which::OBJECT_VALUE"
|
||||||
|
enum _Type_Body_Which:
|
||||||
|
_Type_Body_boolType "::capnp::schema::Type::Body::Which::BOOL_TYPE"
|
||||||
|
_Type_Body_structType "::capnp::schema::Type::Body::Which::STRUCT_TYPE"
|
||||||
|
_Type_Body_int32Type "::capnp::schema::Type::Body::Which::INT32_TYPE"
|
||||||
|
_Type_Body_voidType "::capnp::schema::Type::Body::Which::VOID_TYPE"
|
||||||
|
_Type_Body_uint16Type "::capnp::schema::Type::Body::Which::UINT16_TYPE"
|
||||||
|
_Type_Body_dataType "::capnp::schema::Type::Body::Which::DATA_TYPE"
|
||||||
|
_Type_Body_objectType "::capnp::schema::Type::Body::Which::OBJECT_TYPE"
|
||||||
|
_Type_Body_int64Type "::capnp::schema::Type::Body::Which::INT64_TYPE"
|
||||||
|
_Type_Body_float64Type "::capnp::schema::Type::Body::Which::FLOAT64_TYPE"
|
||||||
|
_Type_Body_interfaceType "::capnp::schema::Type::Body::Which::INTERFACE_TYPE"
|
||||||
|
_Type_Body_uint32Type "::capnp::schema::Type::Body::Which::UINT32_TYPE"
|
||||||
|
_Type_Body_uint8Type "::capnp::schema::Type::Body::Which::UINT8_TYPE"
|
||||||
|
_Type_Body_listType "::capnp::schema::Type::Body::Which::LIST_TYPE"
|
||||||
|
_Type_Body_int8Type "::capnp::schema::Type::Body::Which::INT8_TYPE"
|
||||||
|
_Type_Body_float32Type "::capnp::schema::Type::Body::Which::FLOAT32_TYPE"
|
||||||
|
_Type_Body_enumType "::capnp::schema::Type::Body::Which::ENUM_TYPE"
|
||||||
|
_Type_Body_uint64Type "::capnp::schema::Type::Body::Which::UINT64_TYPE"
|
||||||
|
_Type_Body_textType "::capnp::schema::Type::Body::Which::TEXT_TYPE"
|
||||||
|
_Type_Body_int16Type "::capnp::schema::Type::Body::Which::INT16_TYPE"
|
||||||
|
enum _Node_Body_Which:
|
||||||
|
_Node_Body_annotationNode "::capnp::schema::Node::Body::Which::ANNOTATION_NODE"
|
||||||
|
_Node_Body_interfaceNode "::capnp::schema::Node::Body::Which::INTERFACE_NODE"
|
||||||
|
_Node_Body_enumNode "::capnp::schema::Node::Body::Which::ENUM_NODE"
|
||||||
|
_Node_Body_structNode "::capnp::schema::Node::Body::Which::STRUCT_NODE"
|
||||||
|
_Node_Body_constNode "::capnp::schema::Node::Body::Which::CONST_NODE"
|
||||||
|
_Node_Body_fileNode "::capnp::schema::Node::Body::Which::FILE_NODE"
|
||||||
|
enum _StructNode_Member_Body_Which:
|
||||||
|
_StructNode_Member_Body_fieldMember "::capnp::schema::StructNode::Member::Body::Which::FIELD_MEMBER"
|
||||||
|
_StructNode_Member_Body_unionMember "::capnp::schema::StructNode::Member::Body::Which::UNION_MEMBER"
|
||||||
|
cdef cppclass CodeGeneratorRequest
|
||||||
|
|
||||||
|
cdef cppclass InterfaceNode
|
||||||
|
cdef cppclass Value
|
||||||
|
cdef cppclass ConstNode
|
||||||
|
cdef cppclass Type
|
||||||
|
cdef cppclass FileNode
|
||||||
|
cdef cppclass Node
|
||||||
|
cdef cppclass AnnotationNode
|
||||||
|
cdef cppclass EnumNode
|
||||||
|
cdef cppclass StructNode
|
||||||
|
cdef cppclass Annotation
|
||||||
|
cdef cppclass CodeGeneratorRequest:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
List[CodeGeneratorRequest.Node].Reader getNodes()
|
||||||
|
List[UInt64].Reader getRequestedFiles()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
List[CodeGeneratorRequest.Node].Builder getNodes()
|
||||||
|
List[CodeGeneratorRequest.Node].Builder initNodes(int)
|
||||||
|
List[UInt64].Builder getRequestedFiles()
|
||||||
|
List[UInt64].Builder initRequestedFiles(int)
|
||||||
|
cdef cppclass InterfaceNode:
|
||||||
|
cppclass Method
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Method:
|
||||||
|
cppclass Param
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Param:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
Value getDefaultValue()
|
||||||
|
Type getType()
|
||||||
|
Text getName()
|
||||||
|
List[InterfaceNode.Method.Param.Annotation].Reader getAnnotations()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
Value getDefaultValue()
|
||||||
|
void setDefaultValue(Value)
|
||||||
|
Type getType()
|
||||||
|
void setType(Type)
|
||||||
|
Text getName()
|
||||||
|
void setName(Text)
|
||||||
|
List[InterfaceNode.Method.Param.Annotation].Builder getAnnotations()
|
||||||
|
List[InterfaceNode.Method.Param.Annotation].Builder initAnnotations(int)
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
UInt16 getCodeOrder()
|
||||||
|
Text getName()
|
||||||
|
List[InterfaceNode.Method.InterfaceNode.Method.Param].Reader getParams()
|
||||||
|
UInt16 getRequiredParamCount()
|
||||||
|
Type getReturnType()
|
||||||
|
List[InterfaceNode.Method.Annotation].Reader getAnnotations()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
UInt16 getCodeOrder()
|
||||||
|
void setCodeOrder(UInt16)
|
||||||
|
Text getName()
|
||||||
|
void setName(Text)
|
||||||
|
List[InterfaceNode.Method.InterfaceNode.Method.Param].Builder getParams()
|
||||||
|
List[InterfaceNode.Method.InterfaceNode.Method.Param].Builder initParams(int)
|
||||||
|
UInt16 getRequiredParamCount()
|
||||||
|
void setRequiredParamCount(UInt16)
|
||||||
|
Type getReturnType()
|
||||||
|
void setReturnType(Type)
|
||||||
|
List[InterfaceNode.Method.Annotation].Builder getAnnotations()
|
||||||
|
List[InterfaceNode.Method.Annotation].Builder initAnnotations(int)
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
List[InterfaceNode.InterfaceNode.Method].Reader getMethods()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
List[InterfaceNode.InterfaceNode.Method].Builder getMethods()
|
||||||
|
List[InterfaceNode.InterfaceNode.Method].Builder initMethods(int)
|
||||||
|
cdef cppclass Value:
|
||||||
|
cppclass Body
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Body:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
int which()
|
||||||
|
UInt32 getUint32Value()
|
||||||
|
Float64 getFloat64Value()
|
||||||
|
Void getVoidValue()
|
||||||
|
Data getDataValue()
|
||||||
|
Object getListValue()
|
||||||
|
Int32 getInt32Value()
|
||||||
|
UInt16 getEnumValue()
|
||||||
|
Int8 getInt8Value()
|
||||||
|
Bool getBoolValue()
|
||||||
|
Int16 getInt16Value()
|
||||||
|
Float32 getFloat32Value()
|
||||||
|
Void getInterfaceValue()
|
||||||
|
UInt16 getUint16Value()
|
||||||
|
UInt8 getUint8Value()
|
||||||
|
Int64 getInt64Value()
|
||||||
|
Object getStructValue()
|
||||||
|
Text getTextValue()
|
||||||
|
UInt64 getUint64Value()
|
||||||
|
Object getObjectValue()
|
||||||
|
cppclass Builder:
|
||||||
|
int which()
|
||||||
|
UInt32 getUint32Value()
|
||||||
|
void setUint32Value(UInt32)
|
||||||
|
Float64 getFloat64Value()
|
||||||
|
void setFloat64Value(Float64)
|
||||||
|
Void getVoidValue()
|
||||||
|
void setVoidValue(Void)
|
||||||
|
Data getDataValue()
|
||||||
|
void setDataValue(Data)
|
||||||
|
Object getListValue()
|
||||||
|
void setListValue(Object)
|
||||||
|
Int32 getInt32Value()
|
||||||
|
void setInt32Value(Int32)
|
||||||
|
UInt16 getEnumValue()
|
||||||
|
void setEnumValue(UInt16)
|
||||||
|
Int8 getInt8Value()
|
||||||
|
void setInt8Value(Int8)
|
||||||
|
Bool getBoolValue()
|
||||||
|
void setBoolValue(Bool)
|
||||||
|
Int16 getInt16Value()
|
||||||
|
void setInt16Value(Int16)
|
||||||
|
Float32 getFloat32Value()
|
||||||
|
void setFloat32Value(Float32)
|
||||||
|
Void getInterfaceValue()
|
||||||
|
void setInterfaceValue(Void)
|
||||||
|
UInt16 getUint16Value()
|
||||||
|
void setUint16Value(UInt16)
|
||||||
|
UInt8 getUint8Value()
|
||||||
|
void setUint8Value(UInt8)
|
||||||
|
Int64 getInt64Value()
|
||||||
|
void setInt64Value(Int64)
|
||||||
|
Object getStructValue()
|
||||||
|
void setStructValue(Object)
|
||||||
|
Text getTextValue()
|
||||||
|
void setTextValue(Text)
|
||||||
|
UInt64 getUint64Value()
|
||||||
|
void setUint64Value(UInt64)
|
||||||
|
Object getObjectValue()
|
||||||
|
void setObjectValue(Object)
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
Value.Body getBody()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
Value.Body getBody()
|
||||||
|
void setBody(Value.Body)
|
||||||
|
cdef cppclass ConstNode:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
Type getType()
|
||||||
|
Value getValue()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
Type getType()
|
||||||
|
void setType(Type)
|
||||||
|
Value getValue()
|
||||||
|
void setValue(Value)
|
||||||
|
cdef cppclass Type:
|
||||||
|
cppclass Body
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Body:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
int which()
|
||||||
|
Void getBoolType()
|
||||||
|
UInt64 getStructType()
|
||||||
|
Void getInt32Type()
|
||||||
|
Void getVoidType()
|
||||||
|
Void getUint16Type()
|
||||||
|
Void getDataType()
|
||||||
|
Void getObjectType()
|
||||||
|
Void getInt64Type()
|
||||||
|
Void getFloat64Type()
|
||||||
|
UInt64 getInterfaceType()
|
||||||
|
Void getUint32Type()
|
||||||
|
Void getUint8Type()
|
||||||
|
Type getListType()
|
||||||
|
Void getInt8Type()
|
||||||
|
Void getFloat32Type()
|
||||||
|
UInt64 getEnumType()
|
||||||
|
Void getUint64Type()
|
||||||
|
Void getTextType()
|
||||||
|
Void getInt16Type()
|
||||||
|
cppclass Builder:
|
||||||
|
int which()
|
||||||
|
Void getBoolType()
|
||||||
|
void setBoolType(Void)
|
||||||
|
UInt64 getStructType()
|
||||||
|
void setStructType(UInt64)
|
||||||
|
Void getInt32Type()
|
||||||
|
void setInt32Type(Void)
|
||||||
|
Void getVoidType()
|
||||||
|
void setVoidType(Void)
|
||||||
|
Void getUint16Type()
|
||||||
|
void setUint16Type(Void)
|
||||||
|
Void getDataType()
|
||||||
|
void setDataType(Void)
|
||||||
|
Void getObjectType()
|
||||||
|
void setObjectType(Void)
|
||||||
|
Void getInt64Type()
|
||||||
|
void setInt64Type(Void)
|
||||||
|
Void getFloat64Type()
|
||||||
|
void setFloat64Type(Void)
|
||||||
|
UInt64 getInterfaceType()
|
||||||
|
void setInterfaceType(UInt64)
|
||||||
|
Void getUint32Type()
|
||||||
|
void setUint32Type(Void)
|
||||||
|
Void getUint8Type()
|
||||||
|
void setUint8Type(Void)
|
||||||
|
Type getListType()
|
||||||
|
void setListType(Type)
|
||||||
|
Void getInt8Type()
|
||||||
|
void setInt8Type(Void)
|
||||||
|
Void getFloat32Type()
|
||||||
|
void setFloat32Type(Void)
|
||||||
|
UInt64 getEnumType()
|
||||||
|
void setEnumType(UInt64)
|
||||||
|
Void getUint64Type()
|
||||||
|
void setUint64Type(Void)
|
||||||
|
Void getTextType()
|
||||||
|
void setTextType(Void)
|
||||||
|
Void getInt16Type()
|
||||||
|
void setInt16Type(Void)
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
Type.Body getBody()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
Type.Body getBody()
|
||||||
|
void setBody(Type.Body)
|
||||||
|
cdef cppclass FileNode:
|
||||||
|
cppclass Import
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Import:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
UInt64 getId()
|
||||||
|
Text getName()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
UInt64 getId()
|
||||||
|
void setId(UInt64)
|
||||||
|
Text getName()
|
||||||
|
void setName(Text)
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
List[FileNode.FileNode.Import].Reader getImports()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
List[FileNode.FileNode.Import].Builder getImports()
|
||||||
|
List[FileNode.FileNode.Import].Builder initImports(int)
|
||||||
|
cdef cppclass Node:
|
||||||
|
cppclass Body
|
||||||
|
cppclass NestedNode
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Body:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
int which()
|
||||||
|
AnnotationNode getAnnotationNode()
|
||||||
|
InterfaceNode getInterfaceNode()
|
||||||
|
EnumNode getEnumNode()
|
||||||
|
StructNode getStructNode()
|
||||||
|
ConstNode getConstNode()
|
||||||
|
FileNode getFileNode()
|
||||||
|
cppclass Builder:
|
||||||
|
int which()
|
||||||
|
AnnotationNode getAnnotationNode()
|
||||||
|
void setAnnotationNode(AnnotationNode)
|
||||||
|
InterfaceNode getInterfaceNode()
|
||||||
|
void setInterfaceNode(InterfaceNode)
|
||||||
|
EnumNode getEnumNode()
|
||||||
|
void setEnumNode(EnumNode)
|
||||||
|
StructNode getStructNode()
|
||||||
|
void setStructNode(StructNode)
|
||||||
|
ConstNode getConstNode()
|
||||||
|
void setConstNode(ConstNode)
|
||||||
|
FileNode getFileNode()
|
||||||
|
void setFileNode(FileNode)
|
||||||
|
cppclass NestedNode:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
Text getName()
|
||||||
|
UInt64 getId()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
Text getName()
|
||||||
|
void setName(Text)
|
||||||
|
UInt64 getId()
|
||||||
|
void setId(UInt64)
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
Node.Body getBody()
|
||||||
|
Text getDisplayName()
|
||||||
|
List[Node.Annotation].Reader getAnnotations()
|
||||||
|
UInt64 getScopeId()
|
||||||
|
List[Node.Node.NestedNode].Reader getNestedNodes()
|
||||||
|
UInt64 getId()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
Node.Body getBody()
|
||||||
|
void setBody(Node.Body)
|
||||||
|
Text getDisplayName()
|
||||||
|
void setDisplayName(Text)
|
||||||
|
List[Node.Annotation].Builder getAnnotations()
|
||||||
|
List[Node.Annotation].Builder initAnnotations(int)
|
||||||
|
UInt64 getScopeId()
|
||||||
|
void setScopeId(UInt64)
|
||||||
|
List[Node.Node.NestedNode].Builder getNestedNodes()
|
||||||
|
List[Node.Node.NestedNode].Builder initNestedNodes(int)
|
||||||
|
UInt64 getId()
|
||||||
|
void setId(UInt64)
|
||||||
|
cdef cppclass AnnotationNode:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
Bool getTargetsField()
|
||||||
|
Bool getTargetsConst()
|
||||||
|
Bool getTargetsFile()
|
||||||
|
Bool getTargetsStruct()
|
||||||
|
Bool getTargetsParam()
|
||||||
|
Bool getTargetsUnion()
|
||||||
|
Bool getTargetsAnnotation()
|
||||||
|
Bool getTargetsEnumerant()
|
||||||
|
Type getType()
|
||||||
|
Bool getTargetsEnum()
|
||||||
|
Bool getTargetsInterface()
|
||||||
|
Bool getTargetsMethod()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
Bool getTargetsField()
|
||||||
|
void setTargetsField(Bool)
|
||||||
|
Bool getTargetsConst()
|
||||||
|
void setTargetsConst(Bool)
|
||||||
|
Bool getTargetsFile()
|
||||||
|
void setTargetsFile(Bool)
|
||||||
|
Bool getTargetsStruct()
|
||||||
|
void setTargetsStruct(Bool)
|
||||||
|
Bool getTargetsParam()
|
||||||
|
void setTargetsParam(Bool)
|
||||||
|
Bool getTargetsUnion()
|
||||||
|
void setTargetsUnion(Bool)
|
||||||
|
Bool getTargetsAnnotation()
|
||||||
|
void setTargetsAnnotation(Bool)
|
||||||
|
Bool getTargetsEnumerant()
|
||||||
|
void setTargetsEnumerant(Bool)
|
||||||
|
Type getType()
|
||||||
|
void setType(Type)
|
||||||
|
Bool getTargetsEnum()
|
||||||
|
void setTargetsEnum(Bool)
|
||||||
|
Bool getTargetsInterface()
|
||||||
|
void setTargetsInterface(Bool)
|
||||||
|
Bool getTargetsMethod()
|
||||||
|
void setTargetsMethod(Bool)
|
||||||
|
cdef cppclass EnumNode:
|
||||||
|
cppclass Enumerant
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Enumerant:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
UInt16 getCodeOrder()
|
||||||
|
Text getName()
|
||||||
|
List[EnumNode.Enumerant.Annotation].Reader getAnnotations()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
UInt16 getCodeOrder()
|
||||||
|
void setCodeOrder(UInt16)
|
||||||
|
Text getName()
|
||||||
|
void setName(Text)
|
||||||
|
List[EnumNode.Enumerant.Annotation].Builder getAnnotations()
|
||||||
|
List[EnumNode.Enumerant.Annotation].Builder initAnnotations(int)
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
List[EnumNode.EnumNode.Enumerant].Reader getEnumerants()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
List[EnumNode.EnumNode.Enumerant].Builder getEnumerants()
|
||||||
|
List[EnumNode.EnumNode.Enumerant].Builder initEnumerants(int)
|
||||||
|
cdef cppclass StructNode:
|
||||||
|
cppclass Union
|
||||||
|
cppclass Member
|
||||||
|
cppclass Field
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Union:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
UInt32 getDiscriminantOffset()
|
||||||
|
List[StructNode.Union.StructNode.Member].Reader getMembers()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
UInt32 getDiscriminantOffset()
|
||||||
|
void setDiscriminantOffset(UInt32)
|
||||||
|
List[StructNode.Union.StructNode.Member].Builder getMembers()
|
||||||
|
List[StructNode.Union.StructNode.Member].Builder initMembers(int)
|
||||||
|
cppclass Member:
|
||||||
|
cppclass Body
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Body:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
int which()
|
||||||
|
Field getFieldMember()
|
||||||
|
Union getUnionMember()
|
||||||
|
cppclass Builder:
|
||||||
|
int which()
|
||||||
|
Field getFieldMember()
|
||||||
|
void setFieldMember(Field)
|
||||||
|
Union getUnionMember()
|
||||||
|
void setUnionMember(Union)
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
UInt16 getOrdinal()
|
||||||
|
StructNode.Member.Body getBody()
|
||||||
|
UInt16 getCodeOrder()
|
||||||
|
Text getName()
|
||||||
|
List[StructNode.Member.Annotation].Reader getAnnotations()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
UInt16 getOrdinal()
|
||||||
|
void setOrdinal(UInt16)
|
||||||
|
StructNode.Member.Body getBody()
|
||||||
|
void setBody(StructNode.Member.Body)
|
||||||
|
UInt16 getCodeOrder()
|
||||||
|
void setCodeOrder(UInt16)
|
||||||
|
Text getName()
|
||||||
|
void setName(Text)
|
||||||
|
List[StructNode.Member.Annotation].Builder getAnnotations()
|
||||||
|
List[StructNode.Member.Annotation].Builder initAnnotations(int)
|
||||||
|
cppclass Field:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
Value getDefaultValue()
|
||||||
|
Type getType()
|
||||||
|
UInt32 getOffset()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
Value getDefaultValue()
|
||||||
|
void setDefaultValue(Value)
|
||||||
|
Type getType()
|
||||||
|
void setType(Type)
|
||||||
|
UInt32 getOffset()
|
||||||
|
void setOffset(UInt32)
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
UInt16 getDataSectionWordSize()
|
||||||
|
List[StructNode.StructNode.Member].Reader getMembers()
|
||||||
|
UInt16 getPointerSectionSize()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
UInt16 getDataSectionWordSize()
|
||||||
|
void setDataSectionWordSize(UInt16)
|
||||||
|
List[StructNode.StructNode.Member].Builder getMembers()
|
||||||
|
List[StructNode.StructNode.Member].Builder initMembers(int)
|
||||||
|
UInt16 getPointerSectionSize()
|
||||||
|
void setPointerSectionSize(UInt16)
|
||||||
|
cdef cppclass Annotation:
|
||||||
|
|
||||||
|
|
||||||
|
cppclass Reader:
|
||||||
|
|
||||||
|
UInt64 getId()
|
||||||
|
Value getValue()
|
||||||
|
cppclass Builder:
|
||||||
|
|
||||||
|
UInt64 getId()
|
||||||
|
void setId(UInt64)
|
||||||
|
Value getValue()
|
||||||
|
void setValue(Value)
|
||||||
|
|
||||||
|
cdef extern from "capnp/message.h" namespace "::capnp":
|
||||||
|
cdef cppclass ReaderOptions:
|
||||||
|
uint64_t traversalLimitInWords
|
||||||
|
uint nestingLimit
|
||||||
|
|
||||||
|
cdef cppclass MessageBuilder:
|
||||||
|
CodeGeneratorRequest.Builder getRootCodeGeneratorRequest'getRoot<::capnp::schema::CodeGeneratorRequest>'()
|
||||||
|
CodeGeneratorRequest.Builder initRootCodeGeneratorRequest'initRoot<::capnp::schema::CodeGeneratorRequest>'()
|
||||||
|
InterfaceNode.Builder getRootInterfaceNode'getRoot<::capnp::schema::InterfaceNode>'()
|
||||||
|
InterfaceNode.Builder initRootInterfaceNode'initRoot<::capnp::schema::InterfaceNode>'()
|
||||||
|
Value.Builder getRootValue'getRoot<::capnp::schema::Value>'()
|
||||||
|
Value.Builder initRootValue'initRoot<::capnp::schema::Value>'()
|
||||||
|
ConstNode.Builder getRootConstNode'getRoot<::capnp::schema::ConstNode>'()
|
||||||
|
ConstNode.Builder initRootConstNode'initRoot<::capnp::schema::ConstNode>'()
|
||||||
|
Type.Builder getRootType'getRoot<::capnp::schema::Type>'()
|
||||||
|
Type.Builder initRootType'initRoot<::capnp::schema::Type>'()
|
||||||
|
FileNode.Builder getRootFileNode'getRoot<::capnp::schema::FileNode>'()
|
||||||
|
FileNode.Builder initRootFileNode'initRoot<::capnp::schema::FileNode>'()
|
||||||
|
Node.Builder getRootNode'getRoot<::capnp::schema::Node>'()
|
||||||
|
Node.Builder initRootNode'initRoot<::capnp::schema::Node>'()
|
||||||
|
AnnotationNode.Builder getRootAnnotationNode'getRoot<::capnp::schema::AnnotationNode>'()
|
||||||
|
AnnotationNode.Builder initRootAnnotationNode'initRoot<::capnp::schema::AnnotationNode>'()
|
||||||
|
EnumNode.Builder getRootEnumNode'getRoot<::capnp::schema::EnumNode>'()
|
||||||
|
EnumNode.Builder initRootEnumNode'initRoot<::capnp::schema::EnumNode>'()
|
||||||
|
StructNode.Builder getRootStructNode'getRoot<::capnp::schema::StructNode>'()
|
||||||
|
StructNode.Builder initRootStructNode'initRoot<::capnp::schema::StructNode>'()
|
||||||
|
Annotation.Builder getRootAnnotation'getRoot<::capnp::schema::Annotation>'()
|
||||||
|
Annotation.Builder initRootAnnotation'initRoot<::capnp::schema::Annotation>'()
|
||||||
|
|
||||||
|
cdef cppclass MessageReader:
|
||||||
|
CodeGeneratorRequest.Reader getRootCodeGeneratorRequest'getRoot<::capnp::schema::CodeGeneratorRequest>'()
|
||||||
|
InterfaceNode.Reader getRootInterfaceNode'getRoot<::capnp::schema::InterfaceNode>'()
|
||||||
|
Value.Reader getRootValue'getRoot<::capnp::schema::Value>'()
|
||||||
|
ConstNode.Reader getRootConstNode'getRoot<::capnp::schema::ConstNode>'()
|
||||||
|
Type.Reader getRootType'getRoot<::capnp::schema::Type>'()
|
||||||
|
FileNode.Reader getRootFileNode'getRoot<::capnp::schema::FileNode>'()
|
||||||
|
Node.Reader getRootNode'getRoot<::capnp::schema::Node>'()
|
||||||
|
AnnotationNode.Reader getRootAnnotationNode'getRoot<::capnp::schema::AnnotationNode>'()
|
||||||
|
EnumNode.Reader getRootEnumNode'getRoot<::capnp::schema::EnumNode>'()
|
||||||
|
StructNode.Reader getRootStructNode'getRoot<::capnp::schema::StructNode>'()
|
||||||
|
Annotation.Reader getRootAnnotation'getRoot<::capnp::schema::Annotation>'()
|
||||||
|
|
||||||
|
cdef cppclass MallocMessageBuilder(MessageBuilder):
|
||||||
|
MallocMessageBuilder()
|
||||||
|
MallocMessageBuilder(int)
|
||||||
|
|
||||||
|
enum Void:
|
||||||
|
VOID
|
||||||
|
|
||||||
|
cdef extern from "capnp/serialize.h" namespace "::capnp":
|
||||||
|
cdef cppclass StreamFdMessageReader(MessageReader):
|
||||||
|
StreamFdMessageReader(int)
|
||||||
|
StreamFdMessageReader(int, ReaderOptions)
|
||||||
|
|
||||||
|
void writeMessageToFd(int, MessageBuilder&)
|
||||||
|
|
||||||
|
cdef extern from "capnp/serialize-packed.h" namespace "::capnp":
|
||||||
|
cdef cppclass PackedFdMessageReader(MessageReader):
|
||||||
|
PackedFdMessageReader(int)
|
||||||
|
StreamFdMessageReader(int, ReaderOptions)
|
||||||
|
|
||||||
|
void writePackedMessageToFd(int, MessageBuilder&)
|
||||||
@@ -4,7 +4,9 @@
|
|||||||
# distutils: libraries = capnp
|
# distutils: libraries = capnp
|
||||||
|
|
||||||
cimport capnp_schema as capnp
|
cimport capnp_schema as capnp
|
||||||
from capnp_schema cimport CodeGeneratorRequest as C_CodeGeneratorRequest,ElementSize as C_ElementSize,InterfaceNode as C_InterfaceNode,Value as C_Value,ConstNode as C_ConstNode,Type as C_Type,FileNode as C_FileNode,Node as C_Node,AnnotationNode as C_AnnotationNode,EnumNode as C_EnumNode,StructNode as C_StructNode,Annotation as C_Annotation
|
from capnp_schema cimport CodeGeneratorRequest as C_CodeGeneratorRequest,InterfaceNode as C_InterfaceNode,Value as C_Value,ConstNode as C_ConstNode,Type as C_Type,FileNode as C_FileNode,Node as C_Node,AnnotationNode as C_AnnotationNode,EnumNode as C_EnumNode,StructNode as C_StructNode,Annotation as C_Annotation
|
||||||
|
from capnp_schema cimport _ElementSize_inlineComposite,_ElementSize_eightBytes,_ElementSize_pointer,_ElementSize_bit,_ElementSize_twoBytes,_ElementSize_fourBytes,_ElementSize_byte,_ElementSize_empty
|
||||||
|
from capnp_schema cimport _Value_Body_uint32Value,_Value_Body_float64Value,_Value_Body_voidValue,_Value_Body_dataValue,_Value_Body_listValue,_Value_Body_int32Value,_Value_Body_enumValue,_Value_Body_int8Value,_Value_Body_boolValue,_Value_Body_int16Value,_Value_Body_float32Value,_Value_Body_interfaceValue,_Value_Body_uint16Value,_Value_Body_uint8Value,_Value_Body_int64Value,_Value_Body_structValue,_Value_Body_textValue,_Value_Body_uint64Value,_Value_Body_objectValue,_Type_Body_boolType,_Type_Body_structType,_Type_Body_int32Type,_Type_Body_voidType,_Type_Body_uint16Type,_Type_Body_dataType,_Type_Body_objectType,_Type_Body_int64Type,_Type_Body_float64Type,_Type_Body_interfaceType,_Type_Body_uint32Type,_Type_Body_uint8Type,_Type_Body_listType,_Type_Body_int8Type,_Type_Body_float32Type,_Type_Body_enumType,_Type_Body_uint64Type,_Type_Body_textType,_Type_Body_int16Type,_Node_Body_annotationNode,_Node_Body_interfaceNode,_Node_Body_enumNode,_Node_Body_structNode,_Node_Body_constNode,_Node_Body_fileNode,_StructNode_Member_Body_fieldMember,_StructNode_Member_Body_unionMember
|
||||||
|
|
||||||
# from capnp_schema cimport *
|
# from capnp_schema cimport *
|
||||||
# Not doing this since we want to namespace away the class names
|
# Not doing this since we want to namespace away the class names
|
||||||
@@ -48,7 +50,7 @@ cdef class _List_InterfaceNode_InterfaceNode_Method_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _InterfaceNode_MethodReader().init(<C_InterfaceNode.InterfaceNode.Method.Reader>self.thisptr[index])
|
return _InterfaceNode_MethodReader().init(<C_InterfaceNode.InterfaceNode.Method.Reader>self.thisptr[index])
|
||||||
@@ -62,7 +64,7 @@ cdef class _List_InterfaceNode_InterfaceNode_Method_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _InterfaceNode_MethodBuilder().init(<C_InterfaceNode.InterfaceNode.Method.Builder>self.thisptr[index])
|
return _InterfaceNode_MethodBuilder().init(<C_InterfaceNode.InterfaceNode.Method.Builder>self.thisptr[index])
|
||||||
@@ -75,7 +77,7 @@ cdef class _List_EnumNode_EnumNode_Enumerant_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _EnumNode_EnumerantReader().init(<C_EnumNode.EnumNode.Enumerant.Reader>self.thisptr[index])
|
return _EnumNode_EnumerantReader().init(<C_EnumNode.EnumNode.Enumerant.Reader>self.thisptr[index])
|
||||||
@@ -89,7 +91,7 @@ cdef class _List_EnumNode_EnumNode_Enumerant_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _EnumNode_EnumerantBuilder().init(<C_EnumNode.EnumNode.Enumerant.Builder>self.thisptr[index])
|
return _EnumNode_EnumerantBuilder().init(<C_EnumNode.EnumNode.Enumerant.Builder>self.thisptr[index])
|
||||||
@@ -102,7 +104,7 @@ cdef class _List_StructNode_Union_StructNode_Member_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _StructNode_MemberReader().init(<C_StructNode.Union.StructNode.Member.Reader>self.thisptr[index])
|
return _StructNode_MemberReader().init(<C_StructNode.Union.StructNode.Member.Reader>self.thisptr[index])
|
||||||
@@ -116,7 +118,7 @@ cdef class _List_StructNode_Union_StructNode_Member_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _StructNode_MemberBuilder().init(<C_StructNode.Union.StructNode.Member.Builder>self.thisptr[index])
|
return _StructNode_MemberBuilder().init(<C_StructNode.Union.StructNode.Member.Builder>self.thisptr[index])
|
||||||
@@ -129,7 +131,7 @@ cdef class _List_InterfaceNode_Method_InterfaceNode_Method_Param_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _InterfaceNode_Method_ParamReader().init(<C_InterfaceNode.Method.InterfaceNode.Method.Param.Reader>self.thisptr[index])
|
return _InterfaceNode_Method_ParamReader().init(<C_InterfaceNode.Method.InterfaceNode.Method.Param.Reader>self.thisptr[index])
|
||||||
@@ -143,7 +145,7 @@ cdef class _List_InterfaceNode_Method_InterfaceNode_Method_Param_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _InterfaceNode_Method_ParamBuilder().init(<C_InterfaceNode.Method.InterfaceNode.Method.Param.Builder>self.thisptr[index])
|
return _InterfaceNode_Method_ParamBuilder().init(<C_InterfaceNode.Method.InterfaceNode.Method.Param.Builder>self.thisptr[index])
|
||||||
@@ -156,7 +158,7 @@ cdef class _List_InterfaceNode_Method_Param_Annotation_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _AnnotationReader().init(<C_InterfaceNode.Method.Param.Annotation.Reader>self.thisptr[index])
|
return _AnnotationReader().init(<C_InterfaceNode.Method.Param.Annotation.Reader>self.thisptr[index])
|
||||||
@@ -170,7 +172,7 @@ cdef class _List_InterfaceNode_Method_Param_Annotation_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _AnnotationBuilder().init(<C_InterfaceNode.Method.Param.Annotation.Builder>self.thisptr[index])
|
return _AnnotationBuilder().init(<C_InterfaceNode.Method.Param.Annotation.Builder>self.thisptr[index])
|
||||||
@@ -183,7 +185,7 @@ cdef class _List_UInt64_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return self.thisptr[index]
|
return self.thisptr[index]
|
||||||
@@ -197,7 +199,7 @@ cdef class _List_UInt64_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return self.thisptr[index]
|
return self.thisptr[index]
|
||||||
@@ -210,7 +212,7 @@ cdef class _List_Node_Node_NestedNode_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _Node_NestedNodeReader().init(<C_Node.Node.NestedNode.Reader>self.thisptr[index])
|
return _Node_NestedNodeReader().init(<C_Node.Node.NestedNode.Reader>self.thisptr[index])
|
||||||
@@ -224,7 +226,7 @@ cdef class _List_Node_Node_NestedNode_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _Node_NestedNodeBuilder().init(<C_Node.Node.NestedNode.Builder>self.thisptr[index])
|
return _Node_NestedNodeBuilder().init(<C_Node.Node.NestedNode.Builder>self.thisptr[index])
|
||||||
@@ -237,7 +239,7 @@ cdef class _List_StructNode_Member_Annotation_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _AnnotationReader().init(<C_StructNode.Member.Annotation.Reader>self.thisptr[index])
|
return _AnnotationReader().init(<C_StructNode.Member.Annotation.Reader>self.thisptr[index])
|
||||||
@@ -251,7 +253,7 @@ cdef class _List_StructNode_Member_Annotation_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _AnnotationBuilder().init(<C_StructNode.Member.Annotation.Builder>self.thisptr[index])
|
return _AnnotationBuilder().init(<C_StructNode.Member.Annotation.Builder>self.thisptr[index])
|
||||||
@@ -264,7 +266,7 @@ cdef class _List_InterfaceNode_Method_Annotation_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _AnnotationReader().init(<C_InterfaceNode.Method.Annotation.Reader>self.thisptr[index])
|
return _AnnotationReader().init(<C_InterfaceNode.Method.Annotation.Reader>self.thisptr[index])
|
||||||
@@ -278,7 +280,7 @@ cdef class _List_InterfaceNode_Method_Annotation_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _AnnotationBuilder().init(<C_InterfaceNode.Method.Annotation.Builder>self.thisptr[index])
|
return _AnnotationBuilder().init(<C_InterfaceNode.Method.Annotation.Builder>self.thisptr[index])
|
||||||
@@ -291,7 +293,7 @@ cdef class _List_StructNode_StructNode_Member_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _StructNode_MemberReader().init(<C_StructNode.StructNode.Member.Reader>self.thisptr[index])
|
return _StructNode_MemberReader().init(<C_StructNode.StructNode.Member.Reader>self.thisptr[index])
|
||||||
@@ -305,7 +307,7 @@ cdef class _List_StructNode_StructNode_Member_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _StructNode_MemberBuilder().init(<C_StructNode.StructNode.Member.Builder>self.thisptr[index])
|
return _StructNode_MemberBuilder().init(<C_StructNode.StructNode.Member.Builder>self.thisptr[index])
|
||||||
@@ -318,7 +320,7 @@ cdef class _List_Node_Annotation_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _AnnotationReader().init(<C_Node.Annotation.Reader>self.thisptr[index])
|
return _AnnotationReader().init(<C_Node.Annotation.Reader>self.thisptr[index])
|
||||||
@@ -332,7 +334,7 @@ cdef class _List_Node_Annotation_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _AnnotationBuilder().init(<C_Node.Annotation.Builder>self.thisptr[index])
|
return _AnnotationBuilder().init(<C_Node.Annotation.Builder>self.thisptr[index])
|
||||||
@@ -345,7 +347,7 @@ cdef class _List_CodeGeneratorRequest_Node_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _NodeReader().init(<C_CodeGeneratorRequest.Node.Reader>self.thisptr[index])
|
return _NodeReader().init(<C_CodeGeneratorRequest.Node.Reader>self.thisptr[index])
|
||||||
@@ -359,7 +361,7 @@ cdef class _List_CodeGeneratorRequest_Node_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _NodeBuilder().init(<C_CodeGeneratorRequest.Node.Builder>self.thisptr[index])
|
return _NodeBuilder().init(<C_CodeGeneratorRequest.Node.Builder>self.thisptr[index])
|
||||||
@@ -372,7 +374,7 @@ cdef class _List_FileNode_FileNode_Import_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _FileNode_ImportReader().init(<C_FileNode.FileNode.Import.Reader>self.thisptr[index])
|
return _FileNode_ImportReader().init(<C_FileNode.FileNode.Import.Reader>self.thisptr[index])
|
||||||
@@ -386,7 +388,7 @@ cdef class _List_FileNode_FileNode_Import_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _FileNode_ImportBuilder().init(<C_FileNode.FileNode.Import.Builder>self.thisptr[index])
|
return _FileNode_ImportBuilder().init(<C_FileNode.FileNode.Import.Builder>self.thisptr[index])
|
||||||
@@ -399,7 +401,7 @@ cdef class _List_EnumNode_Enumerant_Annotation_Reader:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _AnnotationReader().init(<C_EnumNode.Enumerant.Annotation.Reader>self.thisptr[index])
|
return _AnnotationReader().init(<C_EnumNode.Enumerant.Annotation.Reader>self.thisptr[index])
|
||||||
@@ -413,7 +415,7 @@ cdef class _List_EnumNode_Enumerant_Annotation_Builder:
|
|||||||
return self
|
return self
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
size = self.thisptr.size()
|
size = self.thisptr.size()
|
||||||
if index > size:
|
if index >= size:
|
||||||
raise IndexError('Out of bounds')
|
raise IndexError('Out of bounds')
|
||||||
index = index % size
|
index = index % size
|
||||||
return _AnnotationBuilder().init(<C_EnumNode.Enumerant.Annotation.Builder>self.thisptr[index])
|
return _AnnotationBuilder().init(<C_EnumNode.Enumerant.Annotation.Builder>self.thisptr[index])
|
||||||
@@ -425,6 +427,7 @@ cdef class _CodeGeneratorRequestReader:
|
|||||||
cdef init(self, C_CodeGeneratorRequest.Reader other):
|
cdef init(self, C_CodeGeneratorRequest.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property nodes:
|
property nodes:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _List_CodeGeneratorRequest_Node_Reader().init(self.thisptr.getNodes())
|
return _List_CodeGeneratorRequest_Node_Reader().init(self.thisptr.getNodes())
|
||||||
@@ -437,6 +440,7 @@ cdef class _CodeGeneratorRequestBuilder:
|
|||||||
cdef init(self, C_CodeGeneratorRequest.Builder other):
|
cdef init(self, C_CodeGeneratorRequest.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property nodes:
|
property nodes:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _List_CodeGeneratorRequest_Node_Builder().init(self.thisptr.getNodes())
|
return _List_CodeGeneratorRequest_Node_Builder().init(self.thisptr.getNodes())
|
||||||
@@ -448,6 +452,7 @@ cdef class _CodeGeneratorRequestBuilder:
|
|||||||
cpdef initRequestedFiles(self, uint num):
|
cpdef initRequestedFiles(self, uint num):
|
||||||
return _List_UInt64_Builder().init(self.thisptr.initRequestedFiles(num))
|
return _List_UInt64_Builder().init(self.thisptr.initRequestedFiles(num))
|
||||||
|
|
||||||
|
_ElementSize = make_enum('_ElementSize',inlineComposite = <int>_ElementSize_inlineComposite,eightBytes = <int>_ElementSize_eightBytes,pointer = <int>_ElementSize_pointer,bit = <int>_ElementSize_bit,twoBytes = <int>_ElementSize_twoBytes,fourBytes = <int>_ElementSize_fourBytes,byte = <int>_ElementSize_byte,empty = <int>_ElementSize_empty,)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -456,6 +461,7 @@ cdef class _InterfaceNode_Method_ParamReader:
|
|||||||
cdef init(self, C_InterfaceNode.Method.Param.Reader other):
|
cdef init(self, C_InterfaceNode.Method.Param.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property defaultValue:
|
property defaultValue:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _ValueReader().init(<C_Value.Reader>self.thisptr.getDefaultValue())
|
return _ValueReader().init(<C_Value.Reader>self.thisptr.getDefaultValue())
|
||||||
@@ -474,6 +480,7 @@ cdef class _InterfaceNode_Method_ParamBuilder:
|
|||||||
cdef init(self, C_InterfaceNode.Method.Param.Builder other):
|
cdef init(self, C_InterfaceNode.Method.Param.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property defaultValue:
|
property defaultValue:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _ValueBuilder().init(<C_Value.Builder>self.thisptr.getDefaultValue())
|
return _ValueBuilder().init(<C_Value.Builder>self.thisptr.getDefaultValue())
|
||||||
@@ -499,6 +506,7 @@ cdef class _InterfaceNode_MethodReader:
|
|||||||
cdef init(self, C_InterfaceNode.Method.Reader other):
|
cdef init(self, C_InterfaceNode.Method.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property codeOrder:
|
property codeOrder:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getCodeOrder()
|
return self.thisptr.getCodeOrder()
|
||||||
@@ -523,6 +531,7 @@ cdef class _InterfaceNode_MethodBuilder:
|
|||||||
cdef init(self, C_InterfaceNode.Method.Builder other):
|
cdef init(self, C_InterfaceNode.Method.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property codeOrder:
|
property codeOrder:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getCodeOrder()
|
return self.thisptr.getCodeOrder()
|
||||||
@@ -558,6 +567,7 @@ cdef class _InterfaceNodeReader:
|
|||||||
cdef init(self, C_InterfaceNode.Reader other):
|
cdef init(self, C_InterfaceNode.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property methods:
|
property methods:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _List_InterfaceNode_InterfaceNode_Method_Reader().init(self.thisptr.getMethods())
|
return _List_InterfaceNode_InterfaceNode_Method_Reader().init(self.thisptr.getMethods())
|
||||||
@@ -567,6 +577,7 @@ cdef class _InterfaceNodeBuilder:
|
|||||||
cdef init(self, C_InterfaceNode.Builder other):
|
cdef init(self, C_InterfaceNode.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property methods:
|
property methods:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _List_InterfaceNode_InterfaceNode_Method_Builder().init(self.thisptr.getMethods())
|
return _List_InterfaceNode_InterfaceNode_Method_Builder().init(self.thisptr.getMethods())
|
||||||
@@ -574,11 +585,15 @@ cdef class _InterfaceNodeBuilder:
|
|||||||
return _List_InterfaceNode_InterfaceNode_Method_Builder().init(self.thisptr.initMethods(num))
|
return _List_InterfaceNode_InterfaceNode_Method_Builder().init(self.thisptr.initMethods(num))
|
||||||
|
|
||||||
|
|
||||||
|
_Value_Body_Which = make_enum('_Value_Body_Which',uint32Value = <int>_Value_Body_uint32Value,float64Value = <int>_Value_Body_float64Value,voidValue = <int>_Value_Body_voidValue,dataValue = <int>_Value_Body_dataValue,listValue = <int>_Value_Body_listValue,int32Value = <int>_Value_Body_int32Value,enumValue = <int>_Value_Body_enumValue,int8Value = <int>_Value_Body_int8Value,boolValue = <int>_Value_Body_boolValue,int16Value = <int>_Value_Body_int16Value,float32Value = <int>_Value_Body_float32Value,interfaceValue = <int>_Value_Body_interfaceValue,uint16Value = <int>_Value_Body_uint16Value,uint8Value = <int>_Value_Body_uint8Value,int64Value = <int>_Value_Body_int64Value,structValue = <int>_Value_Body_structValue,textValue = <int>_Value_Body_textValue,uint64Value = <int>_Value_Body_uint64Value,objectValue = <int>_Value_Body_objectValue,)
|
||||||
cdef class _Value_BodyReader:
|
cdef class _Value_BodyReader:
|
||||||
cdef C_Value.Body.Reader thisptr
|
cdef C_Value.Body.Reader thisptr
|
||||||
cdef init(self, C_Value.Body.Reader other):
|
cdef init(self, C_Value.Body.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
cpdef int which(self):
|
||||||
|
return self.thisptr.which()
|
||||||
property uint32Value:
|
property uint32Value:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getUint32Value()
|
return self.thisptr.getUint32Value()
|
||||||
@@ -642,6 +657,9 @@ cdef class _Value_BodyBuilder:
|
|||||||
cdef init(self, C_Value.Body.Builder other):
|
cdef init(self, C_Value.Body.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
cpdef int which(self):
|
||||||
|
return self.thisptr.which()
|
||||||
property uint32Value:
|
property uint32Value:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getUint32Value()
|
return self.thisptr.getUint32Value()
|
||||||
@@ -742,6 +760,7 @@ cdef class _ValueReader:
|
|||||||
cdef init(self, C_Value.Reader other):
|
cdef init(self, C_Value.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property body:
|
property body:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _Value_BodyReader().init(<C_Value.Body.Reader>self.thisptr.getBody())
|
return _Value_BodyReader().init(<C_Value.Body.Reader>self.thisptr.getBody())
|
||||||
@@ -751,6 +770,7 @@ cdef class _ValueBuilder:
|
|||||||
cdef init(self, C_Value.Builder other):
|
cdef init(self, C_Value.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property body:
|
property body:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _Value_BodyBuilder().init(<C_Value.Body.Builder>self.thisptr.getBody())
|
return _Value_BodyBuilder().init(<C_Value.Body.Builder>self.thisptr.getBody())
|
||||||
@@ -762,6 +782,7 @@ cdef class _ConstNodeReader:
|
|||||||
cdef init(self, C_ConstNode.Reader other):
|
cdef init(self, C_ConstNode.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property type:
|
property type:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _TypeReader().init(<C_Type.Reader>self.thisptr.getType())
|
return _TypeReader().init(<C_Type.Reader>self.thisptr.getType())
|
||||||
@@ -774,6 +795,7 @@ cdef class _ConstNodeBuilder:
|
|||||||
cdef init(self, C_ConstNode.Builder other):
|
cdef init(self, C_ConstNode.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property type:
|
property type:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _TypeBuilder().init(<C_Type.Builder>self.thisptr.getType())
|
return _TypeBuilder().init(<C_Type.Builder>self.thisptr.getType())
|
||||||
@@ -786,11 +808,15 @@ cdef class _ConstNodeBuilder:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
_Type_Body_Which = make_enum('_Type_Body_Which',boolType = <int>_Type_Body_boolType,structType = <int>_Type_Body_structType,int32Type = <int>_Type_Body_int32Type,voidType = <int>_Type_Body_voidType,uint16Type = <int>_Type_Body_uint16Type,dataType = <int>_Type_Body_dataType,objectType = <int>_Type_Body_objectType,int64Type = <int>_Type_Body_int64Type,float64Type = <int>_Type_Body_float64Type,interfaceType = <int>_Type_Body_interfaceType,uint32Type = <int>_Type_Body_uint32Type,uint8Type = <int>_Type_Body_uint8Type,listType = <int>_Type_Body_listType,int8Type = <int>_Type_Body_int8Type,float32Type = <int>_Type_Body_float32Type,enumType = <int>_Type_Body_enumType,uint64Type = <int>_Type_Body_uint64Type,textType = <int>_Type_Body_textType,int16Type = <int>_Type_Body_int16Type,)
|
||||||
cdef class _Type_BodyReader:
|
cdef class _Type_BodyReader:
|
||||||
cdef C_Type.Body.Reader thisptr
|
cdef C_Type.Body.Reader thisptr
|
||||||
cdef init(self, C_Type.Body.Reader other):
|
cdef init(self, C_Type.Body.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
cpdef int which(self):
|
||||||
|
return self.thisptr.which()
|
||||||
property boolType:
|
property boolType:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return None
|
return None
|
||||||
@@ -854,6 +880,9 @@ cdef class _Type_BodyBuilder:
|
|||||||
cdef init(self, C_Type.Body.Builder other):
|
cdef init(self, C_Type.Body.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
cpdef int which(self):
|
||||||
|
return self.thisptr.which()
|
||||||
property boolType:
|
property boolType:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return None
|
return None
|
||||||
@@ -954,6 +983,7 @@ cdef class _TypeReader:
|
|||||||
cdef init(self, C_Type.Reader other):
|
cdef init(self, C_Type.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property body:
|
property body:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _Type_BodyReader().init(<C_Type.Body.Reader>self.thisptr.getBody())
|
return _Type_BodyReader().init(<C_Type.Body.Reader>self.thisptr.getBody())
|
||||||
@@ -963,6 +993,7 @@ cdef class _TypeBuilder:
|
|||||||
cdef init(self, C_Type.Builder other):
|
cdef init(self, C_Type.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property body:
|
property body:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _Type_BodyBuilder().init(<C_Type.Body.Builder>self.thisptr.getBody())
|
return _Type_BodyBuilder().init(<C_Type.Body.Builder>self.thisptr.getBody())
|
||||||
@@ -975,6 +1006,7 @@ cdef class _FileNode_ImportReader:
|
|||||||
cdef init(self, C_FileNode.Import.Reader other):
|
cdef init(self, C_FileNode.Import.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property id:
|
property id:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getId()
|
return self.thisptr.getId()
|
||||||
@@ -987,6 +1019,7 @@ cdef class _FileNode_ImportBuilder:
|
|||||||
cdef init(self, C_FileNode.Import.Builder other):
|
cdef init(self, C_FileNode.Import.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property id:
|
property id:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getId()
|
return self.thisptr.getId()
|
||||||
@@ -1002,6 +1035,7 @@ cdef class _FileNodeReader:
|
|||||||
cdef init(self, C_FileNode.Reader other):
|
cdef init(self, C_FileNode.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property imports:
|
property imports:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _List_FileNode_FileNode_Import_Reader().init(self.thisptr.getImports())
|
return _List_FileNode_FileNode_Import_Reader().init(self.thisptr.getImports())
|
||||||
@@ -1011,6 +1045,7 @@ cdef class _FileNodeBuilder:
|
|||||||
cdef init(self, C_FileNode.Builder other):
|
cdef init(self, C_FileNode.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property imports:
|
property imports:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _List_FileNode_FileNode_Import_Builder().init(self.thisptr.getImports())
|
return _List_FileNode_FileNode_Import_Builder().init(self.thisptr.getImports())
|
||||||
@@ -1018,11 +1053,15 @@ cdef class _FileNodeBuilder:
|
|||||||
return _List_FileNode_FileNode_Import_Builder().init(self.thisptr.initImports(num))
|
return _List_FileNode_FileNode_Import_Builder().init(self.thisptr.initImports(num))
|
||||||
|
|
||||||
|
|
||||||
|
_Node_Body_Which = make_enum('_Node_Body_Which',annotationNode = <int>_Node_Body_annotationNode,interfaceNode = <int>_Node_Body_interfaceNode,enumNode = <int>_Node_Body_enumNode,structNode = <int>_Node_Body_structNode,constNode = <int>_Node_Body_constNode,fileNode = <int>_Node_Body_fileNode,)
|
||||||
cdef class _Node_BodyReader:
|
cdef class _Node_BodyReader:
|
||||||
cdef C_Node.Body.Reader thisptr
|
cdef C_Node.Body.Reader thisptr
|
||||||
cdef init(self, C_Node.Body.Reader other):
|
cdef init(self, C_Node.Body.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
cpdef int which(self):
|
||||||
|
return self.thisptr.which()
|
||||||
property annotationNode:
|
property annotationNode:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _AnnotationNodeReader().init(<C_AnnotationNode.Reader>self.thisptr.getAnnotationNode())
|
return _AnnotationNodeReader().init(<C_AnnotationNode.Reader>self.thisptr.getAnnotationNode())
|
||||||
@@ -1047,6 +1086,9 @@ cdef class _Node_BodyBuilder:
|
|||||||
cdef init(self, C_Node.Body.Builder other):
|
cdef init(self, C_Node.Body.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
cpdef int which(self):
|
||||||
|
return self.thisptr.which()
|
||||||
property annotationNode:
|
property annotationNode:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _AnnotationNodeBuilder().init(<C_AnnotationNode.Builder>self.thisptr.getAnnotationNode())
|
return _AnnotationNodeBuilder().init(<C_AnnotationNode.Builder>self.thisptr.getAnnotationNode())
|
||||||
@@ -1083,6 +1125,7 @@ cdef class _Node_NestedNodeReader:
|
|||||||
cdef init(self, C_Node.NestedNode.Reader other):
|
cdef init(self, C_Node.NestedNode.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property name:
|
property name:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return None
|
return None
|
||||||
@@ -1095,6 +1138,7 @@ cdef class _Node_NestedNodeBuilder:
|
|||||||
cdef init(self, C_Node.NestedNode.Builder other):
|
cdef init(self, C_Node.NestedNode.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property name:
|
property name:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return None
|
return None
|
||||||
@@ -1110,6 +1154,7 @@ cdef class _NodeReader:
|
|||||||
cdef init(self, C_Node.Reader other):
|
cdef init(self, C_Node.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property body:
|
property body:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _Node_BodyReader().init(<C_Node.Body.Reader>self.thisptr.getBody())
|
return _Node_BodyReader().init(<C_Node.Body.Reader>self.thisptr.getBody())
|
||||||
@@ -1134,6 +1179,7 @@ cdef class _NodeBuilder:
|
|||||||
cdef init(self, C_Node.Builder other):
|
cdef init(self, C_Node.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property body:
|
property body:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _Node_BodyBuilder().init(<C_Node.Body.Builder>self.thisptr.getBody())
|
return _Node_BodyBuilder().init(<C_Node.Body.Builder>self.thisptr.getBody())
|
||||||
@@ -1170,6 +1216,7 @@ cdef class _AnnotationNodeReader:
|
|||||||
cdef init(self, C_AnnotationNode.Reader other):
|
cdef init(self, C_AnnotationNode.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property targetsField:
|
property targetsField:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getTargetsField()
|
return self.thisptr.getTargetsField()
|
||||||
@@ -1212,6 +1259,7 @@ cdef class _AnnotationNodeBuilder:
|
|||||||
cdef init(self, C_AnnotationNode.Builder other):
|
cdef init(self, C_AnnotationNode.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property targetsField:
|
property targetsField:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getTargetsField()
|
return self.thisptr.getTargetsField()
|
||||||
@@ -1279,6 +1327,7 @@ cdef class _EnumNode_EnumerantReader:
|
|||||||
cdef init(self, C_EnumNode.Enumerant.Reader other):
|
cdef init(self, C_EnumNode.Enumerant.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property codeOrder:
|
property codeOrder:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getCodeOrder()
|
return self.thisptr.getCodeOrder()
|
||||||
@@ -1294,6 +1343,7 @@ cdef class _EnumNode_EnumerantBuilder:
|
|||||||
cdef init(self, C_EnumNode.Enumerant.Builder other):
|
cdef init(self, C_EnumNode.Enumerant.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property codeOrder:
|
property codeOrder:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getCodeOrder()
|
return self.thisptr.getCodeOrder()
|
||||||
@@ -1314,6 +1364,7 @@ cdef class _EnumNodeReader:
|
|||||||
cdef init(self, C_EnumNode.Reader other):
|
cdef init(self, C_EnumNode.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property enumerants:
|
property enumerants:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _List_EnumNode_EnumNode_Enumerant_Reader().init(self.thisptr.getEnumerants())
|
return _List_EnumNode_EnumNode_Enumerant_Reader().init(self.thisptr.getEnumerants())
|
||||||
@@ -1323,6 +1374,7 @@ cdef class _EnumNodeBuilder:
|
|||||||
cdef init(self, C_EnumNode.Builder other):
|
cdef init(self, C_EnumNode.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property enumerants:
|
property enumerants:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _List_EnumNode_EnumNode_Enumerant_Builder().init(self.thisptr.getEnumerants())
|
return _List_EnumNode_EnumNode_Enumerant_Builder().init(self.thisptr.getEnumerants())
|
||||||
@@ -1335,6 +1387,7 @@ cdef class _StructNode_UnionReader:
|
|||||||
cdef init(self, C_StructNode.Union.Reader other):
|
cdef init(self, C_StructNode.Union.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property discriminantOffset:
|
property discriminantOffset:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getDiscriminantOffset()
|
return self.thisptr.getDiscriminantOffset()
|
||||||
@@ -1347,6 +1400,7 @@ cdef class _StructNode_UnionBuilder:
|
|||||||
cdef init(self, C_StructNode.Union.Builder other):
|
cdef init(self, C_StructNode.Union.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property discriminantOffset:
|
property discriminantOffset:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getDiscriminantOffset()
|
return self.thisptr.getDiscriminantOffset()
|
||||||
@@ -1359,11 +1413,15 @@ cdef class _StructNode_UnionBuilder:
|
|||||||
return _List_StructNode_Union_StructNode_Member_Builder().init(self.thisptr.initMembers(num))
|
return _List_StructNode_Union_StructNode_Member_Builder().init(self.thisptr.initMembers(num))
|
||||||
|
|
||||||
|
|
||||||
|
_StructNode_Member_Body_Which = make_enum('_StructNode_Member_Body_Which',fieldMember = <int>_StructNode_Member_Body_fieldMember,unionMember = <int>_StructNode_Member_Body_unionMember,)
|
||||||
cdef class _StructNode_Member_BodyReader:
|
cdef class _StructNode_Member_BodyReader:
|
||||||
cdef C_StructNode.Member.Body.Reader thisptr
|
cdef C_StructNode.Member.Body.Reader thisptr
|
||||||
cdef init(self, C_StructNode.Member.Body.Reader other):
|
cdef init(self, C_StructNode.Member.Body.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
cpdef int which(self):
|
||||||
|
return self.thisptr.which()
|
||||||
property fieldMember:
|
property fieldMember:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _StructNode_FieldReader().init(<C_StructNode.Field.Reader>self.thisptr.getFieldMember())
|
return _StructNode_FieldReader().init(<C_StructNode.Field.Reader>self.thisptr.getFieldMember())
|
||||||
@@ -1376,6 +1434,9 @@ cdef class _StructNode_Member_BodyBuilder:
|
|||||||
cdef init(self, C_StructNode.Member.Body.Builder other):
|
cdef init(self, C_StructNode.Member.Body.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
cpdef int which(self):
|
||||||
|
return self.thisptr.which()
|
||||||
property fieldMember:
|
property fieldMember:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _StructNode_FieldBuilder().init(<C_StructNode.Field.Builder>self.thisptr.getFieldMember())
|
return _StructNode_FieldBuilder().init(<C_StructNode.Field.Builder>self.thisptr.getFieldMember())
|
||||||
@@ -1391,6 +1452,7 @@ cdef class _StructNode_MemberReader:
|
|||||||
cdef init(self, C_StructNode.Member.Reader other):
|
cdef init(self, C_StructNode.Member.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property ordinal:
|
property ordinal:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getOrdinal()
|
return self.thisptr.getOrdinal()
|
||||||
@@ -1412,6 +1474,7 @@ cdef class _StructNode_MemberBuilder:
|
|||||||
cdef init(self, C_StructNode.Member.Builder other):
|
cdef init(self, C_StructNode.Member.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property ordinal:
|
property ordinal:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getOrdinal()
|
return self.thisptr.getOrdinal()
|
||||||
@@ -1443,6 +1506,7 @@ cdef class _StructNode_FieldReader:
|
|||||||
cdef init(self, C_StructNode.Field.Reader other):
|
cdef init(self, C_StructNode.Field.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property defaultValue:
|
property defaultValue:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _ValueReader().init(<C_Value.Reader>self.thisptr.getDefaultValue())
|
return _ValueReader().init(<C_Value.Reader>self.thisptr.getDefaultValue())
|
||||||
@@ -1458,6 +1522,7 @@ cdef class _StructNode_FieldBuilder:
|
|||||||
cdef init(self, C_StructNode.Field.Builder other):
|
cdef init(self, C_StructNode.Field.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property defaultValue:
|
property defaultValue:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _ValueBuilder().init(<C_Value.Builder>self.thisptr.getDefaultValue())
|
return _ValueBuilder().init(<C_Value.Builder>self.thisptr.getDefaultValue())
|
||||||
@@ -1478,6 +1543,7 @@ cdef class _StructNodeReader:
|
|||||||
cdef init(self, C_StructNode.Reader other):
|
cdef init(self, C_StructNode.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property dataSectionWordSize:
|
property dataSectionWordSize:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getDataSectionWordSize()
|
return self.thisptr.getDataSectionWordSize()
|
||||||
@@ -1493,6 +1559,7 @@ cdef class _StructNodeBuilder:
|
|||||||
cdef init(self, C_StructNode.Builder other):
|
cdef init(self, C_StructNode.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property dataSectionWordSize:
|
property dataSectionWordSize:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getDataSectionWordSize()
|
return self.thisptr.getDataSectionWordSize()
|
||||||
@@ -1514,6 +1581,7 @@ cdef class _AnnotationReader:
|
|||||||
cdef init(self, C_Annotation.Reader other):
|
cdef init(self, C_Annotation.Reader other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property id:
|
property id:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getId()
|
return self.thisptr.getId()
|
||||||
@@ -1526,6 +1594,7 @@ cdef class _AnnotationBuilder:
|
|||||||
cdef init(self, C_Annotation.Builder other):
|
cdef init(self, C_Annotation.Builder other):
|
||||||
self.thisptr = other
|
self.thisptr = other
|
||||||
return self
|
return self
|
||||||
|
|
||||||
property id:
|
property id:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.thisptr.getId()
|
return self.thisptr.getId()
|
||||||
|
|||||||
26
setup.py
26
setup.py
@@ -195,10 +195,21 @@ nodes = {
|
|||||||
primitive_types = set(('Bool','Int8','Int16','Int32','Int64','UInt8','UInt16','UInt32','UInt64','Float32','Float64'))
|
primitive_types = set(('Bool','Int8','Int16','Int32','Int64','UInt8','UInt16','UInt32','UInt64','Float32','Float64'))
|
||||||
built_in_types = set(('Bool','Int8','Int16','Int32','Int64','UInt8','UInt16','UInt32','UInt64','Float32','Float64', 'Text', 'Data', 'Void', 'Object'))
|
built_in_types = set(('Bool','Int8','Int16','Int32','Int64','UInt8','UInt16','UInt32','UInt64','Float32','Float64', 'Text', 'Data', 'Void', 'Object'))
|
||||||
list_types = {}
|
list_types = {}
|
||||||
|
enum_types = []
|
||||||
|
union_types = []
|
||||||
def capitalize(s):
|
def capitalize(s):
|
||||||
if len(s) < 2:
|
if len(s) < 2:
|
||||||
return s
|
return s
|
||||||
return s[0].upper() + s[1:]
|
return s[0].upper() + s[1:]
|
||||||
|
def upper_and_under(s):
|
||||||
|
if len(s) < 2:
|
||||||
|
return s
|
||||||
|
ret = [s[0]]
|
||||||
|
for letter in s[1:]:
|
||||||
|
if letter.isupper():
|
||||||
|
ret.append('_')
|
||||||
|
ret.append(letter)
|
||||||
|
return ''.join(ret).upper()
|
||||||
def fixNodes(n):
|
def fixNodes(n):
|
||||||
def fixNode(node_dict, full_name):
|
def fixNode(node_dict, full_name):
|
||||||
nested = {}
|
nested = {}
|
||||||
@@ -208,6 +219,10 @@ def fixNodes(n):
|
|||||||
member_dict['full_type'] = member_dict.get('type')
|
member_dict['full_type'] = member_dict.get('type')
|
||||||
if 'body' in member_dict:
|
if 'body' in member_dict:
|
||||||
nested[member] = fixNode(member_dict, full_name+'.'+capitalize(member))
|
nested[member] = fixNode(member_dict, full_name+'.'+capitalize(member))
|
||||||
|
if member_dict['body'] == 'enum':
|
||||||
|
enum_types.append(nested[member])
|
||||||
|
elif member_dict['body'] == 'union':
|
||||||
|
union_types.append(nested[member])
|
||||||
if 'is_not_field' in member_dict:
|
if 'is_not_field' in member_dict:
|
||||||
del node_dict['members'][member]
|
del node_dict['members'][member]
|
||||||
else:
|
else:
|
||||||
@@ -225,15 +240,20 @@ def fixNodes(n):
|
|||||||
node_dict['nestedNodes'] = nested
|
node_dict['nestedNodes'] = nested
|
||||||
return node_dict
|
return node_dict
|
||||||
for node, node_dict in n.items():
|
for node, node_dict in n.items():
|
||||||
fixNode(node_dict, capitalize(node))
|
res=fixNode(node_dict, capitalize(node))
|
||||||
|
if node_dict['body'] == 'enum':
|
||||||
|
enum_types.append(res)
|
||||||
|
elif node_dict['body'] == 'union':
|
||||||
|
union_types.append(res)
|
||||||
return n
|
return n
|
||||||
|
|
||||||
env.filters['capitalize'] = capitalize
|
env.filters['capitalize'] = capitalize
|
||||||
|
env.filters['upper_and_under'] = upper_and_under
|
||||||
nodes = fixNodes(nodes)
|
nodes = fixNodes(nodes)
|
||||||
tmpl = env.get_template('capnp.tmpl.pxd')
|
tmpl = env.get_template('capnp.tmpl.pxd')
|
||||||
open(os.path.join(curr_dir, 'capnp_schema.pxd'), 'w').write(tmpl.render(nodes=nodes, namespace='::capnp::schema', built_in_types=built_in_types))
|
open(os.path.join(curr_dir, 'capnp_schema.pxd'), 'w').write(tmpl.render(nodes=nodes, namespace='::capnp::schema', built_in_types=built_in_types, enum_types=enum_types, union_types=union_types))
|
||||||
tmpl = env.get_template('capnp.tmpl.pyx')
|
tmpl = env.get_template('capnp.tmpl.pyx')
|
||||||
open(os.path.join(curr_dir, 'schema.capnp.cpp.pyx'), 'w').write(tmpl.render(nodes=nodes, namespace='::capnp::schema', primitive_types=primitive_types, built_in_types=built_in_types, list_types=list_types))
|
open(os.path.join(curr_dir, 'schema.capnp.cpp.pyx'), 'w').write(tmpl.render(nodes=nodes, namespace='::capnp::schema', primitive_types=primitive_types, built_in_types=built_in_types, list_types=list_types, enum_types=enum_types, union_types=union_types))
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = "capnp",
|
name = "capnp",
|
||||||
|
|||||||
Reference in New Issue
Block a user