-
Notifications
You must be signed in to change notification settings - Fork 0
/
Commands.h
45 lines (39 loc) · 1.49 KB
/
Commands.h
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
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "JellyInclude.h"
#include "JellyfishConfig.h"
#include "Jellyfish.h"
class Commands {
public:
explicit Commands(JellyfishConfig const &jelly_config, std::string const &login, std::string const &create, int storage) : _jelly(jelly_config), finish_(false), _login(login), _create(create), _storage(storage)
{
_timer.stop();
}
void Run();
private:
typedef std::vector<std::string> Arguments;
// void Store(const Arguments &args, bool read_from_file);
// void StoreCallback(const int &result,
// const NodeId &key,
// const bptime::time_duration &ttl);
// void FindValue(const Arguments &args, bool write_to_file);
// void FindValueCallback(FindValueReturns find_value_returns, std::string path);
// void GetContact(const Arguments &args);
// void GetContactsCallback(const int &result, Contact contact);
// void FindNodes(const Arguments &args, bool write_to_file);
// void FindNodesCallback(const int &result,
// std::vector<Contact> contacts,
// std::string path);
void PrintUsage();
void ProcessCommand(const std::string &cmdline);
Jellyfish _jelly;
boost::timer::cpu_timer _timer;
bool finish_;
std::string _login;
std::string _create;
int _storage;
// PrivateKeyPtr null_priv_key_;
// bool result_arrived_, finish_;
// boost::mutex wait_mutex_;
// boost::condition_variable wait_cond_var_;
// std::function<void()> mark_results_arrived_;
};