IRProvider.hpp 1.67 KB
Newer Older
1
2
3
4
5
6
/*******************************************************************************
 * Copyright (c) 2017 UT-Battelle, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Eclipse Distribution License v1.0 which accompanies this
 * distribution. The Eclipse Public License is available at
7
8
 * http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution
 *License is available at https://eclipse.org/org/documents/edl-v10.php
9
10
11
12
13
14
15
16
 *
 * Contributors:
 *   Alexander J. McCaskey - initial API and implementation
 *******************************************************************************/
#ifndef XACC_COMPILER_IRPROVIDER_HPP_
#define XACC_COMPILER_IRPROVIDER_HPP_
#include "Instruction.hpp"
#include "IR.hpp"
17
#include "CompositeInstruction.hpp"
18
19
20

namespace xacc {

21
class IRProvider : public Identifiable {
22
public:
Mccaskey, Alex's avatar
Mccaskey, Alex committed
23
  virtual const int getNRequiredBits(const std::string name) = 0;
24
25
26
  virtual std::shared_ptr<Instruction> createInstruction(const std::string name,
                                                         std::size_t bit) = 0;

27
  virtual std::shared_ptr<Instruction>
28
  createInstruction(const std::string name, std::vector<std::size_t> bits,
29
30
                    std::vector<InstructionParameter> parameters =
                        std::vector<InstructionParameter>{}) = 0;
31
32
33
34
35

  virtual std::shared_ptr<CompositeInstruction>
  createComposite(const std::string name,
                  std::vector<std::string> variables = {}) = 0;

36
  virtual std::shared_ptr<IR> createIR() = 0;
37

38
39
  virtual std::vector<std::string> getInstructions() = 0;
  virtual ~IRProvider() {}
40
41
};

42
} // namespace xacc
43
#endif