cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ireTask.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Peter Kazanzides
7  Created on: 2010-12-10
8 
9  (C) Copyright 2010 Johns Hopkins University (JHU), All Rights Reserved.
10 
11 --- begin cisst license - do not edit ---
12 
13 This software is provided "as is" under an open source license, with
14 no warranty. The complete license can be found in license.txt and
15 http://www.cisst.org/cisst/license.txt.
16 
17 --- end cisst license ---
18 
19 */
20 
21 
28 #ifndef _ireTask_h
29 #define _ireTask_h
30 
32 
34 
35 
36 //enum IRE_Shell { IRE_WXPYTHON, IRE_IPYTHON, IRE_PYTHON };
38 
46  CMN_DECLARE_SERVICES(CMN_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEFAULT);
47 public:
48  std::string Name;
50  std::string Startup;
51 
53  ireTaskConstructorArg(const std::string &name, IRE_Shell shell = IRE_WXPYTHON, const std::string &startup = "") :
54  mtsGenericObject(), Name(name), Shell(shell), Startup(startup) {}
56  mtsGenericObject(), Name(other.Name), Shell(other.Shell), Startup(other.Startup) {}
58 
59  void SerializeRaw(std::ostream & outputStream) const;
60  void DeSerializeRaw(std::istream & inputStream);
61 
62  void ToStream(std::ostream & outputStream) const;
63 
65  virtual void ToStreamRaw(std::ostream & outputStream, const char delimiter = ' ',
66  bool headerOnly = false, const std::string & headerPrefix = "") const;
67 
70  virtual bool FromStreamRaw(std::istream & inputStream, const char delimiter = ' ');
71 };
72 
74 
78 
79  IRE_Shell Shell;
80  std::string StartupCommands; // startup string
81 
82  void Initialize(void);
83  void Log(const mtsLogMessage & log);
84 
85 public:
86  ireTask(const std::string &name = "IRE",
87  IRE_Shell shell = IRE_WXPYTHON,
88  const std::string &startup = "");
89  ireTask(const ireTaskConstructorArg &arg);
90 
92  virtual ~ireTask();
93 
94  void Startup(void);
95  void Run(void);
96  void Cleanup(void);
97 };
98 
100 
101 #endif // _ireTask_h
102 
~ireTaskConstructorArg()
Definition: ireTask.h:57
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
std::string Name
Definition: ireTask.h:48
IRE_Shell Shell
Definition: ireTask.h:49
void DeSerializeRaw(std::istream &inputStream)
ireTaskConstructorArg(const ireTaskConstructorArg &other)
Definition: ireTask.h:55
Base class for data object in cisstMultiTask.
Definition: mtsGenericObject.h:56
const int CMN_DYNAMIC_CREATION_ONEARG
Definition: cmnClassRegisterMacros.h:333
Defines a continuously executing task.
virtual void ToStreamRaw(std::ostream &outputStream, const char delimiter= ' ', bool headerOnly=false, const std::string &headerPrefix="") const
void SerializeRaw(std::ostream &outputStream) const
virtual void Startup(void)
Definition: mtsComponent.h:262
void Initialize(void)
ireTaskConstructorArg()
Definition: ireTask.h:52
ireTaskConstructorArg(const std::string &name, IRE_Shell shell=IRE_WXPYTHON, const std::string &startup="")
Definition: ireTask.h:53
Macros to export the symbols of cisstInteractive (in a Dll).
IRE_Shell
Definition: ireTask.h:37
virtual bool FromStreamRaw(std::istream &inputStream, const char delimiter= ' ')
Definition: ireTask.h:37
Interactive Research Environment (IRE) Task.
Definition: ireTask.h:45
Definition: ireTask.h:37
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
Definition: ireTask.h:75
CMN_DECLARE_SERVICES_INSTANTIATION(ireTaskConstructorArg)
std::string Startup
Definition: ireTask.h:50
virtual void Run(void)=0
Definition: mtsParameterTypesOld.h:84
void ToStream(std::ostream &outputStream) const
Definition: mtsTaskContinuous.h:77
const int CMN_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:331
virtual void Cleanup(void)
Definition: mtsComponent.h:267
mtsTask BaseType
Definition: mtsTaskContinuous.h:84
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76