GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
Status.hpp
Go to the documentation of this file.
1 // This file is part of GranOO, a workbench for DEM simulation.
2 //
3 // Author(s) : - Damien Andre IRCER/UNILIM, Limoges France
4 // <damien.andre@unilim.fr>
5 // - Jean-luc Charles Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
6 // <jean-luc.charles@ensam.eu>
7 // - Jeremie Girardot Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
8 // <jeremie.girardot@ensam.eu>
9 // - Cedric Hubert LAMIH/UPHF, Valenciennes France
10 // <cedric.hubert@uphf.fr>
11 // - Ivan Iordanoff Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
12 // <ivan.iordanoff@ensam.eu>
13 // - Lucas Teixeira, RHI Magnesita, 8700 Leoben, Autriche
14 // <lucas.teixeira@rhimagnesita.com>
15 //
16 // Copyright (C) 2008-2022 D. Andre, JL. Charles, J. Girardot, C. Hubert, I. Iordanoff, L. Teixeira
17 //
18 // This program is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 // This program is distributed in the hope that it will be useful,
24 // but WITHOUT ANY WARRANTY; without even the implied warranty of
25 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 // GNU General Public License for more details.
27 //
28 // You should have received a copy of the GNU General Public License
29 // along with this program. If not, see <http://www.gnu.org/licenses/>.
30 
31 
32 #ifndef _libCore_Status_hpp_
33 #define _libCore_Status_hpp_
34 
35 #include <string>
36 
37 #include "GranOO3/Core/PlugIn.hpp"
38 
39 namespace GranOO3
40 {
41  namespace Core
42  {
43  class Status{
44  public:
45  Status();
46 
47  enum Step {INIT, RUN, STOP};
48 
49  std::string show(const std::string&);
50  void set_current_step(Step);
51  void set_current_status(const std::string&);
52  void set_current_plugin(const Core::PlugIn*);
53 
54  const Step& get_current_step() const;
55 
56  const std::string& init_label() const;
57  const std::string& run_label() const;
58  const std::string& stop_label() const;
59 
60  private:
62  std::string _currentStatus;
64  unsigned int _statusUID;
65 
66  std::string in;
67 
68  const std::string _openBracket = "[\033[32m";
69  const std::string _closeBracket = "\033[0m]";
70  const std::string _init = "INIT";
71  const std::string _run = "RUN";
72  const std::string _stop = "STOP";
73 
74  void set_in(const std::string&);
75  };
76 
77  inline const std::string& Status::init_label() const{
78  return _init;
79  }
80 
81  inline const std::string& Status::run_label() const{
82  return _run;
83  }
84 
85  inline const std::string& Status::stop_label() const{
86  return _stop;
87  }
88 
89  inline const Status::Step& Status::get_current_step() const{
90  return _currentStep;
91  };
92  }
93 }
94 
95 
96 #endif
Definition: PlugIn.hpp:101
Definition: Status.hpp:43
const std::string _openBracket
Definition: Status.hpp:68
std::string in
Definition: Status.hpp:66
Step _currentStep
Definition: Status.hpp:61
Status()
Definition: Status.cpp:42
unsigned int _statusUID
Definition: Status.hpp:64
void set_current_status(const std::string &)
Definition: Status.cpp:85
const std::string _stop
Definition: Status.hpp:72
void set_current_step(Step)
Definition: Status.cpp:78
const std::string & run_label() const
Definition: Status.hpp:81
const Core::PlugIn * _currentPlugin
Definition: Status.hpp:63
const std::string & stop_label() const
Definition: Status.hpp:85
std::string show(const std::string &)
Definition: Status.cpp:49
void set_in(const std::string &)
Definition: Status.cpp:95
const std::string _closeBracket
Definition: Status.hpp:69
const std::string & init_label() const
Definition: Status.hpp:77
std::string _currentStatus
Definition: Status.hpp:62
const std::string _init
Definition: Status.hpp:70
const std::string _run
Definition: Status.hpp:71
const Step & get_current_step() const
Definition: Status.hpp:89
Step
Definition: Status.hpp:47
@ STOP
Definition: Status.hpp:47
@ INIT
Definition: Status.hpp:47
@ RUN
Definition: Status.hpp:47
void set_current_plugin(const Core::PlugIn *)
Definition: Status.cpp:90
Definition: Common.hpp:198