Example #1
0
        public static ReturnCode Take(
                DataReader reader, 
                ref object[] data, 
                ref SampleInfo[] sampleInfos, 
                int maxSamples,
                SampleStateKind sampleStates, 
                ViewStateKind viewStates, 
                InstanceStateKind instanceStates)
        {
            ReturnCode result = ReturnCode.Ok;
            using (DataReaderMarshaler marshaler = 
                    new DataReaderMarshaler(data, sampleInfos, ref maxSamples, ref result))
            {
                if (result == ReturnCode.Ok)
                {

                    result = Gapi.FooDataReader.take(
                            reader.GapiPeer,
                            marshaler.dataValuesPtr,
                            marshaler.sampleInfosPtr,
                            maxSamples,
                            sampleStates,
                            viewStates,
                            instanceStates);

                    marshaler.CopyOut(ref data, ref sampleInfos);
                }
            }
            return result;
        }
Example #2
0
 public static InstanceHandle LookupInstance(
         DataReader reader, 
         object instance)
 {
     GCHandle tmpGCHandleData = GCHandle.Alloc(instance, GCHandleType.Normal);
     InstanceHandle handle = Gapi.FooDataReader.lookup_instance(
             reader.GapiPeer,
             GCHandle.ToIntPtr(tmpGCHandleData));
     tmpGCHandleData.Free();
     return handle;
 }
Example #3
0
 public static ReturnCode GetKeyValue(
         DataReader reader, 
         ref object key, 
         InstanceHandle instanceHandle)
 {
     GCHandle tmpGCHandleData = GCHandle.Alloc(key, GCHandleType.Normal);
     ReturnCode result =  Gapi.FooDataReader.get_key_value(
             reader.GapiPeer,
             GCHandle.ToIntPtr(tmpGCHandleData),
             instanceHandle);
     tmpGCHandleData.Free();
     return result;
 }
Example #4
0
        public static bool IsLoan(
                DataReader reader, 
                ref object[] data, 
                ref SampleInfo[] sampleInfos)
        {
            GCHandle tmpGCHandleData = GCHandle.Alloc(data, GCHandleType.Normal);
            IntPtr dataValuesPtr = GCHandle.ToIntPtr(tmpGCHandleData);

            GCHandle tmpGCHandleInfo = GCHandle.Alloc(sampleInfos, GCHandleType.Normal);
            IntPtr sampleInfosPtr = GCHandle.ToIntPtr(tmpGCHandleInfo);

            byte result = Gapi.FooDataReader.is_loan(
                reader.GapiPeer,
                dataValuesPtr,
                sampleInfosPtr);

            tmpGCHandleData.Free();
            tmpGCHandleInfo.Free();

            return result != 0;
        }
Example #5
0
        public static ReturnCode ReadWithCondition(
                DataReader reader, 
                ref object[] data, 
                ref SampleInfo[] sampleInfos,
                int maxSamples, 
                IReadCondition condition)
        {
            ReturnCode result = ReturnCode.Ok;
            using (DataReaderMarshaler marshaler = 
                    new DataReaderMarshaler(data, sampleInfos, ref maxSamples, ref result))
            {
                if (result == ReturnCode.Ok)
                {

                    result = Gapi.FooDataReader.read_w_condition(
                            reader.GapiPeer,
                            marshaler.dataValuesPtr,
                            marshaler.sampleInfosPtr,
                            maxSamples,
                            ((ReadCondition)condition).GapiPeer);

                    marshaler.CopyOut(ref data, ref sampleInfos);
                }
            }
            return result;
        }
Example #6
0
        public static ReturnCode TakeNextSample(
                DataReader reader, 
                ref object data, 
                ref SampleInfo sampleInfo)
        {
            //ReturnCode result = Gapi.FooDataReader.take_next_sample(
            //    reader.GapiPeer,
            //    ref data,
            //    ref sampleInfo);

            return ReturnCode.Unsupported;
        }