~ubuntu-branches/ubuntu/vivid/mir/vivid

« back to all changes in this revision

Viewing changes to include/platform/mir/options/option.h

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2014-02-04 14:49:07 UTC
  • mto: This revision was merged to the branch mainline in revision 61.
  • Revision ID: package-import@ubuntu.com-20140204144907-o3ruhix0ey26lchl
Tags: upstream-0.1.4+14.04.20140204
ImportĀ upstreamĀ versionĀ 0.1.4+14.04.20140204

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef MIR_OPTIONS_OPTION_H_
20
20
#define MIR_OPTIONS_OPTION_H_
21
21
 
 
22
#include <boost/any.hpp>
 
23
 
22
24
#include <string>
23
25
 
24
26
namespace mir
36
38
    virtual bool get(char const* name, bool default_) const = 0;
37
39
    virtual std::string get(char const* name, char const* default_) const = 0;
38
40
    virtual int get(char const* name, int default_) const = 0;
 
41
    virtual boost::any const& get(char const* name) const = 0;
 
42
 
 
43
    template<typename Type>
 
44
    Type get(char const* name) const
 
45
    { return boost::any_cast<Type>(get(name)); }
39
46
 
40
47
protected:
41
48
    Option() = default;
42
 
    virtual ~Option() { /* TODO: make nothrow */ }
 
49
    virtual ~Option() = default;
43
50
    Option(Option const&) = delete;
44
51
    Option& operator=(Option const&) = delete;
45
52
};