Loading...
Searching...
No Matches
src
drain
prog
Program.h
1
/*
2
3
MIT License
4
5
Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6
7
Permission is hereby granted, free of charge, to any person obtaining a copy
8
of this software and associated documentation files (the "Software"), to deal
9
in the Software without restriction, including without limitation the rights
10
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
copies of the Software, and to permit persons to whom the Software is
12
furnished to do so, subject to the following conditions:
13
14
The above copyright notice and this permission notice shall be included in all
15
copies or substantial portions of the Software.
16
17
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
SOFTWARE.
24
25
*/
26
/*
27
Part of Rack development has been done in the BALTRAD projects part-financed
28
by the European Union (European Regional Development Fund and European
29
Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30
*/
31
32
// New design (2020)
33
34
#ifndef DRAIN_PROGRAM_H_
35
#define DRAIN_PROGRAM_H_
36
37
// #include <iostream>
38
39
#include <drain/Sprinter.h>
40
41
#include "CommandSequence.h"
42
#include "Command.h"
43
44
45
namespace
drain
{
46
48
52
//class Program : public CommandSequence<std::pair<std::string,Command *> > {
53
class
Program
:
public
CommandSequence
<std::pair<std::string,Command *> >,
public
Contextual
{
54
55
public
:
56
57
inline
58
Program
(){};
59
60
inline
61
Program
(
const
Program
&prog){
62
std::cerr <<
"Program copy ctor: ctx?\n"
;
63
};
64
65
inline
66
Program
(
Context
& ctx){
67
setExternalContext
(ctx);
68
};
69
70
71
Command
& add(
const
std::string & key,
Command
& cmd);
72
73
// Return
74
iterator add(
const
std::string & key,
Command
& cmd, iterator pos);
75
77
void
run
()
const
;
78
79
};
80
82
//class ProgramVector : public std::vector<Program> {
83
class
ProgramVector
:
public
std::map<int,Program> {
84
85
public
:
86
88
Program
&
add
(
Context
& ctx);
89
90
void
debug();
91
92
};
93
94
95
96
}
/* namespace drain */
97
98
#endif
/* DRAINLET_H_ */
99
100
// Rack
drain::CommandSequence
A base class for Script and Program.
Definition
CommandSequence.h:48
drain::Command
Base class for commands: typically actions taking parameters but also plain variable assignments and ...
Definition
Command.h:55
drain::Context
Definition
Context.h:58
drain::Contextual
Definition
Context.h:249
drain::Contextual::setExternalContext
void setExternalContext(Context &ctx)
Sets internal contextPtr to outside target.
Definition
Context.h:278
drain::ProgramVector
Structure for implementing threads in parallelized OpenMP for loop.
Definition
Program.h:83
drain::ProgramVector::add
Program & add(Context &ctx)
Adds a new, empty program to thread vector.
Definition
Program.cpp:96
drain::Program
Sequence consisting of Command:s retrieved from a CommandBank.
Definition
Program.h:53
drain::Program::run
void run() const
Main.
Definition
Program.cpp:75
drain
Definition
DataSelector.cpp:1277
Generated by
1.9.8