Files
Massimo Fioravanti d55aa9b9e6 Pipeline: remove * from targets
Now * is just a pipeline frontend shorthand.
2022-10-20 14:20:12 +02:00

28 lines
620 B
C++

#pragma once
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include "revng/Pipeline/Contract.h"
#include "revng/Pipeline/Target.h"
namespace pipeline {
/// A pipe that copies items from a container to another
template<typename Kind, Kind *K, typename Source, typename Destination = Source>
class CopyPipe {
public:
static constexpr auto Name = "CopyPipe";
public:
std::array<ContractGroup, 1> getContract() const {
return { ContractGroup(*K, 0, *K, 1) };
}
public:
void run(const Context &, const Source &S, Destination &T) { T = S; }
};
} // namespace pipeline