1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2018 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Worker/** 20*4d7e907cSAndroid Build Coastguard Worker * A connection to a buffer pool which handles requests from a buffer pool 21*4d7e907cSAndroid Build Coastguard Worker * client. The connection must be made in order to receive buffers from 22*4d7e907cSAndroid Build Coastguard Worker * other buffer pool clients. 23*4d7e907cSAndroid Build Coastguard Worker */ 24*4d7e907cSAndroid Build Coastguard Workerinterface IConnection { 25*4d7e907cSAndroid Build Coastguard Worker 26*4d7e907cSAndroid Build Coastguard Worker /** 27*4d7e907cSAndroid Build Coastguard Worker * Retrieves a buffer using bufferId. The method must be called from 28*4d7e907cSAndroid Build Coastguard Worker * receiving side of buffer during transferring only when the specified 29*4d7e907cSAndroid Build Coastguard Worker * buffer is neither cached nor used. This fails if the specified 30*4d7e907cSAndroid Build Coastguard Worker * transaction is not valid. 31*4d7e907cSAndroid Build Coastguard Worker * 32*4d7e907cSAndroid Build Coastguard Worker * @param transactionId Unique transaction id for buffer transferring. 33*4d7e907cSAndroid Build Coastguard Worker * @param bufferId Id of the buffer to be fetched. 34*4d7e907cSAndroid Build Coastguard Worker * @return status The status of the call. 35*4d7e907cSAndroid Build Coastguard Worker * OK - A buffer was fetched successfully. 36*4d7e907cSAndroid Build Coastguard Worker * NO_MEMORY - Memory allocation failure occurred. 37*4d7e907cSAndroid Build Coastguard Worker * NOT_FOUND - A buffer was not found due to invalidation. 38*4d7e907cSAndroid Build Coastguard Worker * CRITICAL_ERROR - Other errors. 39*4d7e907cSAndroid Build Coastguard Worker * @return buffer The actual buffer which is specified with bufferId. 40*4d7e907cSAndroid Build Coastguard Worker */ 41*4d7e907cSAndroid Build Coastguard Worker fetch(uint64_t transactionId, uint32_t bufferId) generates 42*4d7e907cSAndroid Build Coastguard Worker (ResultStatus status, Buffer buffer); 43*4d7e907cSAndroid Build Coastguard Worker}; 44