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; }
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; }