Store command line arguments
This commit is contained in:
parent
d4c572cdbd
commit
1b640dec8b
|
@ -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 */
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue