Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
Public Member Functions | Friends | List of all members
Hazelnp::Parameter Class Reference

#include <Parameter.h>

Public Member Functions

 Parameter (const std::string &key, const Value *value)
 
 ~Parameter ()
 
const std::string & Key () const
 Will return the key of this parameter. More...
 
const ValueGetValue () const
 Will return the value of this parameter. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Parameter &p)
 

Detailed Description

Definition at line 8 of file Parameter.h.

Constructor & Destructor Documentation

◆ Parameter()

Parameter::Parameter ( const std::string &  key,
const Value value 
)
explicit

Definition at line 5 of file Parameter.cpp.

6  :
7  key{ key }
8 {
9  this->value = value->Deepcopy();
10  return;
11 }
virtual Value * Deepcopy() const =0
Will return a deeopopy of this object.

◆ ~Parameter()

Parameter::~Parameter ( )

Definition at line 13 of file Parameter.cpp.

14 {
15  delete value;
16  value = nullptr;
17 
18  return;
19 }

Member Function Documentation

◆ GetValue()

const ::Value * Parameter::GetValue ( ) const

Will return the value of this parameter.

Definition at line 26 of file Parameter.cpp.

27 {
28  return value;
29 }

◆ Key()

const std::string & Parameter::Key ( ) const

Will return the key of this parameter.

Definition at line 21 of file Parameter.cpp.

22 {
23  return key;
24 }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Parameter p 
)
friend

Definition at line 20 of file Parameter.h.

21  {
22  return os << "{ Key: \"" << p.key << "\" -> " << *p.value << " }";
23  }

The documentation for this class was generated from the following files: