//! //! Constructor of the VTKAreaLayoutNode class. //! //! \param name The name for the new node. //! \param parameterRoot A copy of the parameter tree specific for the type of the node. //! VTKAreaLayoutNode::VTKAreaLayoutNode ( const QString &name, ParameterGroup *parameterRoot ) : Node(name, parameterRoot), m_ouputVTKTableParameterName("VTKTableOutput"), m_inputVTKTreeName("VTKTreeInput"), m_layoutInstance(0), m_outputTable(0), m_inputVTKTree(0) { setTypeName("VTKAreaLayoutNode"); // create the vtk tree input parameter VTKTreeParameter * inputVTKTreeParameter = new VTKTreeParameter(m_inputVTKTreeName); inputVTKTreeParameter->setMultiplicity(1); inputVTKTreeParameter->setPinType(Parameter::PT_Input); inputVTKTreeParameter->setSelfEvaluating(true); parameterRoot->addParameter(inputVTKTreeParameter); connect(inputVTKTreeParameter, SIGNAL(dirtied()), SLOT(processOutputVTKTable())); // create the mandatory vtk table output parameter VTKTableParameter * outputVTKTableParameter = new VTKTableParameter(m_ouputVTKTableParameterName); outputVTKTableParameter->setPinType(Parameter::PT_Output); parameterRoot->addParameter(outputVTKTableParameter); // link the input parameter to the output processing if (outputVTKTableParameter) { outputVTKTableParameter->setProcessingFunction(SLOT(processOutputVTKTable())); outputVTKTableParameter->addAffectingParameter(inputVTKTreeParameter); } INC_INSTANCE_COUNTER }
bool CommonObject::init() { setObjectType(ObjectType::COMMON_OBJECT); setTypeName(""); registerWithTouchDispatcher(); return true; }
/** * Sets up a template. * * @param parent The parent of this UMLTemplate (i.e. its concept). * @param name The name of this UMLTemplate. * @param id The unique id given to this UMLTemplate. * @param type The type of this UMLTemplate. */ UMLTemplate::UMLTemplate(UMLObject *parent, const QString& name, Uml::ID::Type id, const QString& type) : UMLClassifierListItem(parent, name, id) { setTypeName(type); m_BaseType = UMLObject::ot_Template; }
//! //! Constructor of the TextDelimiterSourceNode class. //! //! \param name The name to give the new mesh node. //! \param parameterRoot A copy of the parameter tree specific for the type of the node. //! TextDelimiterSourceNode::TextDelimiterSourceNode ( const QString &name, ParameterGroup *parameterRoot ) : VTKTableNode (name, parameterRoot, "VTKTable"), m_dtxt(0) { // set affections and functions setChangeFunction("Source File", SLOT(sourceFileChanged())); setCommandFunction("Source File", SLOT(sourceFileChanged())); setChangeFunction("Field Delimiter Characters", SLOT(fieldDelimiterChanged())); setCommandFunction("Field Delimiter Characters", SLOT(fieldDelimiterChanged())); setChangeFunction("String Delimiter", SLOT(stringDelimiterChanged())); setCommandFunction("String Delimiter", SLOT(stringDelimiterChanged())); setChangeFunction("Use String Delimiter", SLOT(useStringDelimiterChanged())); setCommandFunction("Use String Delimiter", SLOT(useStringDelimiterChanged())); setChangeFunction("Have Header", SLOT(haveHeaderChanged())); setCommandFunction("Have Header", SLOT(haveHeaderChanged())); setChangeFunction("Merge Consecutive Delimiters", SLOT(mergeConsecutiveDelimitersChanged())); setCommandFunction("Merge Consecutive Delimiters", SLOT(mergeConsecutiveDelimitersChanged())); setChangeFunction("MaxRecords", SLOT(maxRecordsChanged())); setCommandFunction("MaxRecords", SLOT(maxRecordsChanged())); setChangeFunction("Detect Numeric Columns", SLOT(detectNumericColumnsChanged())); setCommandFunction("Detect Numeric Columns", SLOT(detectNumericColumnsChanged())); setTypeName("TextDelimiterSourceNode"); INC_INSTANCE_COUNTER }
//! //! Constructor of the ClusteringLayouterNode class. //! //! \param name The name for the new node. //! \param parameterRoot A copy of the parameter tree specific for the type of the node. //! ClusteringLayouterNode::ClusteringLayouterNode ( const QString &name, ParameterGroup *parameterRoot ) : VTKGraphLayoutNode(name, parameterRoot) { setTypeName("ClusteringLayouterNode"); m_layoutInstance = vtkClustering2DLayoutStrategy::New(); setChangeFunction("Set Random Seed", SLOT(processParameters())); setCommandFunction("Set Random Seed", SLOT(processParameters())); setChangeFunction("Set Max Number Of Iterations", SLOT(processParameters())); setCommandFunction("Set Max Number Of Iterations", SLOT(processParameters())); setChangeFunction("Set Iterations Per Layout", SLOT(processParameters())); setCommandFunction("Set Iterations Per Layout", SLOT(processParameters())); setChangeFunction("Set Initial Temperature", SLOT(processParameters())); setCommandFunction("Set Initial Temperature", SLOT(processParameters())); setChangeFunction("Set Cool Down Rate", SLOT(processParameters())); setCommandFunction("Set Cool Down Rate", SLOT(processParameters())); setChangeFunction("Set Rest Distance", SLOT(processParameters())); setCommandFunction("Set Rest Distance", SLOT(processParameters())); INC_INSTANCE_COUNTER }
PictureItem::PictureItem(View *parent, const QImage &image) : ViewItem(parent) { if (!image.isNull()) { _image = QPixmap::fromImage(image); } setTypeName("Picture"); setLockAspectRatio(true); setLockAspectRatioFixed(true); }
CircleItem::CircleItem(View *parent) : ViewItem(parent), _circleEditDialog(0) { setTypeName("Circle"); setBrush(Qt::white); setLockAspectRatio(true); setLockAspectRatioFixed(true); applyDialogDefaultsStroke(); applyDialogDefaultsFill(); applyDialogDefaultsLockPosToData(); }
ArrowItem::ArrowItem(View *parent) : LineItem(parent), _startArrowHead(false), _endArrowHead(true), _startArrowScale(12.0), _endArrowScale(12.0) { setTypeName("Arrow"); QBrush b = brush(); b.setStyle(Qt::SolidPattern); setBrush(b); }
LineItem::LineItem(View *parent) : ViewItem(parent), _lineEditDialog(0) { _created = false; setTypeName(tr("Line", "a line in a picture")); setAllowedGrips(RightMidGrip | LeftMidGrip); setAllowedGripModes(Resize); setAllowsLayout(false); QPen p = pen(); p.setWidthF(1); storePen(p); applyDialogDefaultsStroke(); applyDialogDefaultsLockPosToData(); }
QgsWFSDataSourceURI::QgsWFSDataSourceURI( const QString& uri ) : mURI( uri ) { // Compatiblity with QGIS < 2.16 layer URI of the format // http://example.com/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=x&SRSNAME=y&username=foo&password= if ( !mURI.hasParam( QgsWFSConstants::URI_PARAM_URL ) ) { QUrl url( uri ); QString srsname = url.queryItemValue( "SRSNAME" ); QString bbox = url.queryItemValue( "BBOX" ); QString typeName = url.queryItemValue( "TYPENAME" ); QString filter = url.queryItemValue( "FILTER" ); mAuth.mUserName = url.queryItemValue( QgsWFSConstants::URI_PARAM_USERNAME ); mAuth.mPassword = url.queryItemValue( QgsWFSConstants::URI_PARAM_PASSWORD ); mAuth.mAuthCfg = url.queryItemValue( QgsWFSConstants::URI_PARAM_AUTHCFG ); // Now remove all stuff that is not the core URL url.removeQueryItem( "SERVICE" ); url.removeQueryItem( "VERSION" ); url.removeQueryItem( "TYPENAME" ); url.removeQueryItem( "REQUEST" ); url.removeQueryItem( "BBOX" ); url.removeQueryItem( "SRSNAME" ); url.removeQueryItem( "FILTER" ); url.removeQueryItem( QgsWFSConstants::URI_PARAM_USERNAME ); url.removeQueryItem( QgsWFSConstants::URI_PARAM_PASSWORD ); url.removeQueryItem( QgsWFSConstants::URI_PARAM_AUTHCFG ); mURI = QgsDataSourceUri(); mURI.setParam( QgsWFSConstants::URI_PARAM_URL, url.toEncoded() ); setTypeName( typeName ); setSRSName( srsname ); //if the xml comes from the dialog, it needs to be a string to pass the validity test if ( filter.startsWith( '\'' ) && filter.endsWith( '\'' ) && filter.size() > 1 ) { filter.chop( 1 ); filter.remove( 0, 1 ); } setFilter( filter ); if ( !bbox.isEmpty() ) mURI.setParam( QgsWFSConstants::URI_PARAM_RESTRICT_TO_REQUEST_BBOX, "1" ); } else { mAuth.mUserName = mURI.param( QgsWFSConstants::URI_PARAM_USERNAME ); mAuth.mPassword = mURI.param( QgsWFSConstants::URI_PARAM_PASSWORD ); mAuth.mAuthCfg = mURI.param( QgsWFSConstants::URI_PARAM_AUTHCFG ); } }
//! //! Constructor of the XmlTreeReaderNode class. //! //! \param name The name for the new node. //! \param parameterRoot A copy of the parameter tree specific for the type of the node. //! XmlTreeReaderNode::XmlTreeReaderNode ( const QString &name, ParameterGroup *parameterRoot ) : VTKTreeNode (name, parameterRoot, "VTKTree"), m_xmltree(0) { // set affections and functions setChangeFunction("Source File", SLOT(sourceFileChanged())); setCommandFunction("Source File", SLOT(sourceFileChanged())); connect(this, SIGNAL(frameChanged(int)), SLOT(updateAll())); setTypeName("XmlTreeReaderNode"); INC_INSTANCE_COUNTER }
bool CircleObject::init() { setIsDrag(false); setObjectType(ObjectType::CIRCLE_OBJECT); setTypeName("CircleObject"); m_drawnode = CCDrawNode::create(); addChild(m_drawnode); registerWithTouchDispatcher(); setBorderColor(ccc4f(1, 0, 0, 1)); setFillColor(ccc4f(0.5, 0.5, 0.5, 0.5)); m_radius = 10; return true; }
LayoutBoxItem::LayoutBoxItem(View *parent) : ViewItem(parent) { setAllowsLayout(false); setTypeName("Layout Box"); storePen(Qt::NoPen); setBrush(Qt::NoBrush); setAllowedGripModes(Move); view()->scene()->addItem(this); setPos(view()->sceneRect().topLeft()); setViewRect(view()->sceneRect()); setEnabled(true); }
ArrowItem::ArrowItem(View *parent) : LineItem(parent), _startArrowHead(false), _endArrowHead(true), _startArrowScale(12.0), _endArrowScale(12.0) { setTypeName("Arrow"); QBrush b = brush(); b.setStyle(Qt::SolidPattern); b.setColor(pen().color()); setBrush(b); applyDialogDefaultsStroke(); applyDialogDefaultsLockPosToData(); applyDialogDefaultsHeads(); }
//! //! Constructor of the TreeOrbitLayouterNode class. //! //! \param name The name for the new node. //! \param parameterRoot A copy of the parameter tree specific for the type of the node. //! TreeOrbitLayouterNode::TreeOrbitLayouterNode ( const QString &name, ParameterGroup *parameterRoot ) : VTKTreeLayoutNode(name, parameterRoot) { setTypeName("TreeOrbitLayouterNode"); m_layoutInstance = vtkTreeOrbitLayoutStrategy::New(); setChangeFunction("Set Log Spacing Value", SLOT(setLogSpacingValue())); setCommandFunction("Set Log Spacing Value", SLOT(setLogSpacingValue())); setChangeFunction("Set Leaf Spacing", SLOT(setLeafSpacing())); setCommandFunction("Set Leaf Spacing", SLOT(setLeafSpacing())); setChangeFunction("Set Child Radius Factor", SLOT(setChildRadiusFactor())); setCommandFunction("Set Child Radius Factor", SLOT(setChildRadiusFactor())); INC_INSTANCE_COUNTER }
SvgItem::SvgItem(View *parent, const QString &file) : ViewItem(parent) { if (!file.isNull()) { _svg = new QSvgRenderer(file); QFile svgfile(file); if (svgfile.open(QIODevice::ReadOnly | QIODevice::Text)) { while (!svgfile.atEnd()) { _svgData.append(svgfile.readLine()); } } } else { _svg = new QSvgRenderer(); } setTypeName("Svg"); setLockAspectRatio(true); setLockAspectRatioFixed(true); }
//! //! Constructor of the ThreeDCirclesLayouterNode class. //! //! \param name The name for the new node. //! \param parameterRoot A copy of the parameter tree specific for the type of the node. //! ThreeDCirclesLayouterNode::ThreeDCirclesLayouterNode ( const QString &name, ParameterGroup *parameterRoot ) : VTKGraphLayoutNode(name, parameterRoot) { setTypeName("ThreeDCirclesLayouterNode"); m_layoutInstance = vtkSimple3DCirclesStrategy::New(); // These properties relate to graph layout // none for this layout // These properties relate specifically to the layout strategy setChangeFunction("Set Method", SLOT(setMethod())); setCommandFunction("Set Method", SLOT(setMethod())); setChangeFunction("Set Radius", SLOT(setRadius())); setCommandFunction("Set Radius", SLOT(setRadius())); setChangeFunction("Set Height", SLOT(setHeight())); setCommandFunction("Set Height", SLOT(setHeight())); setChangeFunction("Set Marked Start Vertices", SLOT(setMarkedStartVertices())); setCommandFunction("Set Marked Start Vertices", SLOT(setMarkedStartVertices())); setChangeFunction("Set Marked Value", SLOT(setMarkedValue())); setCommandFunction("Set Marked Value", SLOT(setMarkedValue())); setChangeFunction("Set Force To Use Universal Start Points Finder", SLOT(setForceToUseUniversalStartPointsFinder())); setCommandFunction("Set Force To Use Universal Start Points Finder", SLOT(setForceToUseUniversalStartPointsFinder())); setChangeFunction("Set Auto Height", SLOT(setAutoHeight())); setCommandFunction("Set Auto Height", SLOT(setAutoHeight())); setChangeFunction("Set Minimum Radian", SLOT(setMinimumRadian())); setCommandFunction("Set Minimum Radian", SLOT(setMinimumRadian())); setChangeFunction("Set Minimum Degree", SLOT(setMinimumDegree())); setCommandFunction("Set Minimum Degree", SLOT(setMinimumDegree())); setChangeFunction("Set Hierarchical Layers", SLOT(setHierarchicalLayers())); setCommandFunction("Set Hierarchical Layers", SLOT(setHierarchicalLayers())); INC_INSTANCE_COUNTER }
LegendItem::LegendItem(PlotItem *parentPlot) : ViewItem(parentPlot->view()), _plotItem(parentPlot), _auto(true), _verticalDisplay(true) { setTypeName(tr("Legend", "a legend in a plot")); _initializeShortName(); setFixedSize(true); setAllowedGripModes(Move /*| Resize*/ /*| Rotate*/ /*| Scale*/); setViewRect(0.0, 0.0, 0.0, 0.0); view()->scene()->addItem(this); setParentViewItem(_plotItem->renderItem()); QPointF origin = QPointF(_plotItem->plotRect().width() * 0.15, _plotItem->plotRect().height() * 0.15); setPos(origin); applyDefaults(); applyDialogDefaultsStroke(); applyDialogDefaultsFill(); applyDialogDefaultsLockPosToData(); }
SharedAxisBoxItem::SharedAxisBoxItem(View *parent) : ViewItem(parent), _layout(0), _loaded(false), _firstPaint(true), _dirty(false), _shareX(true), _shareY(true), _xAxisZoomMode(PlotAxis::Auto), _yAxisZoomMode(PlotAxis::Auto), _sharedIsDirty(false) { setTypeName("Shared Axis Box"); setBrush(Qt::transparent); _breakAction = new QAction(tr("Break Shared Axis Box"), this); _breakAction->setShortcut(Qt::Key_B); registerShortcut(_breakAction); connect(_breakAction, SIGNAL(triggered()), this, SLOT(breakShare())); connect(this, SIGNAL(breakShareSignal()), this, SLOT(breakShare())); }
/** * Construct this Entry from XML. This member has to remain synchronized * with the detailed DTD in operations-engines.dtd * * @param e Engine XML element */ /*public*/ Engine::Engine(QDomElement e) : RollingStock(e) // MUST create the rolling stock first! { common(); QString a; // must set _model first so locomotive hp, length, type and weight is set properly if ((a = e.attribute (Xml::MODEL)) != NULL) { _model = a; } if ((a = e.attribute (Xml::HP)) != NULL) { setHp(a); } if ((a = e.attribute (Xml::LENGTH)) != NULL) { setLength(a); } if ((a = e.attribute (Xml::TYPE)) != NULL) { setTypeName(a); } if ((a = e.attribute (Xml::WEIGHT_TONS)) != NULL) { setWeightTons(a); } if ((a = e.attribute(Xml::B_UNIT)) != NULL) { setBunit(a == (Xml::_TRUE)); } if ((a = e.attribute (Xml::CONSIST)) != NULL) { Consist* c = EngineManager::instance()->getConsistByName(a); if (c != NULL) { setConsist(c); if ((a = e.attribute (Xml::LEAD_CONSIST)) != NULL && a==(Xml::_TRUE)) { _consist->setLead(this); } if ((a = e.attribute (Xml::CONSIST_NUM)) != NULL) { _consist->setConsistNumber(a.toInt()); } } else { log->error("Consist " + a + " does not exist"); } } addPropertyChangeListeners(); }
//! //! Constructor of the ConeTreeLayouterNode class. //! //! \param name The name for the new node. //! \param parameterRoot A copy of the parameter tree specific for the type of the node. //! ConeTreeLayouterNode::ConeTreeLayouterNode ( const QString &name, ParameterGroup *parameterRoot ) : VTKTreeLayoutNode(name, parameterRoot), m_CompactnessNameParameter("Set Compactness"), m_CompressionNameParameter("Set Compression"), m_SpacingNameParameter("Set Spacing") { setTypeName("ConeTreeLayouterNode"); m_layoutInstance = vtkConeLayoutStrategy::New(); setChangeFunction("Set Compactness", SLOT(processParameters())); setCommandFunction("Set Compactness", SLOT(processParameters())); setChangeFunction("Set Compression", SLOT(processParameters())); setCommandFunction("Set Compression", SLOT(processParameters())); setChangeFunction("Set Spacing", SLOT(processParameters())); setCommandFunction("Set Spacing", SLOT(processParameters())); INC_INSTANCE_COUNTER }
/*public*/ void Engine::propertyChange(PropertyChangeEvent* e) { RollingStock::propertyChange(e); if (e->getPropertyName()==(EngineTypes::ENGINETYPES_NAME_CHANGED_PROPERTY)) { if (e->getOldValue()==(getTypeName())) { if (log->isDebugEnabled()) { log->debug(tr("Loco (%1 %2) sees type name change old: (%3) new: (%4)").arg(toString()).arg(e->getOldValue().toString()).arg(e ->getNewValue().toString())); // NOI18N } setTypeName(e->getNewValue().toString()); } } if (e->getPropertyName()==(EngineLengths::ENGINELENGTHS_NAME_CHANGED_PROPERTY)) { if (e->getOldValue().toString()==(getLength())) { if (log->isDebugEnabled()) { log->debug(tr("Loco (%1) sees length name change old: %2 new: %3").arg(toString()).arg(e->getOldValue().toString()).arg(e ->getNewValue().toString())); // NOI18N } setLength( e->getNewValue().toString()); } } }
//! //! Constructor of the VTKGraphLayoutNode class. //! //! \param name The name for the new node. //! \param parameterRoot A copy of the parameter tree specific for the type of the node. //! VTKGraphLayoutNode::VTKGraphLayoutNode ( const QString &name, ParameterGroup *parameterRoot ) : VTKLayoutNode(name, parameterRoot), m_inputVTKGraphName("VTKGraphInput"), m_zRangeParameterName("ZRange"), m_inGraph(0) { setTypeName("VTKGraphLayoutNode"); // create the mandatory vtk graph input parameter VTKGraphParameter * inputVTKGraphParameter = new VTKGraphParameter(m_inputVTKGraphName); inputVTKGraphParameter->setMultiplicity(1); inputVTKGraphParameter->setPinType(Parameter::PT_Input); inputVTKGraphParameter->setSelfEvaluating(true); parameterRoot->addParameter(inputVTKGraphParameter); connect(inputVTKGraphParameter, SIGNAL(dirtied()), SLOT(processParameters())); // create the mandatory SetZRange parameter NumberParameter * zRangeParameter = new NumberParameter(m_zRangeParameterName, Parameter::T_Float, QVariant::fromValue<double>(0)); parameterRoot->addParameter(zRangeParameter); connect(zRangeParameter, SIGNAL(dirtied()), SLOT(processParameters())); INC_INSTANCE_COUNTER }
void CObjectClassesHandler::loadObjectEntry(const std::string & identifier, const JsonNode & entry, ObjectContainter * obj) { if (!handlerConstructors.count(obj->handlerName)) { logGlobal->error("Handler with name %s was not found!", obj->handlerName); return; } std::string convertedId = VLC->modh->normalizeIdentifier(entry.meta, "core", identifier); si32 id = selectNextID(entry["index"], obj->subObjects, 1000); auto handler = handlerConstructors.at(obj->handlerName)(); handler->setType(obj->id, id); handler->setTypeName(obj->identifier, convertedId); if (customNames.count(obj->id) && customNames.at(obj->id).size() > id) handler->init(entry, customNames.at(obj->id).at(id)); else handler->init(entry); if (handler->getTemplates().empty()) { auto range = legacyTemplates.equal_range(std::make_pair(obj->id, id)); for (auto & templ : boost::make_iterator_range(range.first, range.second)) { handler->addTemplate(templ.second); } legacyTemplates.erase(range.first, range.second); } logGlobal->debug("Loaded object %s(%d)::%s(%d)", obj->identifier, obj->id, convertedId, id); assert(!obj->subObjects.count(id)); // DO NOT override obj->subObjects[id] = handler; obj->subIds[convertedId] = id; }
CodeValue::CodeValue(const CodeValue& rhs) : Object(), StringValue(rhs), mErrorValue(0) { //Do NOT copy mErrorValue object setTypeName("SourceCode"); }
CodeValue::CodeValue(const QString &value) : StringValue(value), mErrorValue(0) { setTypeName("SourceCode"); }
CodeValue::CodeValue() : StringValue(), mErrorValue(0) { setTypeName("SourceCode"); }
void DatatypeValidator::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<<fAnonymous; serEng<<fFinite; serEng<<fBounded; serEng<<fNumeric; serEng<<fWhiteSpace; serEng<<fFinalSet; serEng<<fFacetsDefined; serEng<<fFixed; serEng<<(int)fType; serEng<<(int)fOrdered; storeDV(serEng, fBaseValidator); /*** * Serialize RefHashTableOf<KVStringPair> ***/ XTemplateSerializer::storeObject(fFacets, serEng); serEng.writeString(fPattern); if (fTypeUri==XMLUni::fgZeroLenString) { serEng<<TYPENAME_ZERO; } else if (fTypeUri == SchemaSymbols::fgURI_SCHEMAFORSCHEMA) { serEng<<TYPENAME_S4S; serEng.writeString(fTypeLocalName); } else { serEng<<TYPENAME_NORMAL; serEng.writeString(fTypeLocalName); serEng.writeString(fTypeUri); } /*** * don't serialize * fRegex ***/ } else { serEng>>fAnonymous; serEng>>fFinite; serEng>>fBounded; serEng>>fNumeric; serEng>>fWhiteSpace; serEng>>fFinalSet; serEng>>fFacetsDefined; serEng>>fFixed; int type; serEng>>type; fType=(ValidatorType)type; serEng>>type; fOrdered = (XSSimpleTypeDefinition::ORDERING)type; fBaseValidator = loadDV(serEng); /*** * * Deserialize RefHashTableOf<KVStringPair> * ***/ XTemplateSerializer::loadObject(&fFacets, 29, true, serEng); serEng.readString(fPattern); /*** * Recreate through setTypeName() * fTypeName ***/ int flag; serEng>>flag; if ( TYPENAME_ZERO == flag ) { setTypeName(0); } else if ( TYPENAME_S4S == flag ) { XMLCh* typeLocalName; serEng.readString(typeLocalName); ArrayJanitor<XMLCh> janName(typeLocalName, fMemoryManager); setTypeName(typeLocalName); } else // TYPENAME_NORMAL { XMLCh* typeLocalName; serEng.readString(typeLocalName); ArrayJanitor<XMLCh> janName(typeLocalName, fMemoryManager); XMLCh* typeUri; serEng.readString(typeUri); ArrayJanitor<XMLCh> janUri(typeUri, fMemoryManager); setTypeName(typeLocalName, typeUri); } /*** * don't serialize fRegex ***/ fRegex = new (fMemoryManager) RegularExpression(fPattern, SchemaSymbols::fgRegEx_XOption, fMemoryManager); } }
void DatatypeValidator::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<<fAnonymous; serEng<<fWhiteSpace; serEng<<fFinalSet; serEng<<fFacetsDefined; serEng<<fFixed; serEng<<(int)fType; serEng<<(int)fOrdered; serEng<<fFinite; serEng<<fBounded; serEng<<fNumeric; /*** * don't serialize the fBaseValidator if it is a built-in ***/ if (isBuiltInDV(fBaseValidator)) { serEng<<true; serEng.writeString(fBaseValidator->getTypeName()); } else { serEng<<false; storeDV(serEng, fBaseValidator); } /*** * Serialize RefHashTableOf<KVStringPair> ***/ XTemplateSerializer::storeObject(fFacets, serEng); serEng.writeString(fPattern); /*** * don't serialize * fRegex * fTypeLocalName * fTypeUri ***/ serEng.writeString(fTypeName); } else { serEng>>fAnonymous; serEng>>fWhiteSpace; serEng>>fFinalSet; serEng>>fFacetsDefined; serEng>>fFixed; int type; serEng>>type; fType=(ValidatorType)type; serEng>>type; fOrdered = (XSSimpleTypeDefinition::ORDERING)type; serEng>>fFinite; serEng>>fBounded; serEng>>fNumeric; /*** * * get the basevalidator's type * ***/ bool isBuiltInDV = false; serEng>>isBuiltInDV; if (isBuiltInDV) { XMLCh* baseTypeName; serEng.readString(baseTypeName); ArrayJanitor<XMLCh> janName(baseTypeName, fMemoryManager); /*** * Link to the fBuiltInRegistry * * Since DatatypeValidatorFactory is always the first one * to be deserialized in SchemaGrammar, we are sure that * the BuiltInRegistry shall be available now. ***/ fBaseValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(baseTypeName); } else { fBaseValidator = loadDV(serEng); } /*** * * Deserialize RefHashTableOf<KVStringPair> * ***/ XTemplateSerializer::loadObject(&fFacets, 29, true, serEng); serEng.readString(fPattern); /*** * don't serialize fRegex ***/ fRegex = 0; /*** * Recreate through setTypeName() * fTypeName * fTypeLocalName * fTypeUri ***/ XMLCh* typeName; serEng.readString(typeName); ArrayJanitor<XMLCh> janName(typeName, fMemoryManager); setTypeName(typeName); } }