Ejemplo n.º 1
0
 def e(self, e):
     _ret_c = lib.cw__enum_usage_interface_e(self._cpp_impl,
                                             CPyEnum.fromPy(e))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyEnum.toPy(Color, _ret_c)
     assert _ret.value != -1
     return _ret
Ejemplo n.º 2
0
 def python_create_enum_usage_record(e, o, l, s, m):
     py_rec = EnumUsageRecord(
         CPyEnum.toPy(Color, e), CPyEnum.toPyOpt(Color, o),
         CPyObject.toPy(ListEnumColorHelper.c_data_set, l),
         CPyObjectProxy.toPyObj(SetEnumColorHelper.c_data_set, s),
         CPyObjectProxy.toPyObj(MapEnumColorEnumColorHelper.c_data_set, m))
     return CPyRecord.fromPy(EnumUsageRecord.c_data_set,
                             py_rec)  #to do: can be optional?
 def __get_value(cself, key):
     pyKey = CPyEnum.toPy(Color, key)
     assert pyKey is not None
     try:
         _ret = CPyEnum.fromPy(CPyObjectProxy.toPyObj(None, cself)[pyKey])
         assert _ret != -1
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Ejemplo n.º 4
0
 def __python_next(cself):
     try:
         _ret= CPyEnum.fromPy(next(CPyObjectProxy.toPyIter(cself)))
         assert _ret.value != -1
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Ejemplo n.º 5
0
 def __get_elem(cself, index):
     try:
         _ret = CPyEnum.fromPy(CPyObject.toPy(None, cself)[index])
         assert _ret != -1
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Ejemplo n.º 6
0
 def __python_next(cself):
     try:
         _ret = CPyEnum.fromPy(next(CPyObjectProxy.toPyIter(cself)))
         assert _ret != -1
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
 def get_all_datatypes_f15(cself):
     try:
         _ret = CPyEnum.fromPy(CPyRecord.toPy(None, cself).enum_data)
         assert _ret != -1
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Ejemplo n.º 8
0
 def get_enum_usage_record_f1(cself):
     try:
         _ret = CPyEnum.fromPy(CPyRecord.toPy(None, cself).e)
         assert _ret != -1
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
 def __get_value(cself, key):
     pyKey = CPyEnum.toPy(Color, key)
     assert pyKey is not None
     try:
         with CPyString.fromPy(CPyObjectProxy.toPyObj(None, cself)[pyKey]) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Ejemplo n.º 10
0
 def __get_value(cself, key):
     pyKey = CPyEnum.toPy(Color, key)
     assert pyKey is not None
     try:
         with CPyString.fromPy(CPyObjectProxy.toPyObj(None, cself)[pyKey]) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Ejemplo n.º 11
0
 def python_create_my_record(test, test1, test2, test3, test3_1, test4,
                             test4_1, test5, test6, test7, test8, test9,
                             test10, test10_1, test11, test13, test14,
                             test15, test16, test17):
     py_rec = MyRecord(
         CPyPrimitive.toPy(test), CPyBoxedU32.toPyOpt(test1),
         CPyObject.toPy(ListUint32THelper.c_data_set, test2),
         CPyString.toPy(test3), CPyString.toPyOpt(test3_1),
         CPyDate.toPy(test4), CPyBoxedDate.toPyOpt(test4_1),
         CPyBinary.toPy(test5),
         CPyObject.toPy(ListBinaryHelper.c_data_set, test6),
         CPyObjectProxy.toPyObj(SetInt32THelper.c_data_set, test7),
         CPyObjectProxy.toPyObj(MapInt32TStringHelper.c_data_set, test8),
         CPyRecord.toPy(Rc.c_data_set, test9),
         CPyRecord.toPyOpt(Rc.c_data_set, test10),
         CPyObject.toPy(ListRecordRcHelper.c_data_set, test10_1),
         CPyEnum.toPy(MyEnum, test11), CPyEnum.toPyOpt(MyEnum, test13),
         CPyBoxedI16.toPyOpt(test14),
         CPyObject.toPy(ListEnumMyEnumHelper.c_data_set, test15),
         CPyObjectProxy.toPyObj(SetEnumMyEnumHelper.c_data_set, test16),
         CPyObjectProxy.toPyObj(MapEnumMyEnumInt16THelper.c_data_set,
                                test17))
     return CPyRecord.fromPy(MyRecord.c_data_set,
                             py_rec)  #to do: can be optional?
 def create_all_datatypes(booleanData, integer8Data, integer16Data,
                          integer32Data, integer64Data, float32Data,
                          float64Data, stringData, binaryData, dateData,
                          listData, setData, mapData, optionalData,
                          enum_data):
     py_rec = AllDatatypes(
         CPyPrimitive.toPy(booleanData), CPyPrimitive.toPy(integer8Data),
         CPyPrimitive.toPy(integer16Data), CPyPrimitive.toPy(integer32Data),
         CPyPrimitive.toPy(integer64Data), CPyPrimitive.toPy(float32Data),
         CPyPrimitive.toPy(float64Data), CPyString.toPy(stringData),
         CPyBinary.toPy(binaryData), CPyDate.toPy(dateData),
         CPyObject.toPy(ListBoolHelper.c_data_set, listData),
         CPyObjectProxy.toPyObj(SetBoolHelper.c_data_set, setData),
         CPyObjectProxy.toPyObj(MapInt8TBoolHelper.c_data_set, mapData),
         CPyBoxedBool.toPyOpt(optionalData),
         CPyEnum.toPy(EnumData, enum_data))
     return CPyRecord.fromPy(AllDatatypes.c_data_set,
                             py_rec)  #to do: can be optional?
Ejemplo n.º 13
0
 def __python_add(cself, key, value):
     CPyObjectProxy.toPyObj(None, cself)[CPyEnum.toPy(Color, key)] = CPyString.toPy(value)
Ejemplo n.º 14
0
 def o(self, o):
     _ret_c = lib.cw__enum_usage_interface_o(self._cpp_impl,
                                             CPyEnum.fromPyOpt(o))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyEnum.toPyOpt(Color, _ret_c)
     return _ret
Ejemplo n.º 15
0
 def __python_add(cself, el):
     CPyObjectProxy.toPyObj(None, cself).add(CPyEnum.toPy(Color, el))
Ejemplo n.º 16
0
 def __python_add(cself, el):
     CPyObject.toPy(None, cself).append(CPyEnum.toPy(MyEnum, el))
Ejemplo n.º 17
0
 def say_hi(self):
     _ret_c = lib.cw__hello_say_hi(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyEnum.toPy(MyEnum, _ret_c)
     assert _ret.value != -1
     return _ret
Ejemplo n.º 18
0
 def get_enum_usage_record_f2(cself):
     try:
         return CPyEnum.fromPyOpt(CPyRecord.toPy(None, cself).o)
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Ejemplo n.º 19
0
 def get_enum(self):
     _ret_c = lib.cw__foo_enum_interface_get_enum(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyEnum.toPy(Color, _ret_c)
     assert _ret.value != -1
     return _ret
Ejemplo n.º 20
0
 def check_enum(c):
     lib.cw__test_helpers_check_enum(CPyEnum.fromPy(c))
     CPyException.toPyCheckAndRaise(ffi.NULL)
Ejemplo n.º 21
0
 def set_optional_enum(self, some_color):
     lib.cw__foo_enum_interface_set_optional_enum(self._cpp_impl, CPyEnum.fromPyOpt(some_color))
     CPyException.toPyCheckAndRaise(ffi.NULL)
Ejemplo n.º 22
0
 def python_create_rc(a, b, c, d, e):
     py_rec = Rc(CPyPrimitive.toPy(a), CPyPrimitive.toPy(b),
                 CPyBoxedI32.toPyOpt(c), CPyEnum.toPy(MyEnum, d),
                 CPyBinary.toPy(e))
     return CPyRecord.fromPy(Rc.c_data_set,
                             py_rec)  #to do: can be optional?
 def __python_add(cself, key, value):
     CPyObjectProxy.toPyObj(None, cself)[CPyEnum.toPy(Color, key)] = CPyEnum.toPy(Color, value)
Ejemplo n.º 24
0
 def set_optional_enum(self, some_color):
     lib.cw__foo_enum_interface_set_optional_enum(
         self._cpp_impl, CPyEnum.fromPyOpt(some_color))
     CPyException.toPyCheckAndRaise(ffi.NULL)
Ejemplo n.º 25
0
 def __python_add(cself, key, value):
     CPyObjectProxy.toPyObj(None, cself)[CPyEnum.toPy(
         MyEnum, key)] = CPyPrimitive.toPy(value)
Ejemplo n.º 26
0
 def get_optional_enum(self):
     _ret_c = lib.cw__foo_enum_interface_get_optional_enum(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyEnum.toPyOpt(Color, _ret_c)
     return _ret
Ejemplo n.º 27
0
 def get_my_record_f16(cself):
     try:
         return CPyEnum.fromPyOpt(CPyRecord.toPy(None, cself).test13)
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Ejemplo n.º 28
0
 def get_enum(self):
     _ret_c = lib.cw__foo_enum_interface_get_enum(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyEnum.toPy(Color, _ret_c)
     assert _ret.value != -1
     return _ret
Ejemplo n.º 29
0
 def sort(self, order, items):
     lib.cw__sort_items_sort(self._cpp_impl, CPyEnum.fromPy(order),
                             CPyRecord.fromPy(ItemList.c_data_set, items))
     CPyException.toPyCheckAndRaise(ffi.NULL)
Ejemplo n.º 30
0
 def check_enum(c):
     lib.cw__test_helpers_check_enum(CPyEnum.fromPy(c))
     CPyException.toPyCheckAndRaise(ffi.NULL)
Ejemplo n.º 31
0
 def sort(self, order, items):
     lib.cw__sort_items_sort(self._cpp_impl, CPyEnum.fromPy(order), CPyRecord.fromPy(ItemList.c_data_set, items))
     CPyException.toPyCheckAndRaise(ffi.NULL)
Ejemplo n.º 32
0
 def get_optional_enum(self):
     _ret_c = lib.cw__foo_enum_interface_get_optional_enum(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyEnum.toPyOpt(Color, _ret_c)
     return _ret