source: branches/work_304/core/ARAssignHelper.h @ 368

Revision 368, 3.2 KB checked in by jls17, 6 years ago (diff)
  • added support for filterApi calls (input-mapping, output-mapping, creates field-references)
Line 
1//Copyright (C) 2009 Stefan Nerlich | stefan.nerlich@hotmail.com
2//
3//This file is part of ARInside.
4//
5//    ARInside is free software: you can redistribute it and/or modify
6//    it under the terms of the GNU General Public License as published by
7//    the Free Software Foundation, version 2 of the License.
8//
9//    ARInside is distributed in the hope that it will be useful,
10//    but WITHOUT ANY WARRANTY; without even the implied warranty of
11//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12//    GNU General Public License for more details.
13//
14//    You should have received a copy of the GNU General Public License
15//    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
16
17#pragma once
18#include "ARValue.h"
19#include "../output/Table.h"
20#include "../output/TableRow.h"
21#include "../ARInside.h"
22
23using namespace OUTPUT;
24
25class CARAssignHelper
26{
27public:
28        CARAssignHelper(CARInside& arIn, int rootLevel, const CARServerObject& obj, const CARSchema& schema1, const CARSchema& schema2);
29        CARAssignHelper(CARInside& arIn, int rootLevel, const CARServerObject& obj, int schemaId1, int schemaId2);
30        CARAssignHelper(CARInside& arIn, int rootLevel, const CARServerObject& obj, const string& schemaName1, const string& schemaName2);
31
32        ~CARAssignHelper(void);
33
34        bool pushFieldFlag;
35
36        string PushFieldsAssignment(const ARPushFieldsActionStruct &action, int nAction, IfElseState ifElse);
37        string SetFieldsAssignment(const ARSetFieldsActionStruct &action, int nAction, IfElseState ifElse);
38        string OpenWindowAssignment(const ARFieldAssignList &action, int nAction, IfElseState ifElse, OpenWindowMode openCloseInfo);
39        string ServiceAssignment(const ARFieldAssignList &action, int nAction, IfElseState ifElse, ServiceMappingMode serviceInfo);
40        string FilterApiInputAssignment(const ARAssignStruct* assignList, int numItems, int nAction, IfElseState ifElse);
41
42private:
43        unsigned int CheckAssignment(int targetFieldId, ARAssignStruct* parentAssignment, IfElseState ifElse, int nAction, ARAssignStruct &assignment, stringstream &assignText, const CRefItem& refItem);
44
45        void AssignValue(int targetFieldId, IfElseState ifElse, ARValueStruct &v, stringstream &assignText, const CRefItem& refItem);   
46        void AssignField(IfElseState ifElse, int nAction, ARAssignFieldStruct &v, stringstream &assignText, const CRefItem& refItem);
47        void AssignProcess(IfElseState ifElse, char *v, stringstream &assignText, const CRefItem& refItem);
48        void AssignFunction(int targetFieldId, IfElseState ifElse, int nAction, ARFunctionAssignStruct &v, stringstream &assignText, const  CRefItem& refItem);
49        void AssignDDE(IfElseState ifElse, ARDDEStruct &v, stringstream &assignText, const CRefItem& refItem);
50        void AssignSQL(IfElseState ifElse, ARAssignSQLStruct &v, stringstream &assignText, const CRefItem& refItem);   
51        void AssignFilterApi(IfElseState ifElse, ARAssignFilterApiStruct &v, stringstream &assignText, const CRefItem& refItem);       
52
53private:
54        enum AssignmentMode
55        {
56                AM_SETFIELDS,
57                AM_PUSHFIELD,
58                AM_OPENWINDOW,
59                AM_SERVICE,
60                AM_FILTERAPI_INPUT,
61        };
62
63        CARInside *arIn;
64        CARServerObject* object;
65
66        int schemaInsideId1;
67        int schemaInsideId2;
68        int rootLevel;
69        AssignmentMode mode;
70};
Note: See TracBrowser for help on using the repository browser.