Commit a9280d10 authored by Henry Weller's avatar Henry Weller
Browse files

sigWriteNow, sigStopAtWriteNow: Change runTimePtr_ to static member

parent 30e456a6
......@@ -33,41 +33,50 @@ License
namespace Foam
{
// Signal number to catch
int sigStopAtWriteNow::signal_
(
debug::optimisationSwitch("stopAtWriteNowSignal", -1)
);
// Register re-reader
class addstopAtWriteNowSignalToOpt
:
public ::Foam::simpleRegIOobject
{
public:
addstopAtWriteNowSignalToOpt(const char* name)
:
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
{}
virtual ~addstopAtWriteNowSignalToOpt()
{}
virtual void readData(Foam::Istream& is)
{
sigStopAtWriteNow::signal_ = readLabel(is);
sigStopAtWriteNow::set(true);
}
virtual void writeData(Foam::Ostream& os) const
{
os << sigStopAtWriteNow::signal_;
}
};
addstopAtWriteNowSignalToOpt addstopAtWriteNowSignalToOpt_
(
"stopAtWriteNowSignal"
);
}
static Foam::Time const* runTimePtr_ = nullptr;
Foam::Time const* Foam::sigStopAtWriteNow::runTimePtr_ = nullptr;
struct sigaction Foam::sigStopAtWriteNow::oldAction_;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -58,9 +58,13 @@ class sigStopAtWriteNow
//- Number of signal to use
static int signal_;
//- Pointer to Time
static Time const* runTimePtr_;
//- Saved old signal trapping setting
static struct sigaction oldAction_;
// Private Member Functions
static void sigHandler(int);
......@@ -71,6 +75,7 @@ public:
//- wip. Have setter have access to signal_
friend class addstopAtWriteNowSignalToOpt;
// Constructors
//- Construct null
......
......@@ -33,39 +33,47 @@ License
namespace Foam
{
// Signal number to catch
int sigWriteNow::signal_
(
debug::optimisationSwitch("writeNowSignal", -1)
);
// Register re-reader
class addwriteNowSignalToOpt
:
public ::Foam::simpleRegIOobject
{
public:
addwriteNowSignalToOpt(const char* name)
:
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
{}
virtual ~addwriteNowSignalToOpt()
{}
virtual void readData(Foam::Istream& is)
{
sigWriteNow::signal_ = readLabel(is);
sigWriteNow::set(true);
}
virtual void writeData(Foam::Ostream& os) const
{
os << sigWriteNow::signal_;
}
};
addwriteNowSignalToOpt addwriteNowSignalToOpt_("writeNowSignal");
}
static Foam::Time* runTimePtr_ = nullptr;
Foam::Time* Foam::sigWriteNow::runTimePtr_ = nullptr;
struct sigaction Foam::sigWriteNow::oldAction_;
......
......@@ -57,9 +57,13 @@ class sigWriteNow
//- Number of signal to use
static int signal_;
//- Pointer to Time
static Time* runTimePtr_;
//- Saved old signal trapping setting
static struct sigaction oldAction_;
// Private Member Functions
static void sigHandler(int);
......@@ -92,7 +96,6 @@ public:
//- Is active?
bool active() const;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment