SpecResLabel.h 1.0 KB
Newer Older
W
wxyu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
/*******************************************************************************
 * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 * Proprietary and confidential.
 ******************************************************************************/
#pragma once

#include "TaskLabel.h"

#include <string>
#include <memory>


class Resource;

using ResourceWPtr = std::weak_ptr<Resource>;

namespace zilliz {
namespace milvus {
namespace engine {

class SpecResLabel : public TaskLabel {
public:
    SpecResLabel(const ResourceWPtr &resource)
25
        : TaskLabel(TaskLabelType::SPECIFIED_RESOURCE), resource_(resource) {}
W
wxyu 已提交
26 27

    inline ResourceWPtr &
28
    resource() {
W
wxyu 已提交
29 30 31 32
        return resource_;
    }

    inline std::string &
33
    resource_name() {
W
wxyu 已提交
34 35 36 37 38 39
        return resource_name_;
    }

private:
    ResourceWPtr resource_;
    std::string resource_name_;
40
};
W
wxyu 已提交
41

42
using SpecResLabelPtr = std::shared_ptr<SpecResLabel>();
W
wxyu 已提交
43 44 45 46 47

}
}
}