You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.0 KiB
56 lines
1.0 KiB
#pragma once |
|
|
|
#include <memory> |
|
#include <string> |
|
#include <string_view> |
|
#include <thread> |
|
|
|
namespace nxl::autostore { |
|
|
|
// Forward declarations |
|
namespace application { |
|
class IItemRepository; |
|
class IClock; |
|
class IOrderService; |
|
} // namespace application |
|
|
|
namespace infrastructure { |
|
class HttpServer; |
|
} |
|
|
|
namespace webapi { |
|
class StoreController; |
|
} |
|
|
|
class AutoStore |
|
{ |
|
public: |
|
explicit AutoStore(std::string_view dataPath); |
|
~AutoStore(); |
|
|
|
// Initialize the application |
|
bool initialize(); |
|
|
|
// Start the application services |
|
bool start(); |
|
|
|
// Stop the application services |
|
void stop(); |
|
|
|
private: |
|
std::string dataPath; |
|
bool initialized; |
|
|
|
// Dependencies |
|
std::unique_ptr<application::IItemRepository> itemRepository; |
|
std::unique_ptr<application::IClock> clock; |
|
std::unique_ptr<application::IOrderService> orderService; |
|
std::unique_ptr<webapi::StoreController> storeController; |
|
|
|
// HTTP server |
|
std::unique_ptr<infrastructure::HttpServer> httpServer; |
|
std::thread serverThread; |
|
bool serverRunning; |
|
}; |
|
|
|
} // namespace nxl::autostore
|