1/*
2 * Copyright (C) 2021-2022 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#ifndef HIDUMPER_SERVICES_DUMPER_PARAMETER_H
16#define HIDUMPER_SERVICES_DUMPER_PARAMETER_H
17
18#include <vector>
19
20#include "common/dump_cfg.h"
21#include "common/dumper_opts.h"
22#include "raw_param.h"
23namespace OHOS {
24namespace HiviewDFX {
25class DumperParameter {
26public:
27    DumperParameter();
28    ~DumperParameter();
29public:
30    void SetOpts(const DumperOpts &opts);
31    const DumperOpts &GetOpts() const;
32    // set output file path
33    void SetOutputFilePath(std::string& path);
34    // get output file path
35    std::string& GetOutputFilePath();
36    // set config list
37    void SetExecutorConfigList(std::vector<std::shared_ptr<DumpCfg>>& list);
38    // get config list
39    std::vector<std::shared_ptr<DumpCfg>>& GetExecutorConfigList();
40    // set client callback
41    void setClientCallback(const std::shared_ptr<RawParam>& reqCtl);
42    // get client callback
43    std::shared_ptr<RawParam> getClientCallback();
44    // set IPC flag
45    // check IPC flag
46    void SetUid(int uid)
47    {
48        uid_ = uid;
49    }
50    int GetUid() const
51    {
52        return uid_;
53    }
54    void SetPid(int pid)
55    {
56        pid_ = pid;
57    }
58    int GetPid() const
59    {
60        return pid_;
61    };
62private:
63    int uid_ {-1};
64    int pid_ {-1};
65    DumperOpts opts_;
66    std::vector<std::shared_ptr<DumpCfg>> list_; // list
67    std::shared_ptr<RawParam> mPtrReqCtl;
68};
69} // namespace HiviewDFX
70} // namespace OHOS
71#endif // HIDUMPER_SERVICES_DUMPER_PARAMETER_H
72