-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnvironment.h
More file actions
36 lines (28 loc) · 839 Bytes
/
Environment.h
File metadata and controls
36 lines (28 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef CPP_CALLBACK_SCRIPT_ENVIRONMENT_H
#define CPP_CALLBACK_SCRIPT_ENVIRONMENT_H
#include "EnvironmentClient.h"
class Environment
{
public:
Environment() { }
void addClient(EnvironmentClient *client)
{
this->clients.push_back(client);
}
Strings call(const String &key, const Strings &values)
{
for (auto client : this->clients)
{
if (client->respondsToKey(key))
{
return client->call(key, values);
}
}
printf("Environment. No one found to respond to key '%s'\n", key.c_str());
Strings stub;
return stub;
}
private:
std::vector<EnvironmentClient *> clients;
};
#endif // CPP_CALLBACK_SCRIPT_ENVIRONMENT_H