summaryrefslogtreecommitdiff
path: root/image/backends/basic.hh
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-04-02 05:08:04 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-04-02 05:08:04 -0500
commitc6b0e5fc81d905f57688c696f80e480712f612ab (patch)
tree9b08fec4059ed05becfe85e426ff316cb7a5d381 /image/backends/basic.hh
parent94fc4d46c3f2ebc179b768525a4aad73a655e083 (diff)
downloadhorizon-c6b0e5fc81d905f57688c696f80e480712f612ab.tar.gz
horizon-c6b0e5fc81d905f57688c696f80e480712f612ab.tar.bz2
horizon-c6b0e5fc81d905f57688c696f80e480712f612ab.tar.xz
horizon-c6b0e5fc81d905f57688c696f80e480712f612ab.zip
image: Significantly refactor how backends are registered
Diffstat (limited to 'image/backends/basic.hh')
-rw-r--r--image/backends/basic.hh13
1 files changed, 13 insertions, 0 deletions
diff --git a/image/backends/basic.hh b/image/backends/basic.hh
index d39c57e..3181f69 100644
--- a/image/backends/basic.hh
+++ b/image/backends/basic.hh
@@ -12,11 +12,21 @@
#pragma once
+#include <functional>
#include <string>
+#include <vector>
namespace Horizon {
namespace Image {
+class BasicBackend;
+
+struct BackendDescriptor {
+ std::string type_code;
+ std::string description;
+ std::function<BasicBackend *(std::string, std::string)> creation_fn;
+};
+
class BasicBackend {
public:
/*! Create the backend object.
@@ -43,6 +53,9 @@ public:
*/
virtual int finalise();
+ /*! Returns a list of available backends. */
+ static const std::vector<BackendDescriptor> available_backends();
+
/*! The intermediate directory which contains the sysroot the image
* should contain. */
const std::string &ir_dir;