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

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 // Class Call
// The class for OPAL "CALL" commands. // 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 $ // This file is part of OPAL.
// $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/>.
// //
// ------------------------------------------------------------------------
#include "BasicActions/Call.h" #include "BasicActions/Call.h"
#include "AbstractObjects/OpalData.h" #include "AbstractObjects/OpalData.h"
#include "Attributes/Attributes.h" #include "Attributes/Attributes.h"
#include "OpalParser/OpalParser.h" #include "OpalParser/OpalParser.h"
...@@ -24,27 +24,22 @@ ...@@ -24,27 +24,22 @@
#include "Utilities/OpalException.h" #include "Utilities/OpalException.h"
#include "Utilities/Options.h" #include "Utilities/Options.h"
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include <iostream>
using std::cerr; #include <iostream>
using std::endl;
// Class Call
// ------------------------------------------------------------------------
Call::Call(): Call::Call():
Action(1, "CALL", Action(1, "CALL",
"The \"CALL\" statement switches input temporarily to the " "The \"CALL\" statement switches input temporarily to the "
"named file.") { "named file.") {
itsAttr[0] = itsAttr[0] = Attributes::makeString
Attributes::makeString("FILE", "Name of file to be read", "CALL"); ("FILE", "Name of file to be read", "CALL");
registerOwnership(AttributeHandler::STATEMENT); registerOwnership(AttributeHandler::STATEMENT);
} }
Call::Call(const std::string &name, Call *parent): Call::Call(const std::string& name, Call* parent):
Action(name, parent) Action(name, parent)
{} {}
...@@ -53,7 +48,7 @@ Call::~Call() ...@@ -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); return new Call(name, this);
} }
...@@ -61,18 +56,18 @@ Call *Call::clone(const std::string &name) { ...@@ -61,18 +56,18 @@ Call *Call::clone(const std::string &name) {
void Call::execute() { void Call::execute() {
std::string file = Attributes::getString(itsAttr[0]); std::string file = Attributes::getString(itsAttr[0]);
if(Options::info && Ippl::myNode() == 0) { if (Options::info && Ippl::myNode() == 0) {
cerr << "Start reading input stream \"" << file << "\"." << endl; std::cerr << "Start reading input stream \"" << file << "\"." << std::endl;
} }
OpalParser().run(new FileStream(file)); OpalParser().run(new FileStream(file));
if(Options::info && Ippl::myNode() == 0) { if (Options::info && Ippl::myNode() == 0) {
cerr << "End reading input stream \"" << file << "\"." << endl; std::cerr << "End reading input stream \"" << file << "\"." << std::endl;
} }
} }
void Call::parse(Statement &statement) { void Call::parse(Statement& statement) {
parseShortcut(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 $ // OPAL is free software: you can redistribute it and/or modify
// $Author: Andreas Adelmann $ // 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" #include "AbstractObjects/Action.h"
// Class Call
// ------------------------------------------------------------------------
/// The CALL command.
class Call: public Action { class Call: public Action {
public: public:
...@@ -35,22 +31,22 @@ public: ...@@ -35,22 +31,22 @@ public:
virtual ~Call(); virtual ~Call();
/// Make clone. /// Make clone.
virtual Call *clone(const std::string &name); virtual Call* clone(const std::string& name);
/// Execute the command. /// Execute the command.
virtual void execute(); virtual void execute();
/// Parse command (special for one-attribute command). /// Parse command (special for one-attribute command).
virtual void parse(Statement &); virtual void parse(Statement&);
private: private:
// Not implemented. // Not implemented.
Call(const Call &); Call(const Call&);
void operator=(const Call &); void operator=(const Call&);
// Clone constructor. // Clone constructor.
Call(const std::string &name, Call *parent); Call(const std::string& name, Call* parent);
}; };
#endif // OPAL_Call_HH #endif // OPAL_Call_HH
// ------------------------------------------------------------------------
// $RCSfile: Echo.cpp,v $
// ------------------------------------------------------------------------
// $Release$
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
// //
// Class: Echo // Class Echo
// The class for OPAL ECHO commands. // 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 $ // This file is part of OPAL.
// $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/>.
// //
// ------------------------------------------------------------------------
#include "BasicActions/Echo.h" #include "BasicActions/Echo.h"
#include "Attributes/Attributes.h" #include "Attributes/Attributes.h"
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include <iostream>
#include <iostream>
// Class Echo
// ------------------------------------------------------------------------
Echo::Echo(): Echo::Echo():
Action(1, "ECHO", Action(1, "ECHO",
...@@ -34,7 +32,7 @@ Echo::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) Action(name, parent)
{} {}
...@@ -43,7 +41,7 @@ Echo::~Echo() ...@@ -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); return new Echo(name, this);
} }
...@@ -54,6 +52,6 @@ void Echo::execute() { ...@@ -54,6 +52,6 @@ void Echo::execute() {
} }
void Echo::parse(Statement &statement) { void Echo::parse(Statement& statement) {
parseShortcut(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 $ // OPAL is free software: you can redistribute it and/or modify
// $Author: Andreas Adelmann $ // 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" #include "AbstractObjects/Action.h"
// Class Echo
// ------------------------------------------------------------------------
/// The ECHO command.
class Echo: public Action { class Echo: public Action {
public: public:
...@@ -35,22 +31,22 @@ public: ...@@ -35,22 +31,22 @@ public:
virtual ~Echo(); virtual ~Echo();
/// Make clone. /// Make clone.
virtual Echo *clone(const std::string &name); virtual Echo* clone(const std::string& name);
/// Execute the command. /// Execute the command.
virtual void execute(); virtual void execute();
/// Parse command (special for one-attribute command). /// Parse command (special for one-attribute command).
virtual void parse(Statement &); virtual void parse(Statement&);
private: private:
// Not implemented. // Not implemented.
Echo(const Echo &); Echo(const Echo&);
void operator=(const Echo &); void operator=(const Echo&);
// Clone constructor. // Clone constructor.
Echo(const std::string &name, Echo *parent); Echo(const std::string& name, Echo* parent);
}; };
#endif // OPAL_Echo_HH #endif // OPAL_Echo_HH
// ------------------------------------------------------------------------
// $RCSfile: Help.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
// //
// Class: Help // Class Help
// The class for OPAL HELP commands. // 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 $ // This file is part of OPAL.
// $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/>.
// //
// ------------------------------------------------------------------------
#include "BasicActions/Help.h" #include "BasicActions/Help.h"
#include "AbstractObjects/OpalData.h"
#include "AbstractObjects/Object.h" #include "AbstractObjects/Object.h"
#include "AbstractObjects/OpalData.h"
#include "Attributes/Attributes.h" #include "Attributes/Attributes.h"
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include <iostream> #include <iostream>
// Class Help
// ------------------------------------------------------------------------
Help::Help(): Help::Help():
Action(1, "HELP", Action(1, "HELP",
"The \"HELP\" statement displays the purpose and attribute " "The \"HELP\" statement displays the purpose and attribute "
"types of an object.") { "types of an object.") {
itsAttr[0] = itsAttr[0] = Attributes::makeString
Attributes::makeString("NAME", "Name of object for which help is wanted"); ("NAME", "Name of object for which help is wanted");
registerOwnership(AttributeHandler::STATEMENT); registerOwnership(AttributeHandler::STATEMENT);
} }
Help::Help(const std::string &name, Help *parent): Help::Help(const std::string& name, Help* parent):
Action(name, parent) Action(name, parent)
{} {}
...@@ -47,16 +45,16 @@ Help::~Help() ...@@ -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); return new Help(name, this);
} }
void Help::execute() { void Help::execute() {
if(itsAttr[0]) { if (itsAttr[0]) {
std::string name = Attributes::getString(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); object->printHelp(std::cerr);
} else { } else {
ERRORMSG("\n" << *this << "Unknown object \"" << name << "\".\n" ERRORMSG("\n" << *this << "Unknown object \"" << name << "\".\n"
...@@ -68,6 +66,6 @@ void Help::execute() { ...@@ -68,6 +66,6 @@ void Help::execute() {
} }
void Help::parse(Statement &statement) { void Help::parse(Statement& statement) {
parseShortcut(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 $ // OPAL is free software: you can redistribute it and/or modify
// $Author: Andreas Adelmann $ // 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" #include "AbstractObjects/Action.h"
// Class Help
// ------------------------------------------------------------------------
/// The HELP commands.
class Help: public Action { class Help: public Action {
public: public:
...@@ -35,22 +31,22 @@ public: ...@@ -35,22 +31,22 @@ public:
virtual ~Help(); virtual ~Help();
/// Make clone. /// Make clone.
virtual Help *clone(const std::string &name); virtual Help* clone(const std::string& name);
/// Execute the command. /// Execute the command.
virtual void execute(); virtual void execute();
/// Parse command (special for one-attribute command). /// Parse command (special for one-attribute command).
virtual void parse(Statement &); virtual void parse(Statement&);
private: private:
// Not implemented. // Not implemented.
Help(const Help &); Help(const Help&);
void operator=(const Help &); void operator=(const Help&);
// Clone constructor. // Clone constructor.
Help(const std::string &name, Help *parent); Help(const std::string& name, Help* parent);
}; };
#endif // OPAL_Help_HH #endif // OPAL_Help_HH
// ------------------------------------------------------------------------
// $RCSfile: PSystem.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.2 $