Blame view

src/ExternLib/Timestamp/TimestampCreator.hh 5.66 KB
3b7530a6   Erdogan Furkan   # 6598- Creation ...
1
2
3
4
5
6
7
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/*
be29edb9   Erdogan Furkan   #6598 / #10557 / ...
8
 * File:   TimestampCreator.hh
3b7530a6   Erdogan Furkan   # 6598- Creation ...
9
10
 * Author: Furkan - AKKA I&S
 *
be29edb9   Erdogan Furkan   #6598 / #10557 / ...
11
 * Created on September 26, 2022, 4:14 PM
3b7530a6   Erdogan Furkan   # 6598- Creation ...
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 */

#ifndef TIMESTAMPCREATOR_HH
#define TIMESTAMPCREATOR_HH

#include "ParamData.hh"
#include "VisitorOfParamData.hh"
#include "Timestamp_op.hh"

namespace AMDA
{
    namespace Parameters
    {
        class TimestampCreator : public VisitorOfParamData
        {
        public:
be29edb9   Erdogan Furkan   #6598 / #10557 / ...
28
29
            TimestampCreator(Process &pProcess, ParamData &paramInput, bool isTimeFrom, double timeFrom = 0.0)
                : _process(pProcess), _paramData(paramInput), _isTimeFrom(isTimeFrom), _timeFrom(timeFrom), _operation(NULL)
3b7530a6   Erdogan Furkan   # 6598- Creation ...
30
            {
3b7530a6   Erdogan Furkan   # 6598- Creation ...
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
                _paramData.accept(*this);
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataScalaireShort *)
             */
            void visit(ParamDataScalaireShort *)
            {
                create<ParamDataScalaireShort>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataScalaireFloat *)
             */
            void visit(ParamDataScalaireFloat *)
            {
                create<ParamDataScalaireFloat>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataScalaireDouble *)
             */
            void visit(ParamDataScalaireDouble *)
            {
                create<ParamDataScalaireDouble>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataScalaireLongDouble *)
             */
            void visit(ParamDataScalaireLongDouble *)
            {
                create<ParamDataScalaireLongDouble>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataScalaireInt *)
             */
            void visit(ParamDataScalaireInt *)
            {
                create<ParamDataScalaireInt>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataLogicalData *)
             */
            void visit(ParamDataLogicalData *)
            {
                create<ParamDataLogicalData>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab1DShort *)
             */
            void visit(ParamDataTab1DShort *)
            {
                create<ParamDataTab1DShort>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab1DFloat *)
             */
            void visit(ParamDataTab1DFloat *)
            {
                create<ParamDataTab1DFloat>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab1DDouble *)
             */
            void visit(ParamDataTab1DDouble *)
            {
                create<ParamDataTab1DDouble>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab1DLongDouble *)
             */
            void visit(ParamDataTab1DLongDouble *)
            {
               create<ParamDataTab1DLongDouble>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab1DInt *)
             */
            void visit(ParamDataTab1DInt *)
            {
                create<ParamDataTab1DInt>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab1DLogicalData *)
             */
            void visit(ParamDataTab1DLogicalData *)
            {
                create<ParamDataTab1DLogicalData>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab2DShort *)
             */
            void visit(ParamDataTab2DShort *)
            {
                create<ParamDataTab2DShort>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab2DFloat *)
             */
            void visit(ParamDataTab2DFloat *)
            {
                create<ParamDataTab2DFloat>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab2DDouble *)
             */
            void visit(ParamDataTab2DDouble *)
            {
                create<ParamDataTab2DDouble>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab2DLongDouble *)
             */
            void visit(ParamDataTab2DLongDouble *)
            {
                create<ParamDataTab2DLongDouble>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab2DInt *)
             */
            void visit(ParamDataTab2DInt *)
            {
                create<ParamDataTab2DInt>();
            }

            /**
             * @overload VisitorOfParamData::visit(ParamDataTab2DLogicalData *)
             */
            void visit(ParamDataTab2DLogicalData *)
            {
                create<ParamDataTab2DLogicalData>();
            }

            /**
             * @brief get the TimeShifted parameterized operation.
             */
            Operation *getOperation() const
            {
                return _operation;
            }

            template <typename ParamDataType>
            void create()
            {
be29edb9   Erdogan Furkan   #6598 / #10557 / ...
189
190
                _operation = new Timestamp_op<ParamDataType>(_process, dynamic_cast<ParamDataType &>(_paramData), _isTimeFrom, _timeFrom);
                
3b7530a6   Erdogan Furkan   # 6598- Creation ...
191
192
193
194
195
            }

        private:
            Process &_process;
            ParamData &_paramData;
be29edb9   Erdogan Furkan   #6598 / #10557 / ...
196
197
            bool _isTimeFrom;
            double _timeFrom;
3b7530a6   Erdogan Furkan   # 6598- Creation ...
198
199
200
201
202
            Operation *_operation;
        };
    }
}

be29edb9   Erdogan Furkan   #6598 / #10557 / ...
203
#endif /* TIMESTAMPCREATOR_HH */