diff options
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); + } } |
