コード例 #1
0
        static int _m_ToDecimal128(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                MongoDB.Bson.BsonDecimal128 gen_to_be_invoked = (MongoDB.Bson.BsonDecimal128)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    
                        MongoDB.Bson.Decimal128 gen_ret = gen_to_be_invoked.ToDecimal128(  );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        static int _m_Deserialize(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.Serialization.Serializers.Decimal128Serializer gen_to_be_invoked = (MongoDB.Bson.Serialization.Serializers.Decimal128Serializer)translator.FastGetCSObj(L, 1);



                {
                    MongoDB.Bson.Serialization.BsonDeserializationContext _context = (MongoDB.Bson.Serialization.BsonDeserializationContext)translator.GetObject(L, 2, typeof(MongoDB.Bson.Serialization.BsonDeserializationContext));
                    MongoDB.Bson.Serialization.BsonDeserializationArgs    _args; translator.Get(L, 3, out _args);

                    MongoDB.Bson.Decimal128 gen_ret = gen_to_be_invoked.Deserialize(_context, _args);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #3
0
        static int _m_Parse_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    string _s = LuaAPI.lua_tostring(L, 1);

                    MongoDB.Bson.Decimal128 gen_ret = MongoDB.Bson.Decimal128.Parse(_s);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #4
0
        static int _m_Negate_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    MongoDB.Bson.Decimal128 _x; translator.Get(L, 1, out _x);

                    MongoDB.Bson.Decimal128 gen_ret = MongoDB.Bson.Decimal128.Negate(_x);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #5
0
        static int _m_ReadDecimal128_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    MongoDB.Bson.IO.IBsonReader _reader = (MongoDB.Bson.IO.IBsonReader)translator.GetObject(L, 1, typeof(MongoDB.Bson.IO.IBsonReader));
                    string _name = LuaAPI.lua_tostring(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = MongoDB.Bson.IO.IBsonReaderExtensions.ReadDecimal128(_reader, _name);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #6
0
        static int _m_FromIEEEBits_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    ulong _highBits = LuaAPI.lua_touint64(L, 1);
                    ulong _lowBits  = LuaAPI.lua_touint64(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = MongoDB.Bson.Decimal128.FromIEEEBits(_highBits, _lowBits);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #7
0
        static int _m_FromComponents_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    bool  _isNegative          = LuaAPI.lua_toboolean(L, 1);
                    short _exponent            = (short)LuaAPI.xlua_tointeger(L, 2);
                    ulong _significandHighBits = LuaAPI.lua_touint64(L, 3);
                    ulong _significandLowBits  = LuaAPI.lua_touint64(L, 4);

                    MongoDB.Bson.Decimal128 gen_ret = MongoDB.Bson.Decimal128.FromComponents(_isNegative, _exponent, _significandHighBits, _significandLowBits);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #8
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || translator.IsDecimal(L, 2)))
                {
                    decimal _value; translator.Get(L, 2, out _value);

                    MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    double _value = LuaAPI.lua_tonumber(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    float _value = (float)LuaAPI.lua_tonumber(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int _value = LuaAPI.xlua_tointeger(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2)))
                {
                    long _value = LuaAPI.lua_toint64(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    uint _value = LuaAPI.xlua_touint(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isuint64(L, 2)))
                {
                    ulong _value = LuaAPI.lua_touint64(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = new MongoDB.Bson.Decimal128(_value);
                    translator.Push(L, gen_ret);

                    return(1);
                }

                if (LuaAPI.lua_gettop(L) == 1)
                {
                    translator.Push(L, default(MongoDB.Bson.Decimal128));
                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.Decimal128 constructor!"));
        }
        static int _m_ToDecimal128(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.Serialization.Options.RepresentationConverter gen_to_be_invoked = (MongoDB.Bson.Serialization.Options.RepresentationConverter)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    double _value = LuaAPI.lua_tonumber(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = gen_to_be_invoked.ToDecimal128(_value);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int _value = LuaAPI.xlua_tointeger(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = gen_to_be_invoked.ToDecimal128(_value);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isint64(L, 2)))
                {
                    long _value = LuaAPI.lua_toint64(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = gen_to_be_invoked.ToDecimal128(_value);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || LuaAPI.lua_isuint64(L, 2)))
                {
                    ulong _value = LuaAPI.lua_touint64(L, 2);

                    MongoDB.Bson.Decimal128 gen_ret = gen_to_be_invoked.ToDecimal128(_value);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) || translator.IsDecimal(L, 2)))
                {
                    decimal _value; translator.Get(L, 2, out _value);

                    MongoDB.Bson.Decimal128 gen_ret = gen_to_be_invoked.ToDecimal128(_value);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.Serialization.Options.RepresentationConverter.ToDecimal128!"));
        }