Store command line arguments

This commit is contained in:
Gitea 2018-04-03 00:49:44 +02:00
parent d4c572cdbd
commit 1b640dec8b
2 changed files with 82 additions and 0 deletions

36
include/Parameters.hh Normal file
View File

@ -0,0 +1,36 @@
//
// Parameters.hh
// medtech
//
// Created by Baranyai David on 2018. 04. 03..
//
#ifndef Parameters_hh
#define Parameters_hh
#include <stdio.h>
class Parameters
{
private:
/* Here will be the instance stored. */
static Parameters* instance;
/* Private constructor to prevent instancing. */
Parameters();
int ParticleEnergy;
int pgundegree;
public:
/* Static access method. */
static Parameters* getInstance();
int GetParticleEnergy();
int GetDegree();
void SetParticleEnergy(int);
void SetDegree(int);
};
#endif /* Parameters_hh */

46
src/Parameters.cc Normal file
View File

@ -0,0 +1,46 @@
//
// Parameters.cc
// medtech
//
// Created by Baranyai David on 2018. 04. 03..
//
#include "Parameters.hh"
Parameters* Parameters::getInstance()
{
if (instance == 0)
{
instance = new Parameters();
}
return instance;
}
Parameters::Parameters() : ParticleEnergy(6), pgundegree(90)
{
}
/* Null, because instance will be initialized on demand. */
Parameters* Parameters::instance = 0;
int Parameters::GetParticleEnergy()
{
return ParticleEnergy;
}
int Parameters::GetDegree()
{
return pgundegree;
}
void Parameters::SetDegree(int d)
{
pgundegree = d;
}
void Parameters::SetParticleEnergy(int p)
{
ParticleEnergy = p;
}