#include <msp/io/console.h>
+#include "except.h"
#include "process.h"
#include "process_private.h"
namespace Msp {
-Process *Process::_self = 0;
+Process *Process::_self = nullptr;
Process::Process(const Private &p):
priv(new Private(p))
-{
- init();
-}
+{ }
Process::Process():
priv(new Private)
-{
- init();
-}
-
-void Process::init()
-{
- redirect = false;
- cin = 0;
- cout = 0;
- cerr = 0;
- running = false;
- finished = false;
- exit_code = 0;
-}
+{ }
Process &Process::self()
{
unsigned Process::get_exit_code() const
{
if(!finished)
- throw logic_error("not finished");
+ throw invalid_state("not finished");
return exit_code;
}