• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef DATAABILITY_I_SHARED_RESULT_SET_H
17 #define DATAABILITY_I_SHARED_RESULT_SET_H
18 #include <memory>
19 #include "iremote_broker.h"
20 #include "abs_shared_result_set.h"
21 namespace OHOS::NativeRdb {
22 class ISharedResultSet : public AbsSharedResultSet, public IRemoteBroker {
23 public:
24     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NativeRdb.ISharedResultSet")
25     static std::shared_ptr<AbsSharedResultSet> ReadFromParcel(MessageParcel &parcel);
26     static sptr<ISharedResultSet> WriteToParcel(std::shared_ptr<AbsSharedResultSet> resultSet, MessageParcel &parcel);
27 
28 protected:
29     enum {
30         FUNC_GET_ROW_COUNT,
31         FUNC_GET_ALL_COLUMN_NAMES,
32         FUNC_ON_GO,
33         FUNC_CLOSE,
34         FUNC_GET_BLOB,
35         FUNC_GET_STRING,
36         FUNC_GET_INT,
37         FUNC_GET_LONG,
38         FUNC_GET_DOUBLE,
39         FUNC_IS_COLUMN_NULL,
40         FUNC_GO_TO,
41         FUNC_GO_TO_ROW,
42         FUNC_GO_TO_FISTR_ROW,
43         FUNC_GO_TO_LAST_ROW,
44         FUNC_GO_TO_NEXT_ROW,
45         FUNC_GO_TO_PREV_ROW,
46         FUNC_IS_AT_FIRST_ROW,
47         FUNC_IS_AT_LAST_ROW,
48         FUNC_IS_STARTED_ROW,
49         FUNC_IS_ENDED_ROW,
50         FUNC_IS_CLOSED,
51         FUNC_GET_COLUMN_COUNT,
52         FUNC_GET_COLUMN_INDEX,
53         FUNC_GET_COLUMN_NAME,
54         FUNC_GET_COLUMN_TYPE,
55         FUNC_GET_ROW_INDEX,
56         FUNC_BUTT
57     };
58 private:
59     static std::function<std::shared_ptr<AbsSharedResultSet>(MessageParcel &parcel)> consumerCreator_;
60     static std::function<sptr<ISharedResultSet>(std::shared_ptr<AbsSharedResultSet>, MessageParcel &)> providerCreator_;
61 };
62 }
63 
64 #endif // DATAABILITY_I_SHARED_RESULT_SET_H
65