xc
CommandEntity.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. PĂ©rez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //CommandEntity.h
22 
23 #ifndef ENTCMD_H
24 #define ENTCMD_H
25 
26 #include "EntityWithProperties.h"
27 #include "utility/utils/text/text_string.h"
28 #include "utility/kernel/StandardOutputWrapper.h"
29 
30 namespace boost
31  {
32  class any;
33  }
34 
35 typedef enum{FALLO,CONTINUA,COMPLETADO} resul_lectura;
36 
38 //
41  {
42  private:
43  static StandardOutputWrapper standardOutput;
44  protected:
45  static CommandEntity *entcmd_cast(boost::any &data);
46 
47  template <class T>
48  void string_to(T &,const std::string &) const;
49  public:
50  CommandEntity(CommandEntity *owr= nullptr);
51 
52  CommandEntity *Owner(void);
53  const CommandEntity *Owner(void) const;
54 
55  const StandardOutputWrapper &getStandardOutputWrapper(void) const;
56  StandardOutputWrapper &getStandardOutputWrapper(void);
57  const std::string &getLogFileName(void) const;
58  void setLogFileName(const std::string &);
59  const std::string &getErrFileName(void) const;
60  void setErrFileName(const std::string &);
61  const std::string &getOutputFileName(void) const;
62  void setOutputFileName(const std::string &);
63  static void resetStandardOutput(void);
64 
65  boost::python::object evalPy(boost::python::object dict,const std::string &);
66  boost::python::object execPy(boost::python::object dict,const std::string &);
67  boost::python::object execFilePy(boost::python::object dict,const std::string &);
68  };
69 
70 #endif
Definition: FT_matrix.h:89
Object that can return properties as Python objects.
Definition: EntityWithProperties.h:32
Objet that can execute python scripts.
Definition: CommandEntity.h:40
Standard output redirection.
Definition: StandardOutputWrapper.h:35