Commit 39b0ee09 authored by Pedro's avatar Pedro
Browse files

remove duplicated class: PSystem

parent 5b44baf7
...@@ -8,7 +8,6 @@ set (_SRCS ...@@ -8,7 +8,6 @@ set (_SRCS
Select.cpp Select.cpp
Stop.cpp Stop.cpp
Quit.cpp Quit.cpp
PSystem.cpp
System.cpp System.cpp
Title.cpp Title.cpp
Value.cpp Value.cpp
...@@ -27,7 +26,6 @@ set (HDRS ...@@ -27,7 +26,6 @@ set (HDRS
Echo.h Echo.h
Help.h Help.h
Option.h Option.h
PSystem.h
Quit.h Quit.h
Select.h Select.h
Stop.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,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include "BasicActions/Stop.h" #include "BasicActions/Stop.h"
#include "BasicActions/Quit.h" #include "BasicActions/Quit.h"
#include "BasicActions/System.h" #include "BasicActions/System.h"
#include "BasicActions/PSystem.h"
#include "BasicActions/Title.h" #include "BasicActions/Title.h"
#include "BasicActions/Value.h" #include "BasicActions/Value.h"
...@@ -150,7 +149,6 @@ namespace { ...@@ -150,7 +149,6 @@ namespace {
opal->create(new Select()); opal->create(new Select());
opal->create(new Stop()); opal->create(new Stop());
opal->create(new Quit()); opal->create(new Quit());
opal->create(new PSystem());
opal->create(new System()); opal->create(new System());
opal->create(new Title()); opal->create(new Title());
opal->create(new TrackCmd()); 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