text: /**
  	* \file PnlWznmCal1NSensitivity.cpp
  	* API code for job PnlWznmCal1NSensitivity (implementation)
  	* \copyright (C) 2016-2020 MPSI Technologies GmbH
  	* \author Alexander Wirthmueller (auto-generation)
  	* \date created: 5 Dec 2020
  	*/
  // IP header --- ABOVE
  
  #include "PnlWznmCal1NSensitivity.h"
  
  using namespace std;
  using namespace Sbecore;
  using namespace Xmlio;
  
  /******************************************************************************
   class PnlWznmCal1NSensitivity::VecVDo
   ******************************************************************************/
  
  uint PnlWznmCal1NSensitivity::VecVDo::getIx(
  			const string& sref
  		) {
  	string s = StrMod::lc(sref);
  
  	if (s == "butrefreshclick") return BUTREFRESHCLICK;
  
  	return(0);
  };
  
  string PnlWznmCal1NSensitivity::VecVDo::getSref(
  			const uint ix
  		) {
  	if (ix == BUTREFRESHCLICK) return("ButRefreshClick");
  
  	return("");
  };
  
  /******************************************************************************
   class PnlWznmCal1NSensitivity::ContInf
   ******************************************************************************/
  
  PnlWznmCal1NSensitivity::ContInf::ContInf(
  			const uint numFCsiQst
  		) :
  			Block()
  		{
  	this->numFCsiQst = numFCsiQst;
  
  	mask = {NUMFCSIQST};
  };
  
  bool PnlWznmCal1NSensitivity::ContInf::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "ContInfWznmCal1NSensitivity");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "ContitemInfWznmCal1NSensitivity";
  
  	if (basefound) {
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "numFCsiQst", numFCsiQst)) add(NUMFCSIQST);
  	};
  
  	return basefound;
  };
  
  set<uint> PnlWznmCal1NSensitivity::ContInf::comm(
  			const ContInf* comp
  		) {
  	set<uint> items;
  
  	if (numFCsiQst == comp->numFCsiQst) insert(items, NUMFCSIQST);
  
  	return(items);
  };
  
  set<uint> PnlWznmCal1NSensitivity::ContInf::diff(
  			const ContInf* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {NUMFCSIQST};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class PnlWznmCal1NSensitivity::StatApp
   ******************************************************************************/
  
  PnlWznmCal1NSensitivity::StatApp::StatApp(
  			const uint ixWznmVExpstate
  		) :
  			Block()
  		{
  	this->ixWznmVExpstate = ixWznmVExpstate;
  
  	mask = {IXWZNMVEXPSTATE};
  };
  
  bool PnlWznmCal1NSensitivity::StatApp::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	string srefIxWznmVExpstate;
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StatAppWznmCal1NSensitivity");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "StatitemAppWznmCal1NSensitivity";
  
  	if (basefound) {
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "srefIxWznmVExpstate", srefIxWznmVExpstate)) {
  			ixWznmVExpstate = VecWznmVExpstate::getIx(srefIxWznmVExpstate);
  			add(IXWZNMVEXPSTATE);
  		};
  	};
  
  	return basefound;
  };
  
  set<uint> PnlWznmCal1NSensitivity::StatApp::comm(
  			const StatApp* comp
  		) {
  	set<uint> items;
  
  	if (ixWznmVExpstate == comp->ixWznmVExpstate) insert(items, IXWZNMVEXPSTATE);
  
  	return(items);
  };
  
  set<uint> PnlWznmCal1NSensitivity::StatApp::diff(
  			const StatApp* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {IXWZNMVEXPSTATE};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class PnlWznmCal1NSensitivity::StgIac
   ******************************************************************************/
  
  PnlWznmCal1NSensitivity::StgIac::StgIac(
  			const uint TcoRefWidth
  		) :
  			Block()
  		{
  	this->TcoRefWidth = TcoRefWidth;
  
  	mask = {TCOREFWIDTH};
  };
  
  bool PnlWznmCal1NSensitivity::StgIac::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StgIacWznmCal1NSensitivity");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "StgitemIacWznmCal1NSensitivity";
  
  	if (basefound) {
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TcoRefWidth", TcoRefWidth)) add(TCOREFWIDTH);
  	};
  
  	return basefound;
  };
  
  void PnlWznmCal1NSensitivity::StgIac::writeXML(
  			xmlTextWriter* wr
  			, string difftag
  			, bool shorttags
  		) {
  	if (difftag.length() == 0) difftag = "StgIacWznmCal1NSensitivity";
  
  	string itemtag;
  	if (shorttags) itemtag = "Si";
  	else itemtag = "StgitemIacWznmCal1NSensitivity";
  
  	xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str());
  		writeUintAttr(wr, itemtag, "sref", "TcoRefWidth", TcoRefWidth);
  	xmlTextWriterEndElement(wr);
  };
  
  set<uint> PnlWznmCal1NSensitivity::StgIac::comm(
  			const StgIac* comp
  		) {
  	set<uint> items;
  
  	if (TcoRefWidth == comp->TcoRefWidth) insert(items, TCOREFWIDTH);
  
  	return(items);
  };
  
  set<uint> PnlWznmCal1NSensitivity::StgIac::diff(
  			const StgIac* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {TCOREFWIDTH};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class PnlWznmCal1NSensitivity::Tag
   ******************************************************************************/
  
  PnlWznmCal1NSensitivity::Tag::Tag(
  			const string& Cpt
  			, const string& TxtRecord1
  			, const string& TxtRecord2
  			, const string& Trs
  			, const string& TxtShowing1
  			, const string& TxtShowing2
  			, const string& TcoRef
  		) :
  			Block()
  		{
  	this->Cpt = Cpt;
  	this->TxtRecord1 = TxtRecord1;
  	this->TxtRecord2 = TxtRecord2;
  	this->Trs = Trs;
  	this->TxtShowing1 = TxtShowing1;
  	this->TxtShowing2 = TxtShowing2;
  	this->TcoRef = TcoRef;
  
  	mask = {CPT, TXTRECORD1, TXTRECORD2, TRS, TXTSHOWING1, TXTSHOWING2, TCOREF};
  };
  
  bool PnlWznmCal1NSensitivity::Tag::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "TagWznmCal1NSensitivity");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "TagitemWznmCal1NSensitivity";
  
  	if (basefound) {
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "Cpt", Cpt)) add(CPT);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TxtRecord1", TxtRecord1)) add(TXTRECORD1);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TxtRecord2", TxtRecord2)) add(TXTRECORD2);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "Trs", Trs)) add(TRS);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TxtShowing1", TxtShowing1)) add(TXTSHOWING1);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TxtShowing2", TxtShowing2)) add(TXTSHOWING2);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TcoRef", TcoRef)) add(TCOREF);
  	};
  
  	return basefound;
  };
  
  /******************************************************************************
   class PnlWznmCal1NSensitivity::DpchAppData
   ******************************************************************************/
  
  PnlWznmCal1NSensitivity::DpchAppData::DpchAppData(
  			const string& scrJref
  			, StgIac* stgiac
  			, QryWznmCal1NSensitivity::StgIac* stgiacqry
  			, const set<uint>& mask
  		) :
  			DpchAppWznm(VecWznmVDpch::DPCHAPPWZNMCAL1NSENSITIVITYDATA, scrJref)
  		{
  	if (find(mask, ALL)) this->mask = {SCRJREF, STGIAC, STGIACQRY};
  	else this->mask = mask;
  
  		if (find(this->mask, STGIAC) && stgiac) this->stgiac = *stgiac;
  		if (find(this->mask, STGIACQRY) && stgiacqry) this->stgiacqry = *stgiacqry;
  };
  
  string PnlWznmCal1NSensitivity::DpchAppData::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(SCRJREF)) ss.push_back("scrJref");
  	if (has(STGIAC)) ss.push_back("stgiac");
  	if (has(STGIACQRY)) ss.push_back("stgiacqry");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void PnlWznmCal1NSensitivity::DpchAppData::writeXML(
  			xmlTextWriter* wr
  		) {
  	xmlTextWriterStartElement(wr, BAD_CAST "DpchAppWznmCal1NSensitivityData");
  	xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm");
  		if (has(SCRJREF)) writeString(wr, "scrJref", scrJref);
  		if (has(STGIAC)) stgiac.writeXML(wr);
  		if (has(STGIACQRY)) stgiacqry.writeXML(wr);
  	xmlTextWriterEndElement(wr);
  };
  
  /******************************************************************************
   class PnlWznmCal1NSensitivity::DpchAppDo
   ******************************************************************************/
  
  PnlWznmCal1NSensitivity::DpchAppDo::DpchAppDo(
  			const string& scrJref
  			, const uint ixVDo
  			, const set<uint>& mask
  		) :
  			DpchAppWznm(VecWznmVDpch::DPCHAPPWZNMCAL1NSENSITIVITYDO, scrJref)
  		{
  	if (find(mask, ALL)) this->mask = {SCRJREF, IXVDO};
  	else this->mask = mask;
  
  	this->ixVDo = ixVDo;
  };
  
  string PnlWznmCal1NSensitivity::DpchAppDo::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(SCRJREF)) ss.push_back("scrJref");
  	if (has(IXVDO)) ss.push_back("ixVDo");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void PnlWznmCal1NSensitivity::DpchAppDo::writeXML(
  			xmlTextWriter* wr
  		) {
  	xmlTextWriterStartElement(wr, BAD_CAST "DpchAppWznmCal1NSensitivityDo");
  	xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm");
  		if (has(SCRJREF)) writeString(wr, "scrJref", scrJref);
  		if (has(IXVDO)) writeString(wr, "srefIxVDo", VecVDo::getSref(ixVDo));
  	xmlTextWriterEndElement(wr);
  };
  
  /******************************************************************************
   class PnlWznmCal1NSensitivity::DpchEngData
   ******************************************************************************/
  
  PnlWznmCal1NSensitivity::DpchEngData::DpchEngData() :
  			DpchEngWznm(VecWznmVDpch::DPCHENGWZNMCAL1NSENSITIVITYDATA)
  		{
  	feedFCsiQst.tag = "FeedFCsiQst";
  };
  
  string PnlWznmCal1NSensitivity::DpchEngData::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(SCRJREF)) ss.push_back("scrJref");
  	if (has(CONTINF)) ss.push_back("continf");
  	if (has(FEEDFCSIQST)) ss.push_back("feedFCsiQst");
  	if (has(STATAPP)) ss.push_back("statapp");
  	if (has(STGIAC)) ss.push_back("stgiac");
  	if (has(TAG)) ss.push_back("tag");
  	if (has(RST)) ss.push_back("rst");
  	if (has(STATAPPQRY)) ss.push_back("statappqry");
  	if (has(STATSHRQRY)) ss.push_back("statshrqry");
  	if (has(STGIACQRY)) ss.push_back("stgiacqry");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void PnlWznmCal1NSensitivity::DpchEngData::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchEngWznmCal1NSensitivityData");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	if (basefound) {
  		if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) add(SCRJREF);
  		if (continf.readXML(docctx, basexpath, true)) add(CONTINF);
  		if (feedFCsiQst.readXML(docctx, basexpath, true)) add(FEEDFCSIQST);
  		if (statapp.readXML(docctx, basexpath, true)) add(STATAPP);
  		if (stgiac.readXML(docctx, basexpath, true)) add(STGIAC);
  		if (tag.readXML(docctx, basexpath, true)) add(TAG);
  		if (rst.readXML(docctx, basexpath, true)) add(RST);
  		if (statappqry.readXML(docctx, basexpath, true)) add(STATAPPQRY);
  		if (statshrqry.readXML(docctx, basexpath, true)) add(STATSHRQRY);
  		if (stgiacqry.readXML(docctx, basexpath, true)) add(STGIACQRY);
  	} else {
  		continf = ContInf();
  		feedFCsiQst.clear();
  		statapp = StatApp();
  		stgiac = StgIac();
  		tag = Tag();
  		rst.clear();
  		statappqry = QryWznmCal1NSensitivity::StatApp();
  		statshrqry = QryWznmCal1NSensitivity::StatShr();
  		stgiacqry = QryWznmCal1NSensitivity::StgIac();
  	};
  };
  