CXslTransform::~CXslTransform() { setExternalFunction(SEISINT_NAMESPACE, m_fnMessage.get(), false); if(m_sourceResolver != NULL) delete m_sourceResolver; if (m_xslsource) m_xslsource->clearIncludeHandler(); if(m_ParsedSource) { m_XalanTransformer.destroyParsedSource(m_ParsedSource); m_ParsedSource = NULL; } closeResultTarget(); }
CXslTransform::CXslTransform(IIncludeHandler* handler) : m_XalanTransformer() { m_ParsedSource = 0; m_resultTarget = 0; m_ostrstream = 0; m_sourceResolver = NULL; m_pUserData = NULL; #ifdef _WIN32 m_normalizeLinefeed = true; //default for Xalan #endif if (handler) setIncludeHandler(handler); //set an external function to handle non-fatal XSL messages m_fnMessage.setown(createExternalFunction("message", message)); setExternalFunction(SEISINT_NAMESPACE, m_fnMessage.get(), true); }
fmiStatus fmiSetExternalFunction(fmiComponent c, fmiValueReference vr[], size_t nvr, const void* value[]) { unsigned int i=0; ModelInstance* comp = (ModelInstance *)c; if (invalidState(comp, "fmiTerminate", modelInstantiated)) return fmiError; if (nvr>0 && nullPointer(comp, "fmiSetExternalFunction", "vr[]", vr)) return fmiError; if (nvr>0 && nullPointer(comp, "fmiSetExternalFunction", "value[]", value)) return fmiError; if (comp->loggingOn) comp->functions.logger(c, comp->instanceName, fmiOK, "log", "fmiSetExternalFunction"); // no check wether setting the value is allowed in the current state for (i=0; i<nvr; i++) { if (vrOutOfRange(comp, "fmiSetExternalFunction", vr[i], NUMBER_OF_EXTERNALFUNCTIONS)) return fmiError; if (setExternalFunction(comp, vr[i],value[i]) != fmiOK) // to be implemented by the includer of this file return fmiError; } return fmiOK; }