text: /**
  	* \file QryWdbePinAPar.cpp
  	* API code for job QryWdbePinAPar (implementation)
  	* \copyright (C) 2016-2020 MPSI Technologies GmbH
  	* \author Alexander Wirthmueller (auto-generation)
  	* \date created: 5 Dec 2020
  	*/
  // IP header --- ABOVE
  
  #include "QryWdbePinAPar.h"
  
  using namespace std;
  using namespace Sbecore;
  using namespace Xmlio;
  
  /******************************************************************************
   class QryWdbePinAPar::StatApp
   ******************************************************************************/
  
  QryWdbePinAPar::StatApp::StatApp(
  			const uint firstcol
  			, const uint jnumFirstdisp
  			, const uint ncol
  			, const uint ndisp
  		) :
  			Block()
  		{
  	this->firstcol = firstcol;
  	this->jnumFirstdisp = jnumFirstdisp;
  	this->ncol = ncol;
  	this->ndisp = ndisp;
  
  	mask = {FIRSTCOL, JNUMFIRSTDISP, NCOL, NDISP};
  };
  
  bool QryWdbePinAPar::StatApp::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StatAppQryWdbePinAPar");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "StatitemAppQryWdbePinAPar";
  
  	if (basefound) {
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "firstcol", firstcol)) add(FIRSTCOL);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "jnumFirstdisp", jnumFirstdisp)) add(JNUMFIRSTDISP);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ncol", ncol)) add(NCOL);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ndisp", ndisp)) add(NDISP);
  	};
  
  	return basefound;
  };
  
  set<uint> QryWdbePinAPar::StatApp::comm(
  			const StatApp* comp
  		) {
  	set<uint> items;
  
  	if (firstcol == comp->firstcol) insert(items, FIRSTCOL);
  	if (jnumFirstdisp == comp->jnumFirstdisp) insert(items, JNUMFIRSTDISP);
  	if (ncol == comp->ncol) insert(items, NCOL);
  	if (ndisp == comp->ndisp) insert(items, NDISP);
  
  	return(items);
  };
  
  set<uint> QryWdbePinAPar::StatApp::diff(
  			const StatApp* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {FIRSTCOL, JNUMFIRSTDISP, NCOL, NDISP};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class QryWdbePinAPar::StatShr
   ******************************************************************************/
  
  QryWdbePinAPar::StatShr::StatShr(
  			const uint ntot
  			, const uint jnumFirstload
  			, const uint nload
  		) :
  			Block()
  		{
  	this->ntot = ntot;
  	this->jnumFirstload = jnumFirstload;
  	this->nload = nload;
  
  	mask = {NTOT, JNUMFIRSTLOAD, NLOAD};
  };
  
  bool QryWdbePinAPar::StatShr::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StatShrQryWdbePinAPar");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "StatitemShrQryWdbePinAPar";
  
  	if (basefound) {
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ntot", ntot)) add(NTOT);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "jnumFirstload", jnumFirstload)) add(JNUMFIRSTLOAD);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "nload", nload)) add(NLOAD);
  	};
  
  	return basefound;
  };
  
  set<uint> QryWdbePinAPar::StatShr::comm(
  			const StatShr* comp
  		) {
  	set<uint> items;
  
  	if (ntot == comp->ntot) insert(items, NTOT);
  	if (jnumFirstload == comp->jnumFirstload) insert(items, JNUMFIRSTLOAD);
  	if (nload == comp->nload) insert(items, NLOAD);
  
  	return(items);
  };
  
  set<uint> QryWdbePinAPar::StatShr::diff(
  			const StatShr* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {NTOT, JNUMFIRSTLOAD, NLOAD};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class QryWdbePinAPar::StgIac
   ******************************************************************************/
  
  QryWdbePinAPar::StgIac::StgIac(
  			const uint jnum
  			, const uint jnumFirstload
  			, const uint nload
  		) :
  			Block()
  		{
  	this->jnum = jnum;
  	this->jnumFirstload = jnumFirstload;
  	this->nload = nload;
  
  	mask = {JNUM, JNUMFIRSTLOAD, NLOAD};
  };
  
  bool QryWdbePinAPar::StgIac::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StgIacQryWdbePinAPar");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "StgitemIacQryWdbePinAPar";
  
  	if (basefound) {
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "jnum", jnum)) add(JNUM);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "jnumFirstload", jnumFirstload)) add(JNUMFIRSTLOAD);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "nload", nload)) add(NLOAD);
  	};
  
  	return basefound;
  };
  
  void QryWdbePinAPar::StgIac::writeXML(
  			xmlTextWriter* wr
  			, string difftag
  			, bool shorttags
  		) {
  	if (difftag.length() == 0) difftag = "StgIacQryWdbePinAPar";
  
  	string itemtag;
  	if (shorttags) itemtag = "Si";
  	else itemtag = "StgitemIacQryWdbePinAPar";
  
  	xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str());
  		writeUintAttr(wr, itemtag, "sref", "jnum", jnum);
  		writeUintAttr(wr, itemtag, "sref", "jnumFirstload", jnumFirstload);
  		writeUintAttr(wr, itemtag, "sref", "nload", nload);
  	xmlTextWriterEndElement(wr);
  };
  
  set<uint> QryWdbePinAPar::StgIac::comm(
  			const StgIac* comp
  		) {
  	set<uint> items;
  
  	if (jnum == comp->jnum) insert(items, JNUM);
  	if (jnumFirstload == comp->jnumFirstload) insert(items, JNUMFIRSTLOAD);
  	if (nload == comp->nload) insert(items, NLOAD);
  
  	return(items);
  };
  
  set<uint> QryWdbePinAPar::StgIac::diff(
  			const StgIac* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {JNUM, JNUMFIRSTLOAD, NLOAD};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  