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#include "common/dumper_parameter.h"
16
17#include "hilog_wrapper.h"
18#include "securec.h"
19namespace OHOS {
20namespace HiviewDFX {
21DumperParameter::DumperParameter()
22{
23    DUMPER_HILOGD(MODULE_COMMON, "enter|");
24    (void)memset_s(&opts_, sizeof(opts_), 0, sizeof(opts_));
25    opts_.Reset();
26
27    DUMPER_HILOGD(MODULE_COMMON, "leave|");
28}
29
30DumperParameter::~DumperParameter()
31{
32    DUMPER_HILOGD(MODULE_COMMON, "enter|");
33
34    opts_.Reset();
35
36    DUMPER_HILOGD(MODULE_COMMON, "leave|");
37}
38
39void DumperParameter::SetOpts(const DumperOpts &opts)
40{
41    opts_ = opts;
42}
43
44const DumperOpts &DumperParameter::GetOpts() const
45{
46    return opts_;
47}
48
49void DumperParameter::SetOutputFilePath(std::string &path)
50{
51    opts_.path_ = path;
52}
53
54std::string &DumperParameter::GetOutputFilePath()
55{
56    return opts_.path_;
57}
58
59void DumperParameter::SetExecutorConfigList(std::vector<std::shared_ptr<DumpCfg>> &list)
60{
61    list_ = list;
62}
63
64std::vector<std::shared_ptr<DumpCfg>> &DumperParameter::GetExecutorConfigList()
65{
66    return list_;
67}
68
69void DumperParameter::setClientCallback(const std::shared_ptr<RawParam> &reqCtl)
70{
71    mPtrReqCtl = reqCtl;
72}
73
74std::shared_ptr<RawParam> DumperParameter::getClientCallback()
75{
76    return mPtrReqCtl;
77}
78} // namespace HiviewDFX
79} // namespace OHOS
80