1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2010 Monty Taylor
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
* @brief An Proxy Wrapper around boost::program_options::variables_map
25
#ifndef DRIZZLED_MODULE_OPTION_MAP_H
26
#define DRIZZLED_MODULE_OPTION_MAP_H
28
#include "drizzled/visibility.h"
30
#include <boost/program_options.hpp>
40
* Options proxy wrapper. Provides pre-pending of module name to each option
43
class DRIZZLED_API option_map
45
const std::string &module_name;
46
const boost::program_options::variables_map vm;
50
option_map(const std::string &module_name_in,
51
const boost::program_options::variables_map &vm_in);
52
option_map(const option_map &old);
54
const boost::program_options::variable_value& operator[](const std::string &name_in) const
56
std::string new_name(module_name);
57
new_name.push_back('.');
58
new_name.append(name_in);
65
* Don't allow default construction.
70
* Don't allow assignment of objects.
72
option_map& operator=(const option_map &);
75
} /* namespace module */
76
} /* namespace drizzled */
79
#endif /* DRIZZLED_MODULE_OPTION_MAP_H */