Commit 527282af authored by ext-calvo_p's avatar ext-calvo_p

Revert "remove duplicated class: PSystem"

This reverts commit 39b0ee09.
parent 5b44baf7
// ------------------------------------------------------------------------
// $RCSfile: Call.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: Call
// The class for OPAL "CALL" commands.
// Class Call
// The class for OPAL CALL command.
//
// ------------------------------------------------------------------------
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// $Date: 2000/03/27 09:33:37 $
// $Author: Andreas Adelmann $
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#include "BasicActions/Call.h"
#include "AbstractObjects/OpalData.h"
#include "Attributes/Attributes.h"
#include "OpalParser/OpalParser.h"
......@@ -24,27 +24,22 @@
#include "Utilities/OpalException.h"
#include "Utilities/Options.h"
#include "Utility/IpplInfo.h"
#include <iostream>
using std::cerr;
using std::endl;
#include <iostream>
// Class Call
// ------------------------------------------------------------------------
Call::Call():
Action(1, "CALL",
"The \"CALL\" statement switches input temporarily to the "
"named file.") {
itsAttr[0] =
Attributes::makeString("FILE", "Name of file to be read", "CALL");
itsAttr[0] = Attributes::makeString
("FILE", "Name of file to be read", "CALL");
registerOwnership(AttributeHandler::STATEMENT);
}
Call::Call(const std::string &name, Call *parent):
Call::Call(const std::string& name, Call* parent):
Action(name, parent)
{}
......@@ -53,7 +48,7 @@ Call::~Call()
{}
Call *Call::clone(const std::string &name) {
Call* Call::clone(const std::string& name) {
return new Call(name, this);
}
......@@ -61,18 +56,18 @@ Call *Call::clone(const std::string &name) {
void Call::execute() {
std::string file = Attributes::getString(itsAttr[0]);
if(Options::info && Ippl::myNode() == 0) {
cerr << "Start reading input stream \"" << file << "\"." << endl;
if (Options::info && Ippl::myNode() == 0) {
std::cerr << "Start reading input stream \"" << file << "\"." << std::endl;
}
OpalParser().run(new FileStream(file));
if(Options::info && Ippl::myNode() == 0) {
cerr << "End reading input stream \"" << file << "\"." << endl;
if (Options::info && Ippl::myNode() == 0) {
std::cerr << "End reading input stream \"" << file << "\"." << std::endl;
}
}
void Call::parse(Statement &statement) {
void Call::parse(Statement& statement) {
parseShortcut(statement);
}
\ No newline at end of file
}
#ifndef OPAL_Call_HH
#define OPAL_Call_HH
// ------------------------------------------------------------------------
// $RCSfile: Call.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: Call
// Class Call
// The class for OPAL CALL command.
//
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// ------------------------------------------------------------------------
// This file is part of OPAL.
//
// $Date: 2000/03/27 09:33:37 $
// $Author: Andreas Adelmann $
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ------------------------------------------------------------------------
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#ifndef OPAL_Call_HH
#define OPAL_Call_HH
#include "AbstractObjects/Action.h"
// Class Call
// ------------------------------------------------------------------------
/// The CALL command.
class Call: public Action {
public:
......@@ -35,22 +31,22 @@ public:
virtual ~Call();
/// Make clone.
virtual Call *clone(const std::string &name);
virtual Call* clone(const std::string& name);
/// Execute the command.
virtual void execute();
/// Parse command (special for one-attribute command).
virtual void parse(Statement &);
virtual void parse(Statement&);
private:
// Not implemented.
Call(const Call &);
void operator=(const Call &);
Call(const Call&);
void operator=(const Call&);
// Clone constructor.
Call(const std::string &name, Call *parent);
Call(const std::string& name, Call* parent);
};
#endif // OPAL_Call_HH
// ------------------------------------------------------------------------
// $RCSfile: Echo.cpp,v $
// ------------------------------------------------------------------------
// $Release$
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: Echo
// The class for OPAL ECHO commands.
// Class Echo
// The class for OPAL ECHO command.
//
// ------------------------------------------------------------------------
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// $Date: 2000/03/27 09:33:37 $
// $Author: Andreas Adelmann $
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#include "BasicActions/Echo.h"
#include "Attributes/Attributes.h"
#include "Utility/IpplInfo.h"
#include <iostream>
#include <iostream>
// Class Echo
// ------------------------------------------------------------------------
Echo::Echo():
Action(1, "ECHO",
......@@ -34,7 +32,7 @@ Echo::Echo():
}
Echo::Echo(const std::string &name, Echo *parent):
Echo::Echo(const std::string& name, Echo* parent):
Action(name, parent)
{}
......@@ -43,7 +41,7 @@ Echo::~Echo()
{}
Echo *Echo::clone(const std::string &name) {
Echo* Echo::clone(const std::string& name) {
return new Echo(name, this);
}
......@@ -54,6 +52,6 @@ void Echo::execute() {
}
void Echo::parse(Statement &statement) {
void Echo::parse(Statement& statement) {
parseShortcut(statement);
}
\ No newline at end of file
}
#ifndef OPAL_Echo_HH
#define OPAL_Echo_HH
// ------------------------------------------------------------------------
// $RCSfile: Echo.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: Echo
// Class Echo
// The class for OPAL ECHO command.
//
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// ------------------------------------------------------------------------
// This file is part of OPAL.
//
// $Date: 2000/03/27 09:33:37 $
// $Author: Andreas Adelmann $
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ------------------------------------------------------------------------
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#ifndef OPAL_Echo_HH
#define OPAL_Echo_HH
#include "AbstractObjects/Action.h"
// Class Echo
// ------------------------------------------------------------------------
/// The ECHO command.
class Echo: public Action {
public:
......@@ -35,22 +31,22 @@ public:
virtual ~Echo();
/// Make clone.
virtual Echo *clone(const std::string &name);
virtual Echo* clone(const std::string& name);
/// Execute the command.
virtual void execute();
/// Parse command (special for one-attribute command).
virtual void parse(Statement &);
virtual void parse(Statement&);
private:
// Not implemented.
Echo(const Echo &);
void operator=(const Echo &);
Echo(const Echo&);
void operator=(const Echo&);
// Clone constructor.
Echo(const std::string &name, Echo *parent);
Echo(const std::string& name, Echo* parent);
};
#endif // OPAL_Echo_HH
// ------------------------------------------------------------------------
// $RCSfile: Help.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: Help
// The class for OPAL HELP commands.
// Class Help
// The class for OPAL HELP command.
//
// ------------------------------------------------------------------------
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// $Date: 2000/03/27 09:33:37 $
// $Author: Andreas Adelmann $
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#include "BasicActions/Help.h"
#include "AbstractObjects/OpalData.h"
#include "AbstractObjects/Object.h"
#include "AbstractObjects/OpalData.h"
#include "Attributes/Attributes.h"
#include "Utility/IpplInfo.h"
#include <iostream>
// Class Help
// ------------------------------------------------------------------------
Help::Help():
Action(1, "HELP",
"The \"HELP\" statement displays the purpose and attribute "
"types of an object.") {
itsAttr[0] =
Attributes::makeString("NAME", "Name of object for which help is wanted");
itsAttr[0] = Attributes::makeString
("NAME", "Name of object for which help is wanted");
registerOwnership(AttributeHandler::STATEMENT);
}
Help::Help(const std::string &name, Help *parent):
Help::Help(const std::string& name, Help* parent):
Action(name, parent)
{}
......@@ -47,16 +45,16 @@ Help::~Help()
{}
Help *Help::clone(const std::string &name) {
Help* Help::clone(const std::string& name) {
return new Help(name, this);
}
void Help::execute() {
if(itsAttr[0]) {
if (itsAttr[0]) {
std::string name = Attributes::getString(itsAttr[0]);
if(Object *object = OpalData::getInstance()->find(name)) {
if (Object *object = OpalData::getInstance()->find(name)) {
object->printHelp(std::cerr);
} else {
ERRORMSG("\n" << *this << "Unknown object \"" << name << "\".\n"
......@@ -68,6 +66,6 @@ void Help::execute() {
}
void Help::parse(Statement &statement) {
void Help::parse(Statement& statement) {
parseShortcut(statement);
}
\ No newline at end of file
}
#ifndef OPAL_Help_HH
#define OPAL_Help_HH
// ------------------------------------------------------------------------
// $RCSfile: Help.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: Help
// Class Help
// The class for OPAL HELP command.
//
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// ------------------------------------------------------------------------
// This file is part of OPAL.
//
// $Date: 2000/03/27 09:33:37 $
// $Author: Andreas Adelmann $
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ------------------------------------------------------------------------
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#ifndef OPAL_Help_HH
#define OPAL_Help_HH
#include "AbstractObjects/Action.h"
// Class Help
// ------------------------------------------------------------------------
/// The HELP commands.
class Help: public Action {
public:
......@@ -35,22 +31,22 @@ public:
virtual ~Help();
/// Make clone.
virtual Help *clone(const std::string &name);
virtual Help* clone(const std::string& name);
/// Execute the command.
virtual void execute();
/// Parse command (special for one-attribute command).
virtual void parse(Statement &);
virtual void parse(Statement&);
private:
// Not implemented.
Help(const Help &);
void operator=(const Help &);
Help(const Help&);
void operator=(const Help&);
// Clone constructor.
Help(const std::string &name, Help *parent);
Help(const std::string& name, Help* parent);
};
#endif // OPAL_Help_HH
// ------------------------------------------------------------------------
// $RCSfile: PSystem.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.2 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: PSystem
// The class for the OPAL SYSTEM command.
// Class PSystem
// The class for OPAL SYSTEM command in parallel environment.
//
// ------------------------------------------------------------------------
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// $Date: 2002/01/17 22:18:36 $
// $Author: jsberg $
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#include "BasicActions/PSystem.h"
#include "Attributes/Attributes.h"
#include "Utility/IpplInfo.h"
#include <cstdlib>
// Class PSystem
// ------------------------------------------------------------------------
PSystem::PSystem():
Action(1, "PSYSTEM",
......@@ -37,7 +34,7 @@ PSystem::PSystem():
}
PSystem::PSystem(const std::string &name, PSystem *parent):
PSystem::PSystem(const std::string& name, PSystem* parent):
Action(name, parent)
{}
......@@ -46,7 +43,7 @@ PSystem::~PSystem()
{}
PSystem *PSystem::clone(const std::string &name) {
PSystem* PSystem::clone(const std::string& name) {
return new PSystem(name, this);
}
......@@ -59,6 +56,6 @@ void PSystem::execute() {
ERRORMSG("SYSTEM call failed" << endl);
}
void PSystem::parse(Statement &statement) {
void PSystem::parse(Statement& statement) {
parseShortcut(statement);
}
\ No newline at end of file
}
#ifndef OPAL_PSystem_HH
#define OPAL_PSystem_HH
// ------------------------------------------------------------------------
// $RCSfile: PSystem.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: PSystem
// Class PSystem
// The class for OPAL SYSTEM command in parallel environment.
//
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// ------------------------------------------------------------------------
// This file is part of OPAL.
//
// $Date: 2000/03/27 09:33:37 $
// $Author: Andreas Adelmann $
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ------------------------------------------------------------------------
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#ifndef OPAL_PSystem_HH
#define OPAL_PSystem_HH
#include "AbstractObjects/Action.h"
// Class PSystem
// ------------------------------------------------------------------------
/// The SYSTEM command.
class PSystem: public Action {
public:
......@@ -35,22 +31,22 @@ public:
virtual ~PSystem();
/// Make clone.
virtual PSystem *clone(const std::string &name);
virtual PSystem* clone(const std::string& name);
/// Execute the command.
virtual void execute();
/// Parse command (special for one-attribute command).
virtual void parse(Statement &);
virtual void parse(Statement&);
private:
// Not implemented.
PSystem(const PSystem &);
void operator=(const PSystem &);
PSystem(const PSystem&);
void operator=(const PSystem&);
// Clone constructor.
PSystem(const std::string &name, PSystem *parent);
PSystem(const std::string& name, PSystem* parent);
};
#endif // OPAL_PSystem_HH
\ No newline at end of file
#endif // OPAL_PSystem_HH
// ------------------------------------------------------------------------
// $RCSfile: Quit.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: Quit
// The class for the OPAL QUIT command.
// Class Quit
// The class for OPAL QUIT command.
//
// ------------------------------------------------------------------------
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// $Date: 2000/03/27 09:33:37 $
// $Author: Andreas Adelmann $
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#include "BasicActions/Quit.h"
// Class Quit
// ------------------------------------------------------------------------
Quit::Quit(): Action(0, "QUIT",
"The \"QUIT\" statement terminates program execution "
"or reading of a called file.")
{}
Quit::Quit(const std::string &name, Quit *parent):
Quit::Quit(const std::string& name, Quit* parent):
Action(name, parent)
{}
......@@ -37,7 +33,7 @@ Quit::~Quit()
{}
Quit *Quit::clone(const std::string &name) {
Quit* Quit::clone(const std::string& name) {
return new Quit(name, this);
}
......
#ifndef OPAL_Quit_HH
#define OPAL_Quit_HH
// ------------------------------------------------------------------------
// $RCSfile: Quit.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//