Skip to content

Commit

Permalink
Name type which represents list of services
Browse files Browse the repository at this point in the history
  • Loading branch information
karczex committed Nov 19, 2024
1 parent 8f99cff commit 38e2d55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion libservice/headers/service/Aggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ class Aggregator {
private:
using ServiceKey = std::pair<uint32_t, std::string>;
using ServiceStorage = std::unordered_map<ServiceKey, Service>;
using ServicesList = std::vector<std::reference_wrapper<Service>>;

public:
Aggregator(const service::IpAddressChecker& ipChecker);

void clear();
void newRequest(const httpparser::HttpRequest& request, const DiscoverySessionMeta& meta);
std::vector<std::reference_wrapper<Service>> collectServices();
ServicesList collectServices();

private:
const IpAddressChecker& ipChecker;
Expand Down
4 changes: 2 additions & 2 deletions libservice/src/Aggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ void Aggregator::newRequest(const httpparser::HttpRequest& request, const Discov
services[key] = std::move(newService);
}

std::vector<std::reference_wrapper<Service>> Aggregator::collectServices() {
std::vector<std::reference_wrapper<Service>> servicesVec;
ServicesList Aggregator::collectServices() {
ServicesList servicesVec;
servicesVec.reserve(services.size());

for (auto& pair : services) {
Expand Down

0 comments on commit 38e2d55

Please sign in to comment.