• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024-2025 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 OHOS_DSCHED_COLLAB_STATE_H
17 #define OHOS_DSCHED_COLLAB_STATE_H
18 
19 #include "event_handler.h"
20 
21 namespace OHOS {
22 namespace DistributedSchedule {
23 typedef enum {
24     SOURCE_GET_PEER_VERSION_STATE = 0,
25     SOURCE_START_STATE,
26     SOURCE_WAIT_RESULT_STATE,
27     SOURCE_WAIT_END_STATE,
28     SINK_GET_VERSION_STATE,
29     SINK_START_STATE,
30     SINK_CONNECT_STATE,
31     SINK_WAIT_END_STATE,
32 } CollabStateType;
33 
34 class DSchedCollab;
35 class DSchedCollabStateMachine;
36 class DSchedCollabState {
37 public:
DSchedCollabState()38     DSchedCollabState() {}
~DSchedCollabState()39     virtual ~DSchedCollabState() {}
40 
41     virtual int32_t Execute(std::shared_ptr<DSchedCollab> dCollab, const AppExecFwk::InnerEvent::Pointer &event) = 0;
42     virtual CollabStateType GetStateType() = 0;
43 };
44 }  // namespace DistributedSchedule
45 }  // namespace OHOS
46 #endif  // OHOS_DSCHED_COLLAB_STATE_H