Exemple #1
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool Pick::detachFrom(PublicObject* object) {
	if ( object == NULL ) return false;

	// check all possible parents
	EventParameters* eventParameters = EventParameters::Cast(object);
	if ( eventParameters != NULL ) {
		// If the object has been added already to the parent locally
		// just remove it by pointer
		if ( object == parent() )
			return eventParameters->remove(this);
		// The object has not been added locally so it must be looked up
		else {
			Pick* child = eventParameters->findPick(publicID());
			if ( child != NULL )
				return eventParameters->remove(child);
			else {
				SEISCOMP_DEBUG("Pick::detachFrom(EventParameters): pick has not been found");
				return false;
			}
		}
	}

	SEISCOMP_ERROR("Pick::detachFrom(%s) -> wrong class type", object->className());
	return false;
}
Exemple #2
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool Route::detachFrom(PublicObject* object) {
	if ( object == NULL ) return false;

	// check all possible parents
	Routing* routing = Routing::Cast(object);
	if ( routing != NULL ) {
		// If the object has been added already to the parent locally
		// just remove it by pointer
		if ( object == parent() )
			return routing->remove(this);
		// The object has not been added locally so it must be looked up
		else {
			Route* child = routing->findRoute(publicID());
			if ( child != NULL )
				return routing->remove(child);
			else {
				SEISCOMP_DEBUG("Route::detachFrom(Routing): route has not been found");
				return false;
			}
		}
	}

	SEISCOMP_ERROR("Route::detachFrom(%s) -> wrong class type", object->className());
	return false;
}
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool MomentTensor::detachFrom(PublicObject* object) {
	if ( object == NULL ) return false;

	// check all possible parents
	FocalMechanism* focalMechanism = FocalMechanism::Cast(object);
	if ( focalMechanism != NULL ) {
		// If the object has been added already to the parent locally
		// just remove it by pointer
		if ( object == parent() )
			return focalMechanism->remove(this);
		// The object has not been added locally so it must be looked up
		else {
			MomentTensor* child = focalMechanism->findMomentTensor(publicID());
			if ( child != NULL )
				return focalMechanism->remove(child);
			else {
				SEISCOMP_DEBUG("MomentTensor::detachFrom(FocalMechanism): momentTensor has not been found");
				return false;
			}
		}
	}

	SEISCOMP_ERROR("MomentTensor::detachFrom(%s) -> wrong class type", object->className());
	return false;
}
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool ResponsePolynomial::detachFrom(PublicObject* object) {
	if ( object == NULL ) return false;

	// check all possible parents
	Inventory* inventory = Inventory::Cast(object);
	if ( inventory != NULL ) {
		// If the object has been added already to the parent locally
		// just remove it by pointer
		if ( object == parent() )
			return inventory->remove(this);
		// The object has not been added locally so it must be looked up
		else {
			ResponsePolynomial* child = inventory->findResponsePolynomial(publicID());
			if ( child != NULL )
				return inventory->remove(child);
			else {
				SEISCOMP_DEBUG("ResponsePolynomial::detachFrom(Inventory): responsePolynomial has not been found");
				return false;
			}
		}
	}

	SEISCOMP_ERROR("ResponsePolynomial::detachFrom(%s) -> wrong class type", object->className());
	return false;
}
Exemple #5
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool ParameterSet::detachFrom(PublicObject* object) {
	if ( object == NULL ) return false;

	// check all possible parents
	Config* config = Config::Cast(object);
	if ( config != NULL ) {
		// If the object has been added already to the parent locally
		// just remove it by pointer
		if ( object == parent() )
			return config->remove(this);
		// The object has not been added locally so it must be looked up
		else {
			ParameterSet* child = config->findParameterSet(publicID());
			if ( child != NULL )
				return config->remove(child);
			else {
				SEISCOMP_DEBUG("ParameterSet::detachFrom(Config): parameterSet has not been found");
				return false;
			}
		}
	}

	SEISCOMP_ERROR("ParameterSet::detachFrom(%s) -> wrong class type", object->className());
	return false;
}
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool StationMagnitude::detachFrom(PublicObject* object) {
	if ( object == NULL ) return false;

	// check all possible parents
	Origin* origin = Origin::Cast(object);
	if ( origin != NULL ) {
		// If the object has been added already to the parent locally
		// just remove it by pointer
		if ( object == parent() )
			return origin->remove(this);
		// The object has not been added locally so it must be looked up
		else {
			StationMagnitude* child = origin->findStationMagnitude(publicID());
			if ( child != NULL )
				return origin->remove(child);
			else {
				SEISCOMP_DEBUG("StationMagnitude::detachFrom(Origin): stationMagnitude has not been found");
				return false;
			}
		}
	}

	SEISCOMP_ERROR("StationMagnitude::detachFrom(%s) -> wrong class type", object->className());
	return false;
}
Exemple #7
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool QCLog::detachFrom(PublicObject* object) {
	if ( object == NULL ) return false;

	// check all possible parents
	QualityControl* qualityControl = QualityControl::Cast(object);
	if ( qualityControl != NULL ) {
		// If the object has been added already to the parent locally
		// just remove it by pointer
		if ( object == parent() )
			return qualityControl->remove(this);
		// The object has not been added locally so it must be looked up
		else {
			QCLog* child = qualityControl->findQCLog(publicID());
			if ( child != NULL )
				return qualityControl->remove(child);
			else {
				SEISCOMP_DEBUG("QCLog::detachFrom(QualityControl): qCLog has not been found");
				return false;
			}
		}
	}

	SEISCOMP_ERROR("QCLog::detachFrom(%s) -> wrong class type", object->className());
	return false;
}
static const nsCatalogData*
LookupCatalogData(const PRUnichar* aPublicID)
{
  nsDependentString publicID(aPublicID);

  // linear search for now since the number of entries is going to
  // be negligible, and the fix for bug 98413 would get rid of this
  // code anyway
  const nsCatalogData* data = kCatalogTable;
  while (data->mPublicID) {
    if (publicID.EqualsASCII(data->mPublicID)) {
      return data;
    }
    ++data;
  }

  return nsnull;
}
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool MomentTensorStationContribution::detachFrom(PublicObject* object) {
	if ( object == NULL ) return false;

	// check all possible parents
	MomentTensor* momentTensor = MomentTensor::Cast(object);
	if ( momentTensor != NULL ) {
		// If the object has been added already to the parent locally
		// just remove it by pointer
		if ( object == parent() )
			return momentTensor->remove(this);
		// The object has not been added locally so it must be looked up
		else {
			MomentTensorStationContribution* child = momentTensor->findMomentTensorStationContribution(publicID());
			if ( child != NULL )
				return momentTensor->remove(child);
			else {
				SEISCOMP_DEBUG("MomentTensorStationContribution::detachFrom(MomentTensor): momentTensorStationContribution has not been found");
				return false;
			}
		}
	}

	SEISCOMP_ERROR("MomentTensorStationContribution::detachFrom(%s) -> wrong class type", object->className());
	return false;
}