LILAC
Language to language Interop LAyer Compiler
Loading...
Searching...
No Matches
backend.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 Yeong-won Seo
3 *
4 * This file is part of LILAC.
5 *
6 * LILAC is free software: you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 3, or (at your option) any later
9 * version.
10 *
11 * LILAC is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <string>
23#include <vector>
24
26{
28 {
30 };
31
36 {
37 const std::string m_Name;
38 const std::string m_Desc;
39 BackendKind m_Kind;
40
41 public:
42 BackendAction(BackendKind kind, std::string name, std::string desc);
43
44 virtual ~BackendAction() = default;
45
50 [[nodiscard]]
51 const std::string& Name() const;
52
57 [[nodiscard]]
58 const std::string& Desc() const;
59
64 [[nodiscard]]
65 BackendKind Kind() const;
66
75 [[nodiscard]]
76 virtual int Run(
77 std::string confPath,
78 std::string libPath,
79 std::string outPath,
80 std::vector<std::string> argv) const = 0;
81
86 static const std::vector<BackendAction*>& GetRegistered();
87 };
88}
An action that generates language-specific bridge of given interface representation.
Definition backend.h:36
virtual ~BackendAction()=default
virtual int Run(std::string confPath, std::string libPath, std::string outPath, std::vector< std::string > argv) const =0
Runs action with given paths.
const std::string & Name() const
Gets the name of this action.
Definition backend.cxx:34
static const std::vector< BackendAction * > & GetRegistered()
Gets all registered actions.
Definition backend.cxx:49
BackendKind Kind() const
Gets the kind of this action.
Definition backend.cxx:44
const std::string & Desc() const
Gets the description of this action.
Definition backend.cxx:39
BackendAction(BackendKind kind, std::string name, std::string desc)
Definition backend.cxx:28