Commit bb49fd62 authored by Pedro's avatar Pedro
Browse files

Revert "remove duplicated class: PSystem"

This reverts commit 39b0ee09.
parent 39b0ee09
......@@ -8,6 +8,7 @@ set (_SRCS
Select.cpp
Stop.cpp
Quit.cpp
PSystem.cpp
System.cpp
Title.cpp
Value.cpp
......@@ -26,6 +27,7 @@ set (HDRS
Echo.h
Help.h
Option.h
PSystem.h
Quit.h
Select.h
Stop.h
......
// ------------------------------------------------------------------------
// $RCSfile: PSystem.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.2 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: PSystem
// The class for the OPAL SYSTEM command.
//
// ------------------------------------------------------------------------
//
// $Date: 2002/01/17 22:18:36 $
// $Author: jsberg $
//
// ------------------------------------------------------------------------
#include "BasicActions/PSystem.h"
#include "Attributes/Attributes.h"
#include "Utility/IpplInfo.h"
#include <cstdlib>
// Class PSystem
// ------------------------------------------------------------------------
PSystem::PSystem():
Action(1, "PSYSTEM",
"The \"PSYSTEM\" statement sends a command string to the "
"operating system from all nodes.") {
itsAttr[0] = Attributes::makeString
("CMD", "A system command to be executed");
registerOwnership(AttributeHandler::COMMAND);
}
PSystem::PSystem(const std::string &name, PSystem *parent):
Action(name, parent)
{}
PSystem::~PSystem()
{}
PSystem *PSystem::clone(const std::string &name) {
return new PSystem(name, this);
}
void PSystem::execute() {
std::string command = Attributes::getString(itsAttr[0]);
int res = system(command.c_str());
if (res!=0)
ERRORMSG("SYSTEM call failed" << endl);
}
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
//
// ------------------------------------------------------------------------
//
// $Date: 2000/03/27 09:33:37 $
// $Author: Andreas Adelmann $
//
// ------------------------------------------------------------------------
#include "AbstractObjects/Action.h"
// Class PSystem
// ------------------------------------------------------------------------
/// The SYSTEM command.
class PSystem: public Action {
public:
/// Exemplar constructor.
PSystem();
virtual ~PSystem();
/// Make clone.
virtual PSystem *clone(const std::string &name);
/// Execute the command.
virtual void execute();
/// Parse command (special for one-attribute command).
virtual void parse(Statement &);
private:
// Not implemented.
PSystem(const PSystem &);
void operator=(const PSystem &);
// Clone constructor.
PSystem(const std::string &name, PSystem *parent);
};
#endif // OPAL_PSystem_HH
\ No newline at end of file
......@@ -38,6 +38,7 @@
#include "BasicActions/Stop.h"
#include "BasicActions/Quit.h"
#include "BasicActions/System.h"
#include "BasicActions/PSystem.h"
#include "BasicActions/Title.h"
#include "BasicActions/Value.h"
......@@ -149,6 +150,7 @@ namespace {
opal->create(new Select());
opal->create(new Stop());
opal->create(new Quit());
opal->create(new PSystem());
opal->create(new System());
opal->create(new Title());
opal->create(new TrackCmd());
......
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