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 options_description_easy_init
25
#ifndef DRIZZLED_MODULE_OPTION_CONTEXT_H
26
#define DRIZZLED_MODULE_OPTION_CONTEXT_H
28
#include "drizzled/visibility.h"
30
#include <boost/program_options.hpp>
39
namespace po=boost::program_options;
42
* Options proxy wrapper. Provides pre-pending of module name to each option
45
class DRIZZLED_API option_context
47
const std::string &module_name;
48
po::options_description_easy_init po_options;
52
option_context(const std::string &module_name_in,
53
po::options_description_easy_init po_options_in);
55
option_context& operator()(const char* name,
56
const char* description);
58
option_context& operator()(const char* name,
59
const po::value_semantic* s);
61
option_context& operator()(const char* name,
62
const po::value_semantic* s,
63
const char* description);
65
static std::string prepend_name(std::string module_name_in,
71
* Don't allow default construction.
76
* Don't allow copying of objects.
78
option_context(const option_context &);
81
* Don't allow assignment of objects.
83
option_context& operator=(const option_context &);
86
} /* namespace module */
87
} /* namespace drizzled */
90
#endif /* DRIZZLED_MODULE_OPTION_CONTEXT_H */