diff options
| author | Aotrix <[email protected]> | 2026-04-19 18:16:14 +0200 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2026-04-19 18:16:14 +0200 |
| commit | cc436cb44c60ef2485321e1e22b3ea0a59ee22af (patch) | |
| tree | b04464945278bcdc8915d8b3676b504a95e3f701 /battleNetApi/src/tokenPool.cpp | |
| parent | 8837de4783b25255b6a1799be210c9e580dd2d4f (diff) | |
TokenPool now works
Diffstat (limited to 'battleNetApi/src/tokenPool.cpp')
| -rw-r--r-- | battleNetApi/src/tokenPool.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/battleNetApi/src/tokenPool.cpp b/battleNetApi/src/tokenPool.cpp index f8a6256..08770e8 100644 --- a/battleNetApi/src/tokenPool.cpp +++ b/battleNetApi/src/tokenPool.cpp @@ -1,13 +1,18 @@ #include <tokenPool.hpp> -std::optional<std::string> TokenPool::unusedToken() { - if (mTokenContainer.empty()) { +std::optional<Token> TokenPool::availableToken() { + if (aTokenContainer.empty()) { return std::nullopt; } - Token aOutputToken{mTokenContainer.front()}; - mTokenContainer.pop(); - return aOutputToken.text(); + Token aOutputToken{aTokenContainer.front()}; + aTokenContainer.pop(); + return aOutputToken; } -void TokenPool::fillTokenSource(const std::string &iJsonPath) { // mTokenContainer.emplace(Token(iJsonPath)); +void TokenPool::feedTokenSource(const std::string &iJsonPath) { aTokenContainer.emplace(iJsonPath); } + +void TokenPool::feedTokenSource(const std::span<std::string> &iJsonPaths) { + for (const std::string &iJsonPath : iJsonPaths) { + feedTokenSource(iJsonPath); + } } |
