Пример #1
0
        public void RemoveContinuousQueryListener <CQK, CQV>(Event.ContinuousQueryListener <CQK, CQV> cql)
        {
            stopAndRemoveTask(cql.clientEventListener.listenerId);
            VectorByte vc = new VectorByte(cql.clientEventListener.listenerId);

            cache.removeClientListener(vc);
        }
Пример #2
0
 public VectorByte(VectorByte other) : this(PapillonPINVOKE.new_VectorByte__SWIG_1(VectorByte.getCPtr(other)), true)
 {
     if (PapillonPINVOKE.SWIGPendingException.Pending)
     {
         throw PapillonPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #3
0
        public void RemoveClientListener(ClientListener <K, V> cl)
        {
            stopAndRemoveTask(cl.listenerId);
            VectorByte vb = new VectorByte(cl.listenerId);

            cache.removeClientListener(vb);
        }
Пример #4
0
 public PByteArray(VectorByte array) : this(PapillonPINVOKE.new_PByteArray__SWIG_3(VectorByte.getCPtr(array)), true)
 {
     if (PapillonPINVOKE.SWIGPendingException.Pending)
     {
         throw PapillonPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #5
0
 public VectorByteEnumerator(VectorByte collection)
 {
     collectionRef = collection;
     currentIndex  = -1;
     currentObject = null;
     currentSize   = collectionRef.Count;
 }
Пример #6
0
 public void SetRange(int index, VectorByte values)
 {
     PapillonPINVOKE.VectorByte_SetRange(swigCPtr, index, VectorByte.getCPtr(values));
     if (PapillonPINVOKE.SWIGPendingException.Pending)
     {
         throw PapillonPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #7
0
        byte[] toByteArray(VectorByte v)
        {
            byte[] bytes = new byte[v.Count];
            int    i     = 0;

            foreach (byte b in v)
            {
                bytes[i++] = b;
            }
            return(bytes);
        }
Пример #8
0
    public static VectorByte Repeat(byte value, int count)
    {
        global::System.IntPtr cPtr = PapillonPINVOKE.VectorByte_Repeat(value, count);
        VectorByte            ret  = (cPtr == global::System.IntPtr.Zero) ? null : new VectorByte(cPtr, true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Пример #9
0
    public VectorByte GetRange(int index, int count)
    {
        global::System.IntPtr cPtr = PapillonPINVOKE.VectorByte_GetRange(swigCPtr, index, count);
        VectorByte            ret  = (cPtr == global::System.IntPtr.Zero) ? null : new VectorByte(cPtr, true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Пример #10
0
        public object Execute(string scriptName, IDictionary <string, Object> dict = null)
        {
            VectorMap vm = new VectorMap();

            if (dict != null)
            {
                foreach (KeyValuePair <string, Object> p in dict)
                {
                    VectorChar vcKey   = toVectorChar(p.Key);
                    VectorChar vcValue = toVectorChar(argMarshaller.ObjectToByteBuffer(p.Value));
                    vm.Add(vcKey, vcValue);
                }
            }
            VectorByte vb = cache.execute(scriptName, vm);

            byte[] ret = new byte[vb.Count];
            vb.CopyTo(ret);
            return(argMarshaller.ObjectFromByteBuffer(ret));
        }
Пример #11
0
        public QueryResponse Query(QueryRequest qr)
        {
            uint size = (uint)qr.CalculateSize();

            byte[]            bytes = new byte[size];
            CodedOutputStream cos   = new CodedOutputStream(bytes);

            qr.WriteTo(cos);
            cos.Flush();
            string     s2   = System.Text.Encoding.ASCII.GetString(bytes);
            VectorByte vb   = new VectorByte(bytes);
            VectorByte resp = cache.query(vb, size);

            byte[] respBytes = new byte[resp.Count];
            resp.CopyTo(respBytes);
            QueryResponse queryResp = new QueryResponse();

            return(QueryResponse.Parser.ParseFrom(respBytes));
        }
Пример #12
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VectorByte obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }