Example #1
0
 def identifier_check(cself, data, r, jret):
     try:
         _ret = CPyPrimitive.fromPy(
             ClientInterfaceHelper.selfToPy(cself).identifier_check(
                 CPyBinary.toPy(data), CPyPrimitive.toPy(r),
                 CPyPrimitive.toPy(jret)))
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Example #2
0
 def python_create_my_record(id, info, store, hash):
     py_rec = MyRecord(
         CPyPrimitive.toPy(id), CPyString.toPy(info),
         CPyObjectProxy.toPyObj(SetStringHelper.c_data_set, store),
         CPyObjectProxy.toPyObj(MapStringInt32THelper.c_data_set, hash))
     return CPyRecord.fromPy(MyRecord.c_data_set,
                             py_rec)  #to do: can be optional?
Example #3
0
 def check_map_list_record(m):
     _ret_c = lib.cw__test_helpers_check_map_list_record(
         CPyRecord.fromPy(MapListRecord.c_data_set, m))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
 def method_changing_nothing(self):
     _ret_c = lib.cw__my_cpp_interface_method_changing_nothing(
         self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #5
0
 def check_nested_collection(nc):
     _ret_c = lib.cw__test_helpers_check_nested_collection(
         CPyRecord.fromPy(NestedCollection.c_data_set, nc))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #6
0
 def check_primitive_list(pl):
     _ret_c = lib.cw__test_helpers_check_primitive_list(
         CPyRecord.fromPy(PrimitiveList.c_data_set, pl))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #7
0
 def update_static_counter_to(init):
     _ret_c = lib.cw__foo_static_update_static_counter_to(
         CPyPrimitive.fromPy(init))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #8
0
 def int32_inverse(self, x):
     _ret_c = lib.cw__foo_interface_int32_inverse(self._cpp_impl,
                                                  CPyPrimitive.fromPy(x))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #9
0
 def python_create_foo_client_returned_record(record_id, content,
                                              some_record):
     py_rec = FooClientReturnedRecord(
         CPyPrimitive.toPy(record_id), CPyString.toPy(content),
         CPyRecord.toPy(FooSomeOtherRecord.c_data_set, some_record))
     return CPyRecord.fromPy(FooClientReturnedRecord.c_data_set,
                             py_rec)  #to do: can be optional?
 def python_create_foo_client_returned_record(record_id, content, some_record):
     py_rec = FooClientReturnedRecord(
         CPyPrimitive.toPy(record_id),
         CPyString.toPy(content),
         CPyRecord.toPy(FooSomeOtherRecord.c_data_set, some_record),
     )
     return CPyRecord.fromPy(FooClientReturnedRecord.c_data_set, py_rec)  # to do: can be optional?
Example #11
0
 def check_empty_map(m):
     _ret_c = lib.cw__test_helpers_check_empty_map(
         CPyObjectProxy.fromPy(MapStringInt64THelper.c_data_set,
                               MapStringInt64TProxy(m)))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #12
0
 def cause_changes_int_returned(self, i, f, s, binar, b, d):
     with CPyString.fromPy(s) as pys_s,\
             CPyBinary.fromPy(binar) as pybin_binar:
         _ret_c = lib.cw__foo_receiver_cause_changes_int_returned(self._cpp_impl, CPyPrimitive.fromPy(i), CPyPrimitive.fromPy(f), pys_s.release_djinni_string(), pybin_binar.release_djinni_binary(), CPyPrimitive.fromPy(b), CPyDate.fromPy(d))
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyPrimitive.toPy(_ret_c)
         assert _ret is not None
         return _ret
 def method_returning_some_type(self, key):
     with CPyString.fromPy(key) as pys_key:
         _ret_c = lib.cw__my_cpp_interface_method_returning_some_type(
             self._cpp_impl, pys_key.release_djinni_string())
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyPrimitive.toPy(_ret_c)
         assert _ret is not None
         return _ret
Example #14
0
 def __get_value(cself, key):
     pyKey = CPyPrimitive.toPy(key)
     assert pyKey is not None
     try:
         _ret = CPyPrimitive.fromPy(CPyObjectProxy.toPyObj(None, cself)[pyKey])
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Example #15
0
 def __get_value(cself, key):
     pyKey = CPyPrimitive.toPy(key)
     assert pyKey is not None
     try:
         _ret = CPyObject.fromPy(ListDateHelper.c_data_set, CPyObjectProxy.toPyObj(None, cself)[pyKey])
         assert _ret != ffi.NULL
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
 def __get_value(cself, key):
     pyKey = CPyPrimitive.toPy(key)
     assert pyKey is not None
     try:
         _ret = CPyPrimitive.fromPy(
             CPyObjectProxy.toPyObj(None, cself)[pyKey])
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Example #17
0
 def __get_value(cself, key):
     pyKey = CPyPrimitive.toPy(key)
     assert pyKey is not None
     try:
         _ret = CPyObject.fromPy(ListDateHelper.c_data_set,
                                 CPyObjectProxy.toPyObj(None, cself)[pyKey])
         assert _ret != ffi.NULL
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Example #18
0
 def get_record(cself, record_id, utf8string, misc):
     try:
         _ret = CPyRecord.fromPy(
             ClientReturnedRecord.c_data_set,
             ClientInterfaceHelper.selfToPy(cself).get_record(
                 CPyPrimitive.toPy(record_id), CPyString.toPy(utf8string),
                 CPyString.toPyOpt(misc)))
         assert _ret != ffi.NULL
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Example #19
0
 def cause_changes_int_returned(self, i, f, s, binar, b, d):
     with CPyString.fromPy(s) as pys_s,\
             CPyBinary.fromPy(binar) as pybin_binar:
         _ret_c = lib.cw__foo_receiver_cause_changes_int_returned(
             self._cpp_impl, CPyPrimitive.fromPy(i), CPyPrimitive.fromPy(f),
             pys_s.release_djinni_string(),
             pybin_binar.release_djinni_binary(), CPyPrimitive.fromPy(b),
             CPyDate.fromPy(d))
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyPrimitive.toPy(_ret_c)
         assert _ret is not None
         return _ret
 def __get_value(cself, key):
     pyKey = CPyPrimitive.toPy(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
 def python_create_record_with_derivings(eight,sixteen,thirtytwo,sixtyfour,fthirtytwo,fsixtyfour,d,s):
     py_rec = RecordWithDerivings(
         CPyPrimitive.toPy(eight),
         CPyPrimitive.toPy(sixteen),
         CPyPrimitive.toPy(thirtytwo),
         CPyPrimitive.toPy(sixtyfour),
         CPyPrimitive.toPy(fthirtytwo),
         CPyPrimitive.toPy(fsixtyfour),
         CPyDate.toPy(d),
         CPyString.toPy(s))
     return CPyRecord.fromPy(RecordWithDerivings.c_data_set, py_rec) #to do: can be optional?
Example #22
0
 def python_create_all_datatypes(booleanData, integer8Data, integer16Data,
                                 integer32Data, integer64Data, float32Data,
                                 float64Data, stringData, binaryData,
                                 dateData, listData, setData, mapData,
                                 optionalData):
     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))
     return CPyRecord.fromPy(AllDatatypes.c_data_set,
                             py_rec)  #to do: can be optional?
 def python_create_assorted_primitives(b,eight,sixteen,thirtytwo,sixtyfour,fthirtytwo,fsixtyfour,o_b,o_eight,o_sixteen,o_thirtytwo,o_sixtyfour,o_fthirtytwo,o_fsixtyfour):
     py_rec = AssortedPrimitives(
         CPyPrimitive.toPy(b),
         CPyPrimitive.toPy(eight),
         CPyPrimitive.toPy(sixteen),
         CPyPrimitive.toPy(thirtytwo),
         CPyPrimitive.toPy(sixtyfour),
         CPyPrimitive.toPy(fthirtytwo),
         CPyPrimitive.toPy(fsixtyfour),
         CPyBoxedBool.toPyOpt(o_b),
         CPyBoxedI8.toPyOpt(o_eight),
         CPyBoxedI16.toPyOpt(o_sixteen),
         CPyBoxedI32.toPyOpt(o_thirtytwo),
         CPyBoxedI64.toPyOpt(o_sixtyfour),
         CPyBoxedF32.toPyOpt(o_fthirtytwo),
         CPyBoxedF64.toPyOpt(o_fsixtyfour))
     return CPyRecord.fromPy(AssortedPrimitives.c_data_set, py_rec) #to do: can be optional?
Example #24
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 python_create_record_with_derivings(key1,key2):
     py_rec = RecordWithDerivings(
         CPyPrimitive.toPy(key1),
         CPyString.toPy(key2))
     return CPyRecord.fromPy(RecordWithDerivings.c_data_set, py_rec) #to do: can be optional?
Example #26
0
 def get_static_counter():
     _ret_c = lib.cw__foo_static_get_static_counter()
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #27
0
 def int32_inverse(self, x):
     _ret_c = lib.cw__foo_interface_int32_inverse(self._cpp_impl, CPyPrimitive.fromPy(x))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
 def python_create_foo_extensible_record(number1,string1):
     py_rec = FooExtensibleRecord(
         CPyPrimitive.toPy(number1),
         CPyString.toPy(string1))
     return CPyRecord.fromPy(FooExtensibleRecord.c_data_set, py_rec) #to do: can be optional?
Example #29
0
 def check_nested_collection(nc):
     _ret_c = lib.cw__test_helpers_check_nested_collection(CPyRecord.fromPy(NestedCollection.c_data_set, nc))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #30
0
 def check_map_list_record(m):
     _ret_c = lib.cw__test_helpers_check_map_list_record(CPyRecord.fromPy(MapListRecord.c_data_set, m))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #31
0
 def __python_add(cself, el):
     CPyObjectProxy.toPyObj(None, cself).add(CPyPrimitive.toPy(el))
Example #32
0
 def python_create_some_const_record(number1,number2):
     py_rec = SomeConstRecord(
         CPyPrimitive.toPy(number1),
         CPyPrimitive.toPy(number2))
     return CPyRecord.fromPy(SomeConstRecord.c_data_set, py_rec) #to do: can be optional?
Example #33
0
 def on_changes_int_returned(cself, i, f, s, binar, b, d):
     try:
         _ret = CPyPrimitive.fromPy(FooListenerHelper.selfToPy(cself).on_changes_int_returned(CPyPrimitive.toPy(i), CPyPrimitive.toPy(f), CPyString.toPy(s), CPyBinary.toPy(binar), CPyPrimitive.toPy(b), CPyDate.toPy(d)))
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
 def __add(cself, key, value):
     CPyObjectProxy.toPyObj(
         None, cself)[CPyPrimitive.toPy(key)] = CPyPrimitive.toPy(value)
Example #35
0
 def get_private_int32(self):
     _ret_c = lib.cw__foo_interface_get_private_int32(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #36
0
 def __python_add(cself, el):
     CPyObject.toPy(None, cself).append(CPyPrimitive.toPy(el))
Example #37
0
 def python_create_extended_record(foo):
     py_rec = ExtendedRecord(
         CPyPrimitive.toPy(foo))
     return CPyRecord.fromPy(ExtendedRecord.c_data_set, py_rec) #to do: can be optional?
Example #38
0
 def return_one(self):
     _ret_c = lib.cw__return_one_return_one(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
 def python_create_record_with_nested_derivings(key,rec):
     py_rec = RecordWithNestedDerivings(
         CPyPrimitive.toPy(key),
         CPyRecord.toPy(RecordWithDerivings.c_data_set, rec))
     return CPyRecord.fromPy(RecordWithNestedDerivings.c_data_set, py_rec) #to do: can be optional?
Example #40
0
 def check_primitive_list(pl):
     _ret_c = lib.cw__test_helpers_check_primitive_list(CPyRecord.fromPy(PrimitiveList.c_data_set, pl))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #41
0
 def get_extensible_record_number2(self):
     _ret_c = lib.cw__foo_client_interface_get_extensible_record_number2(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #42
0
 def check_empty_map(m):
     _ret_c = lib.cw__test_helpers_check_empty_map(CPyObjectProxy.fromPy(MapStringInt64THelper.c_data_set, MapStringInt64TProxy(m)))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #43
0
 def python_create_rc(a):
     py_rec = Rc(
         CPyPrimitive.toPy(a))
     return CPyRecord.fromPy(Rc.c_data_set, py_rec) #to do: can be optional?
Example #44
0
 def cpp_token_id(t):
     _ret_c = lib.cw__test_helpers_cpp_token_id(UserTokenHelper.fromPy(t))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #45
0
 def __python_add(cself, key, value):
     CPyObjectProxy.toPyObj(None, cself)[CPyString.toPy(key)] = CPyPrimitive.toPy(value)
Example #46
0
 def on_changes_record_returned(cself, n1, n2):
     try:
         _ret = CPyRecord.fromPy(FooSomeOtherRecord.c_data_set, FooListenerHelper.selfToPy(cself).on_changes_record_returned(CPyPrimitive.toPy(n1), CPyPrimitive.toPy(n2)))
         assert _ret != ffi.NULL
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
 def python_create_foo_some_other_record(number1,number2):
     py_rec = FooSomeOtherRecord(
         CPyPrimitive.toPy(number1),
         CPyPrimitive.toPy(number2))
     return CPyRecord.fromPy(FooSomeOtherRecord.c_data_set, py_rec) #to do: can be optional?
Example #48
0
 def __python_add(cself, key, value):
     CPyObjectProxy.toPyObj(
         None, cself)[CPyPrimitive.toPy(key)] = CPyObjectProxy.toPyObj(
             SetStringHelper.c_data_set, value)
Example #49
0
 def on_changes_int_optional_returned(cself, i, f, s, binar, b, d):
     try:
         with CPyBoxedI32.fromPyOpt(FooListenerHelper.selfToPy(cself).on_changes_int_optional_returned(CPyBoxedI32.toPyOpt(i), CPyPrimitive.toPy(f), CPyString.toPyOpt(s), CPyBinary.toPy(binar), CPyPrimitive.toPy(b), CPyDate.toPy(d))) as py_obj:
             return py_obj.release_djinni_boxed()
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Example #50
0
 def get_bool(self):
     _ret_c = lib.cw__foo_primitives_get_bool(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #51
0
 def on_changes_binary_returned(cself, i, f, s, binar, b, d):
     try:
         with CPyBinary.fromPy(FooListenerHelper.selfToPy(cself).on_changes_binary_returned(CPyPrimitive.toPy(i), CPyPrimitive.toPy(f), CPyString.toPy(s), CPyBinary.toPy(binar), CPyPrimitive.toPy(b), CPyDate.toPy(d))) as py_obj:
             _ret = py_obj.release_djinni_binary()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
Example #52
0
 def python_create_foo_constants(some_integer,some_string):
     py_rec = FooConstants(
         CPyPrimitive.toPy(some_integer),
         CPyString.toPy(some_string))
     return CPyRecord.fromPy(FooConstants.c_data_set, py_rec) #to do: can be optional?
Example #53
0
 def return_two(self):
     _ret_c = lib.cw__return_two_return_two(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
Example #54
0
 def get_private_int32(self):
     _ret_c = lib.cw__foo_interface_get_private_int32(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyPrimitive.toPy(_ret_c)
     assert _ret is not None
     return _ret
 def python_create_client_returned_record(record_id,content,misc):
     py_rec = ClientReturnedRecord(
         CPyPrimitive.toPy(record_id),
         CPyString.toPy(content),
         CPyString.toPyOpt(misc))
     return CPyRecord.fromPy(ClientReturnedRecord.c_data_set, py_rec) #to do: can be optional?