/***********************************************************************//** * @brief Construct temporal model from XML element * * @param[in] temporal XML element containing temporal model information. * * @exception GException::model_invalid_temporal * Invalid temporal model type encountered. * * Returns pointer to a temporal model that is defined in an XML element. ***************************************************************************/ GModelTemporal* GCTAModelBackground::xml_temporal(const GXmlElement& temporal) const { // Get temporal model type std::string type = temporal.attribute("type"); // Get temporal model GModelTemporalRegistry registry; GModelTemporal* ptr = registry.alloc(type); // If model if valid then read model from XML file if (ptr != NULL) { ptr->read(temporal); } // ... otherwise throw an exception else { throw GException::model_invalid_temporal(G_XML_TEMPORAL, type); } // Return pointer return ptr; }
/***********************************************************************//** * @brief Signals if sky model is temporally constant * * @return True if sky model is temporally constant, false otherwise. * * Signals if the sky model is temporally constant. A temporally constant * model is a model that has a temporal component of type "Constant". ***************************************************************************/ inline bool GCTAModelIrfBackground::is_constant(void) const { return (m_temporal != NULL && m_temporal->type() == "Constant"); }
/***********************************************************************//** * @brief Signals if model is temporally constant * * @return True if model is temporally constant, false otherwise. * * Signals if the model is temporally constant. A temporally constant model * is a model that has a temporal component of type "Constant". ***************************************************************************/ inline bool GCTAModelRadialAcceptance::is_constant(void) const { return (m_temporal != NULL && m_temporal->type() == "Constant"); }