Commit b0254856fa79be8adc6f3afb450281fff1201fda
1 parent
fc7667ab
Exists in
master
and in
63 other branches
preparing things
Showing
2 changed files
with
126 additions
and
0 deletions
Show diff stats
src/ExternLib/StatisticFunctions/ProcessStatisticCorrelation.cc
0 → 100644
... | ... | @@ -0,0 +1,72 @@ |
1 | +/* | |
2 | + * To change this license header, choose License Headers in Project Properties. | |
3 | + * To change this template file, choose Tools | Templates | |
4 | + * and open the template in the editor. | |
5 | + */ | |
6 | + | |
7 | +/* | |
8 | + * File: ProcessStatisticCorrelation.c++ | |
9 | + * Author: hacene | |
10 | + * | |
11 | + * Created on September 24, 2021, 4:36 PM | |
12 | + */ | |
13 | + | |
14 | + | |
15 | +#include <stdlib.h> | |
16 | +#include <string> | |
17 | + | |
18 | +#include "AMDA_exception.hh" | |
19 | +#include "DicError.hh" | |
20 | + | |
21 | +#include "Operation.hh" | |
22 | +#include "ParameterManager.hh" | |
23 | +#include "ParameterCreatorFromExpression.hh" | |
24 | + | |
25 | +#include "ProcessStatisticCorrelation.hh" | |
26 | + | |
27 | +namespace AMDA { | |
28 | + namespace Parameters { | |
29 | + | |
30 | + ProcessStatisticCorrelation::ProcessStatisticCorrelation(Parameter ¶meter) | |
31 | + : MultiParamProcess_CRTP(parameter) { | |
32 | + } | |
33 | + | |
34 | + ProcessStatisticCorrelation::ProcessStatisticCorrelation(const ProcessStatisticCorrelation& orig) { | |
35 | + } | |
36 | + | |
37 | + ProcessStatisticCorrelation::~ProcessStatisticCorrelation() { | |
38 | + } | |
39 | + | |
40 | + void ProcessStatisticCorrelation::parse() { | |
41 | + ParameterCreatorFromExpression creator(_parameter.getParameterManager()); | |
42 | + ParameterSPtr lParameter = creator.getOneParameterFromExpression(_parameter, _expression, isUserProcess()); | |
43 | + _paramNameList[lParameter->getId()].first = lParameter; | |
44 | + _orderParamNameList.push_back(lParameter->getId()); | |
45 | + /// get other Parameter in attribute list | |
46 | + if (_attributList.size() < 2) { | |
47 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_PROCESS_ERR) << AMDA::ex_msg(std::string("ProcessStatisticCorrelation::parse required at least two attribute'"))); | |
48 | + } | |
49 | + for (auto param : _attributList) { | |
50 | + lParameter = creator.getOneParameterFromExpression(_parameter, param, isUserProcess()); | |
51 | + _paramNameList[lParameter->getId()].first = lParameter; | |
52 | + _orderParamNameList.push_back(lParameter->getId()); | |
53 | + } | |
54 | + } | |
55 | + | |
56 | + void ProcessStatisticCorrelation::establishConnection() { | |
57 | + parse(); | |
58 | + MultiParamProcess::establishConnection(); | |
59 | + } | |
60 | + | |
61 | + TimeStamp ProcessStatisticCorrelation::init() { | |
62 | + TimeStamp timeStamp = MultiParamProcess::init(); | |
63 | + | |
64 | + /// ParamData result Type is the same as the ParamData input | |
65 | + ParamData* lFirstParamInput = _paramNameList[_orderParamNameList[0]].first->getParamData(this).get(); | |
66 | + ParamData* SecondParamInput = _paramNameList[_orderParamNameList[2]].first->getParamData(this).get(); | |
67 | + | |
68 | + return timeStamp; | |
69 | + } | |
70 | + | |
71 | + } | |
72 | +} | |
0 | 73 | \ No newline at end of file | ... | ... |
src/ExternLib/StatisticFunctions/ProcessStatisticCorrelation.hh
0 → 100644
... | ... | @@ -0,0 +1,54 @@ |
1 | +/* | |
2 | + * To change this license header, choose License Headers in Project Properties. | |
3 | + * To change this template file, choose Tools | Templates | |
4 | + * and open the template in the editor. | |
5 | + */ | |
6 | + | |
7 | +/* | |
8 | + * File: ProcessStatisticCorrelation.hh | |
9 | + * Author: hacene | |
10 | + * | |
11 | + * Created on September 24, 2021, 4:36 PM | |
12 | + */ | |
13 | + | |
14 | +#ifndef PROCESSSTATISTICCORRELATION_HH | |
15 | +#define PROCESSSTATISTICCORRELATION_HH | |
16 | + | |
17 | +#include "MultiParamProcess.hh" | |
18 | +namespace AMDA { | |
19 | + namespace Parameters { | |
20 | + | |
21 | + class ProcessStatisticCorrelation : public AMDA::Parameters::MultiParamProcess_CRTP<MergeProcess>{ | |
22 | + public: | |
23 | + ProcessStatisticCorrelation(AMDA::Parameters::Parameter ¶meter); | |
24 | + ProcessStatisticCorrelation(const ProcessStatisticCorrelation& pProcess, AMDA::Parameters::Parameter &pParameter); | |
25 | + virtual ~ProcessStatisticCorrelation(); | |
26 | + /** | |
27 | + * @overload Process::establishConnection() | |
28 | + */ | |
29 | + void establishConnection(); | |
30 | + /** | |
31 | + * @overload Process::init() | |
32 | + */ | |
33 | + TimeStamp init(); | |
34 | + protected: | |
35 | + | |
36 | + /** | |
37 | + * @brief If the expression is not a Single parameter, | |
38 | + * it must ask the creation of a parameter responsible of the formula calculation. | |
39 | + */ | |
40 | + void parse(); | |
41 | + | |
42 | + private: | |
43 | + /** | |
44 | + * @brief list of param name intput | |
45 | + * @detail | |
46 | + */ | |
47 | + std::vector<std::string> _orderParamNameList; | |
48 | + | |
49 | + }; | |
50 | + | |
51 | + } | |
52 | +} | |
53 | +#endif /* PROCESSSTATISTICCORRELATION_HH */ | |
54 | + | ... | ... |