PLearn 0.1
|
#include <ShellScript.h>
Public Member Functions | |
ShellScript () | |
Default constructor. | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual ShellScript * | deepCopy (CopiesMap &copies) const |
virtual void | build () |
Post-constructor. | |
virtual void | makeDeepCopyFromShallowCopy (CopiesMap &copies) |
Transforms a shallow copy into a deep copy. | |
virtual void | run () |
Execute the shell commands. | |
Static Public Member Functions | |
static string | _classname_ () |
static OptionList & | _getOptionList_ () |
static RemoteMethodMap & | _getRemoteMethodMap_ () |
static Object * | _new_instance_for_typemap_ () |
static bool | _isa_ (const Object *o) |
static void | _static_initialize_ () |
static const PPath & | declaringFile () |
Public Attributes | |
TVec< string > | shell_commands |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Static Protected Member Functions | |
static void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Private Types | |
typedef Object | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 52 of file ShellScript.h.
typedef Object PLearn::ShellScript::inherited [private] |
Reimplemented from PLearn::Object.
Definition at line 57 of file ShellScript.h.
PLearn::ShellScript::ShellScript | ( | ) |
Default constructor.
Definition at line 49 of file ShellScript.cc.
{ // ... // ### You may or may not want to call build_() to finish building the object // build_(); }
string PLearn::ShellScript::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
OptionList & PLearn::ShellScript::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
RemoteMethodMap & PLearn::ShellScript::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
Object * PLearn::ShellScript::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
StaticInitializer ShellScript::_static_initializer_ & PLearn::ShellScript::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
void PLearn::ShellScript::build | ( | ) | [virtual] |
Post-constructor.
The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.
Reimplemented from PLearn::Object.
Definition at line 89 of file ShellScript.cc.
{ inherited::build(); build_(); }
void PLearn::ShellScript::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::Object.
Definition at line 77 of file ShellScript.cc.
{ // ### This method should do the real building of the object, // ### according to set 'options', in *any* situation. // ### Typical situations include: // ### - Initial building of an object from a few user-specified options // ### - Building of a "reloaded" object: i.e. from the complete set of all serialised options. // ### - Updating or "re-building" of an object after a few "tuning" options have been modified. // ### You should assume that the parent class' build_() has already been called. }
string PLearn::ShellScript::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
void PLearn::ShellScript::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declares this class' options.
Reimplemented from PLearn::Object.
Definition at line 62 of file ShellScript.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), and shell_commands.
{ // ### Declare all of this object's options here // ### For the "flags" of each option, you should typically specify // ### one of OptionBase::buildoption, OptionBase::learntoption or // ### OptionBase::tuningoption. Another possible flag to be combined with // ### is OptionBase::nosave declareOption(ol, "shell_commands", &ShellScript::shell_commands, OptionBase::buildoption, "The commands to be executed at run time."); // Now call the parent class' declareOptions inherited::declareOptions(ol); }
static const PPath& PLearn::ShellScript::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::Object.
Definition at line 102 of file ShellScript.h.
ShellScript * PLearn::ShellScript::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
OptionList & PLearn::ShellScript::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
OptionMap & PLearn::ShellScript::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
RemoteMethodMap & PLearn::ShellScript::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 60 of file ShellScript.cc.
void PLearn::ShellScript::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::Object.
Definition at line 95 of file ShellScript.cc.
References PLearn::deepCopyField().
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(shell_commands, copies); }
void PLearn::ShellScript::run | ( | ) | [virtual] |
Execute the shell commands.
Reimplemented from PLearn::Object.
Definition at line 104 of file ShellScript.cc.
References i.
{ // Perform the commands provided in shell_commands. for (int i = 0; i < shell_commands.length(); i++) { system(shell_commands[i].c_str()); } }
Reimplemented from PLearn::Object.
Definition at line 102 of file ShellScript.h.
Definition at line 73 of file ShellScript.h.
Referenced by declareOptions().