Esempio n. 1
0
        public unsafe ResultSet ScanDoc(string idxName, string skey, string ekey, ScanFilter sf, DataVar dv)
        {
            ScanFilterStruct sfs   = sf.sfs;
            long *           sfptr = (long *)&sfs;
            int sklen = (skey != null) ? skey.Length : 0;
            int eklen = (ekey != null) ? ekey.Length : 0;

            IntPtr pBuf   = dv.bufferPointer;
            int    buflen = dv.bufferLength;
            int    dlen   = dv.dataLength;
            int    dofft  = dv.dataOffset;
            int    eflag  = (int)dv.opsFlag;

            IntPtr rsptr = BangDBNative.Scan_Doc_Idx_DV(_wconnection, idxName, skey, sklen, ekey, eklen, (IntPtr)sfptr, pBuf, buflen, ref dlen, dofft, ref eflag);

            dv.opsFlag       = (BangDBDataOpsFlag)eflag;
            dv.bufferPointer = pBuf;
            dv.dataLength    = dlen;

            if (rsptr == IntPtr.Zero)
            {
                return(null);
            }
            sf.skeyOp     = sfs.skeyOp;
            sf.ekeyOp     = sfs.ekeyOp;
            sf.skip_count = sfs.skip_count;
            return(new ResultSet(rsptr));
        }
Esempio n. 2
0
        public unsafe ResultSet Scan(byte[] skey, byte[] ekey, Transaction txn, ScanFilter sf, DataVar dv)
        {
            ScanFilterStruct sfs   = sf.sfs;
            long *           sfptr = (long *)&sfs;

            IntPtr pBuf   = dv.bufferPointer;
            int    buflen = dv.bufferLength;
            int    dlen   = dv.dataLength;
            int    dofft  = dv.dataOffset;
            int    eflag  = (int)dv.opsFlag;

            IntPtr rsptr = BangDBNative.Scan_DV_TranW(_wconnection, skey, skey.Length, ekey, ekey.Length, txn.GetTranPtr(), (IntPtr)sfptr, pBuf, buflen, ref dlen, dofft, ref eflag);

            dv.opsFlag       = (BangDBDataOpsFlag)eflag;
            dv.bufferPointer = pBuf;
            dv.dataLength    = dlen;

            if (rsptr == IntPtr.Zero)
            {
                return(null);
            }
            sf.skeyOp     = sfs.skeyOp;
            sf.ekeyOp     = sfs.ekeyOp;
            sf.skip_count = sfs.skip_count;
            return(new ResultSet(rsptr));
        }
Esempio n. 3
0
 public void Clone(ScanFilterStruct sf)
 {
     skeyOp     = sf.skeyOp;
     ekeyOp     = sf.ekeyOp;
     limitBy    = sf.limitBy;
     limit      = sf.limit;
     skip_count = sf.skip_count;
 }
Esempio n. 4
0
        public unsafe long Count(long skey, long ekey, ScanFilter sf)
        {
            ScanFilterStruct sfs   = sf.sfs;
            long *           sfptr = (long *)&sfs;
            long             rc    = BangDBNative.Count_LongW(_wconnection, skey, ekey, (IntPtr)sfptr);

            sf.skeyOp     = sfs.skeyOp;
            sf.ekeyOp     = sfs.ekeyOp;
            sf.skip_count = sfs.skip_count;
            return(rc);
        }
Esempio n. 5
0
        public unsafe long Count(int sk, int ek, ScanFilter sf)
        {
            ScanFilterStruct sfs   = sf.sfs;
            long *           sfptr = (long *)&sfs;
            long             rc    = BangDBNative.Count_LONG(_connection, sk, ek, (IntPtr)sfptr);

            sf.skeyOp     = sfs.skeyOp;
            sf.ekeyOp     = sfs.ekeyOp;
            sf.skip_count = sfs.skip_count;
            return(rc);
        }
Esempio n. 6
0
        public unsafe long Count(byte[] skey, byte[] ekey, ScanFilter sf)
        {
            ScanFilterStruct sfs   = sf.sfs;
            long *           sfptr = (long *)&sfs;
            int  sklen             = (skey != null) ? skey.Length : 0;
            int  eklen             = (ekey != null) ? ekey.Length : 0;
            long rc = BangDBNative.CountW(_wconnection, skey, sklen, ekey, eklen, (IntPtr)sfptr);

            sf.skeyOp     = sfs.skeyOp;
            sf.ekeyOp     = sfs.ekeyOp;
            sf.skip_count = sfs.skip_count;
            return(rc);
        }
Esempio n. 7
0
        public unsafe ResultSet Scan(long skey, long ekey, Transaction txn, ScanFilter sf)
        {
            ScanFilterStruct sfs   = sf.sfs;
            long *           sfptr = (long *)&sfs;
            IntPtr           rsptr = BangDBNative.Scan_Long_TranW(_wconnection, skey, ekey, txn.GetTranPtr(), (IntPtr)sfptr);

            if (rsptr == IntPtr.Zero)
            {
                return(null);
            }
            sf.skeyOp     = sfs.skeyOp;
            sf.ekeyOp     = sfs.ekeyOp;
            sf.skip_count = sfs.skip_count;
            return(new ResultSet(rsptr));
        }
Esempio n. 8
0
        public unsafe ResultSet ScanDoc(string idxName, long skey, long ekey, ScanFilter sf)
        {
            ScanFilterStruct sfs   = sf.sfs;
            long *           sfptr = (long *)&sfs;
            IntPtr           rsptr = BangDBNative.Scan_Doc_Idx_Long(_wconnection, idxName, skey, ekey, (IntPtr)sfptr);

            if (rsptr == IntPtr.Zero)
            {
                return(null);
            }
            sf.skeyOp     = sfs.skeyOp;
            sf.ekeyOp     = sfs.ekeyOp;
            sf.skip_count = sfs.skip_count;
            return(new ResultSet(rsptr));
        }
Esempio n. 9
0
        public unsafe ResultSet Scan(int skey, int ekey, ScanFilter sf)
        {
            ScanFilterStruct sfs   = sf.sfs;
            long *           sfptr = (long *)&sfs;
            IntPtr           rsptr = BangDBNative.ScanPrim_Long(_connection, (long)skey, (long)ekey, (IntPtr)sfptr);

            if (rsptr == IntPtr.Zero)
            {
                return(null);
            }
            sf.skeyOp     = sfs.skeyOp;
            sf.ekeyOp     = sfs.ekeyOp;
            sf.skip_count = sfs.skip_count;
            return(new ResultSet(rsptr));
        }
Esempio n. 10
0
        public unsafe ResultSet ScanDoc(string idxName, byte[] skey, byte[] ekey, ScanFilter sf)
        {
            ScanFilterStruct sfs   = sf.sfs;
            long *           sfptr = (long *)&sfs;
            int    sklen           = (skey != null) ? skey.Length : 0;
            int    eklen           = (ekey != null) ? ekey.Length : 0;
            IntPtr rsptr           = BangDBNative.Scan_Doc_Idx(_wconnection, idxName, skey, sklen, ekey, eklen, (IntPtr)sfptr);

            if (rsptr == IntPtr.Zero)
            {
                return(null);
            }
            sf.skeyOp     = sfs.skeyOp;
            sf.ekeyOp     = sfs.ekeyOp;
            sf.skip_count = sfs.skip_count;
            return(new ResultSet(rsptr));
        }
Esempio n. 11
0
        public unsafe ResultSet Scan(string skey, string ekey, Transaction txn, ScanFilter sf)
        {
            ScanFilterStruct sfs   = sf.sfs;
            long *           sfptr = (long *)&sfs;
            int    sklen           = (skey != null) ? skey.Length : 0;
            int    eklen           = (ekey != null) ? ekey.Length : 0;
            IntPtr rsptr           = BangDBNative.Scan_Tran(_connection, skey, sklen, ekey, eklen, txn.GetTranPtr(), (IntPtr)sfptr);

            if (rsptr == IntPtr.Zero)
            {
                return(null);
            }
            sf.skeyOp     = sfs.skeyOp;
            sf.ekeyOp     = sfs.ekeyOp;
            sf.skip_count = sfs.skip_count;
            return(new ResultSet(rsptr));
        }