diff options
author | wwylele <wwylele@gmail.com> | 2016-12-21 19:05:56 +0100 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-01-11 10:46:44 +0100 |
commit | cf3a272332b03640730d1434e9802e166ca931da (patch) | |
tree | 7297bf1b38679cb84b5baa7c98b5b9e729560131 /src/core/frontend/camera/factory.h | |
parent | Merge pull request #2369 from MerryMage/core-frontend (diff) | |
download | yuzu-cf3a272332b03640730d1434e9802e166ca931da.tar yuzu-cf3a272332b03640730d1434e9802e166ca931da.tar.gz yuzu-cf3a272332b03640730d1434e9802e166ca931da.tar.bz2 yuzu-cf3a272332b03640730d1434e9802e166ca931da.tar.lz yuzu-cf3a272332b03640730d1434e9802e166ca931da.tar.xz yuzu-cf3a272332b03640730d1434e9802e166ca931da.tar.zst yuzu-cf3a272332b03640730d1434e9802e166ca931da.zip |
Diffstat (limited to 'src/core/frontend/camera/factory.h')
-rw-r--r-- | src/core/frontend/camera/factory.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/core/frontend/camera/factory.h b/src/core/frontend/camera/factory.h new file mode 100644 index 000000000..d68be16e5 --- /dev/null +++ b/src/core/frontend/camera/factory.h @@ -0,0 +1,41 @@ +// Copyright 2016 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <memory> +#include <string> +#include "core/frontend/camera/interface.h" + +namespace Camera { + +class CameraFactory { +public: + virtual ~CameraFactory(); + + /** + * Creates a camera object based on the configuration string. + * @params config Configuration string to create the camera. The implementation can decide the + * meaning of this string. + * @returns a unique_ptr to the created camera object. + */ + virtual std::unique_ptr<CameraInterface> Create(const std::string& config) const = 0; +}; + +/** + * Registers an external camera factory. + * @param name Identifier of the camera factory. + * @param factory Camera factory to register. + */ +void RegisterFactory(const std::string& name, std::unique_ptr<CameraFactory> factory); + +/** + * Creates a camera from the factory. + * @param name Identifier of the camera factory. + * @param config Configuration string to create the camera. The meaning of this string is + * defined by the factory. + */ +std::unique_ptr<CameraInterface> CreateCamera(const std::string& name, const std::string& config); + +} // namespace Camera |