LILAC
Language to language Interop LAyer Compiler
Loading...
Searching...
No Matches
backend.cxx
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#include "shared/backend.h"
21
22#include <utility>
23#include <vector>
24
25static std::vector<lilac::shared::BackendAction*> backends;
26
27
28lilac::shared::BackendAction::BackendAction(BackendKind kind, std::string name, std::string desc)
29 : m_Name(std::move(name)), m_Desc(std::move(desc)), m_Kind(kind)
30{
31 backends.push_back(this);
32}
33
34const std::string& lilac::shared::BackendAction::Name() const
35{
36 return m_Name;
37}
38
39const std::string& lilac::shared::BackendAction::Desc() const
40{
41 return m_Desc;
42}
43
48
49const std::vector<lilac::shared::BackendAction*>& lilac::shared::BackendAction::GetRegistered()
50{
51 return backends;
52}
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