Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
Parameter.h
Go to the documentation of this file.
1 #pragma once
2 #include "Value.h"
3 #include <string>
4 #include <ostream>
5 
6 namespace Hazelnp
7 {
8  class Parameter
9  {
10  public:
11  explicit Parameter(const std::string& key, const Value* value);
12  ~Parameter();
13 
14  //! Will return the key of this parameter
15  const std::string& Key() const;
16 
17  //! Will return the value of this parameter
18  const Value* GetValue() const;
19 
20  friend std::ostream& operator<< (std::ostream& os, const Parameter& p)
21  {
22  return os << "{ Key: \"" << p.key << "\" -> " << *p.value << " }";
23  }
24 
25  private:
26  std::string key;
27  Hazelnp::Value* value;
28  };
29 }
const std::string & Key() const
Will return the key of this parameter.
Definition: Parameter.cpp:21
Parameter(const std::string &key, const Value *value)
Definition: Parameter.cpp:5
friend std::ostream & operator<<(std::ostream &os, const Parameter &p)
Definition: Parameter.h:20
const Value * GetValue() const
Will return the value of this parameter.
Definition: Parameter.cpp:26
Abstract class for values.
Definition: Value.h:10