private int IsDuplicate(ref ValueStructure left, ref ValueStructure right)
 {
     return(_duplicatesComparer.Compare(left.GetBytes(), right.GetBytes()));
 }
Exemple #2
0
 int INativeLibraryFacade.mdb_del(IntPtr txn, uint dbi, ref ValueStructure key, ref ValueStructure data)
 {
     return(Native64BitLibraryFacade.mdb_del(txn, dbi, ref key, ref data));
 }
 private static extern int mdb_put(IntPtr txn, UInt32 dbi, ref ValueStructure key, ref ValueStructure data, PutOptions flags);
 private static extern int mdb_cursor_get(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, CursorOperation op);
 int INativeLibraryFacade.mdb_del(IntPtr txn, uint dbi, ref ValueStructure key, IntPtr data)
 {
     return FallbackLibraryFacade.mdb_del(txn, dbi, ref key, data);
 }
 int INativeLibraryFacade.mdb_cursor_put(IntPtr cursor, ValueStructure key, ValueStructure data, PutOptions flags)
 {
     return FallbackLibraryFacade.mdb_cursor_put(cursor, key, data, flags);
 }
Exemple #7
0
 private static extern int mdb_del(IntPtr txn, UInt32 dbi, ref ValueStructure key, ref ValueStructure data);
 int INativeLibraryFacade.mdb_get(IntPtr txn, uint dbi, ref ValueStructure key, out ValueStructure data)
 {
     return FallbackLibraryFacade.mdb_get(txn, dbi, ref key, out data);
 }
Exemple #9
0
 int INativeLibraryFacade.mdb_cursor_get(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, CursorOperation op)
 {
     return(FallbackLibraryFacade.mdb_cursor_get(cursor, ref key, ref data, op));
 }
Exemple #10
0
 int INativeLibraryFacade.mdb_cursor_put(IntPtr cursor, ValueStructure key, ValueStructure data, PutOptions flags)
 {
     return(FallbackLibraryFacade.mdb_cursor_put(cursor, key, data, flags));
 }
Exemple #11
0
 int INativeLibraryFacade.mdb_del(IntPtr txn, uint dbi, ref ValueStructure key, IntPtr data)
 {
     return(FallbackLibraryFacade.mdb_del(txn, dbi, ref key, data));
 }
Exemple #12
0
 int INativeLibraryFacade.mdb_put(IntPtr txn, uint dbi, ref ValueStructure key, ref ValueStructure data, PutOptions flags)
 {
     return(FallbackLibraryFacade.mdb_put(txn, dbi, ref key, ref data, flags));
 }
Exemple #13
0
 int INativeLibraryFacade.mdb_get(IntPtr txn, uint dbi, ref ValueStructure key, out ValueStructure data)
 {
     return(FallbackLibraryFacade.mdb_get(txn, dbi, ref key, out data));
 }
 int INativeLibraryFacade.mdb_del(IntPtr txn, uint dbi, ref ValueStructure key, ref ValueStructure data)
 {
     return Native64BitLibraryFacade.mdb_del(txn, dbi, ref key, ref data);
 }
Exemple #15
0
 public static extern int mdb_get(IntPtr txn, UInt32 dbi, ref ValueStructure key, out ValueStructure data); //OK
 private static extern int mdb_cursor_put(IntPtr cursor, ValueStructure key, ValueStructure data, PutOptions flags);
Exemple #17
0
 public static extern int mdb_put(IntPtr txn, UInt32 dbi, ref ValueStructure key, ref ValueStructure data, PutOptions flags); //OK
 int INativeLibraryFacade.mdb_put(IntPtr txn, uint dbi, ref ValueStructure key, ref ValueStructure data, PutOptions flags)
 {
     return FallbackLibraryFacade.mdb_put(txn, dbi, ref key, ref data, flags);
 }
Exemple #19
0
 public static extern int mdb_del(IntPtr txn, UInt32 dbi, ref ValueStructure key, IntPtr data);
 int INativeLibraryFacade.mdb_cursor_get(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, CursorOperation op)
 {
     return FallbackLibraryFacade.mdb_cursor_get(cursor, ref key, ref data, op);
 }
Exemple #21
0
 public static extern int mdb_cursor_get(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, CursorOperation op);
 private static extern int mdb_get(IntPtr txn, UInt32 dbi, ref ValueStructure key, out ValueStructure data);
Exemple #23
0
 public static extern int mdb_cursor_put(IntPtr cursor, ValueStructure key, ValueStructure data, PutOptions flags); //OK
 private static extern int mdb_del(IntPtr txn, UInt32 dbi, ref ValueStructure key, IntPtr data);
Exemple #25
0
 public static extern int mdb_del(IntPtr txn, UInt32 dbi, ref ValueStructure key, ref ValueStructure data);
 private int Compare(ref ValueStructure left, ref ValueStructure right)
 {
     return(_comparer.Compare(left.GetBytes(), right.GetBytes()));
 }
 private bool Get(CursorOperation operation, byte[] key)
 {
     _currentValueStructure = default(ValueStructure);
     return(mdb_cursor_get(_handle, key, out _currentKeyStructure, out _currentValueStructure, operation) == 0);
 }
        //TODO: tests
        private KeyValuePair<byte[], byte[]> Get(CursorOperation operation, ValueStructure? key = null, ValueStructure? value = null)
        {
            var keyStruct = key.GetValueOrDefault();
            var valueStruct = value.GetValueOrDefault();

            var res = Native.Read(lib => lib.mdb_cursor_get(_handle, ref keyStruct, ref valueStruct, operation));

            return new KeyValuePair<byte[], byte[]>(keyStruct.ToByteArray(res), valueStruct.ToByteArray(res));
        }
 int INativeLibraryFacade.mdb_cursor_put(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, PutOptions flags)
 {
     return Native64BitLibraryFacade.mdb_cursor_put(cursor, ref key, ref data, flags);
 }