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
6namespace Hazelnp
7{
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}
Parameter(const std::string &key, const Value *value)
Definition: Parameter.cpp:5
const Value * GetValue() const
Will return the value of this parameter.
Definition: Parameter.cpp:26
friend std::ostream & operator<<(std::ostream &os, const Parameter &p)
Definition: Parameter.h:20
const std::string & Key() const
Will return the key of this parameter.
Definition: Parameter.cpp:21
Abstract class for values.
Definition: Value.h:11