本文整理汇总了C++中XMLAttributes::readInto方法的典型用法代码示例。如果您正苦于以下问题:C++ XMLAttributes::readInto方法的具体用法?C++ XMLAttributes::readInto怎么用?C++ XMLAttributes::readInto使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XMLAttributes
的用法示例。
在下文中一共展示了XMLAttributes::readInto方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readAttributes
/** @cond doxygenLibsbmlInternal */
void RenderPoint::readAttributes (const XMLAttributes& attributes, const ExpectedAttributes& expectedAttributes)
{
SBase::readAttributes(attributes, expectedAttributes);
std::string s;
if(attributes.readInto("x",s, getErrorLog(), false, getLine(), getColumn()))
{
this->mXOffset=RelAbsVector(s);
}
else
{
this->mXOffset=RelAbsVector(std::numeric_limits<double>::quiet_NaN(),std::numeric_limits<double>::quiet_NaN());
}
if(attributes.readInto("y",s, getErrorLog(), false, getLine(), getColumn()))
{
this->mYOffset=RelAbsVector(s);
}
else
{
this->mYOffset=RelAbsVector(std::numeric_limits<double>::quiet_NaN(),std::numeric_limits<double>::quiet_NaN());
}
if(attributes.readInto("z",s, getErrorLog(), false, getLine(), getColumn()))
{
this->mZOffset=RelAbsVector(s);
}
else
{
this->mZOffset=RelAbsVector(0.0,0.0);
}
}
示例2:
/*
* Subclasses should override this method to read values from the given
* XMLAttributes set into their specific fields. Be sure to call your
* parents implementation of this method as well.
*/
void
CompositeDescription::readAttributes (const XMLAttributes& attributes)
{
NMBase::readAttributes(attributes);
const unsigned int level = NMBase::getLevel ();
const unsigned int version = NMBase::getVersion();
std::vector<std::string> expectedAttributes;
expectedAttributes.clear();
expectedAttributes.push_back("metaid");
expectedAttributes.push_back("id");
expectedAttributes.push_back("name");
expectedAttributes.push_back("ontologyTerm");
expectedAttributes.push_back("indexType");
// check that all attributes are expected
for (int i = 0; i < attributes.getLength(); i++)
{
std::vector<std::string>::const_iterator end = expectedAttributes.end();
std::vector<std::string>::const_iterator begin = expectedAttributes.begin();
std::string name = attributes.getName(i);
if (std::find(begin, end, name) == end)
{
logUnknownAttribute(name, level, version, "<compositeDescription>");
}
}
attributes.readInto("id", mId);
attributes.readInto("name", mName);
attributes.readInto("ontologyTerm", mOntologyTerm);
attributes.readInto("indexType", mIndexType);
}
示例3: getLevel
/*
* Subclasses should override this method to read values from the given
* XMLAttributes set into their specific fields. Be sure to call your
* parents implementation of this method as well.
*/
void
Trigger::readL3Attributes (const XMLAttributes& attributes)
{
const unsigned int level = getLevel ();
const unsigned int version = getVersion();
//
// initailValue { use="required"} (L3v1 ->)
//
mIsSetInitialValue = attributes.readInto("initialValue",
mInitialValue, getErrorLog(), false, getLine(), getColumn());
if (!mIsSetInitialValue)
{
logError(AllowedAttributesOnTrigger, level, version,
"The required attribute 'initialValue' is missing.");
}
//
// persistent { use="required"} (L3v1 ->)
//
mIsSetPersistent = attributes.readInto("persistent",
mPersistent, getErrorLog(), false, getLine(), getColumn());
if (!mIsSetPersistent)
{
logError(AllowedAttributesOnTrigger, level, version,
"The required attribute 'persistent' is missing.");
}
}
示例4: if
/*
* Read values from the given XMLAttributes set into their specific fields.
*/
void
SedSubTask::readAttributes(const XMLAttributes& attributes,
const ExpectedAttributes& expectedAttributes)
{
SedBase::readAttributes(attributes, expectedAttributes);
bool assigned = false;
//
// order int ( use = "required" )
//
mIsSetOrder = attributes.readInto("order", mOrder, getErrorLog(), true);
//
// task SIdRef ( use = "required" )
//
assigned = attributes.readInto("task", mTask, getErrorLog(), true);
if (assigned == true)
{
// check string is not empty and correct syntax
if (mTask.empty() == true)
{
logEmptyString(mTask, getLevel(), getVersion(), "<SedSubTask>");
}
else if (SyntaxChecker::isValidSBMLSId(mTask) == false)
{
logError(SedInvalidIdSyntax);
}
}
}
示例5: getLevel
/** @cond doxygenLibsbmlInternal */
void
GeneAssociation::readAttributes (const XMLAttributes& attributes,
const ExpectedAttributes& expectedAttributes)
{
SBase::readAttributes(attributes,expectedAttributes);
const unsigned int sbmlLevel = getLevel ();
const unsigned int sbmlVersion = getVersion();
bool assigned = attributes.readInto("id", mId, getErrorLog(), true, getLine(), getColumn());
if (assigned && mId.empty())
{
logEmptyString(mId, sbmlLevel, sbmlVersion, "<geneAssociation>");
}
if (!SyntaxChecker::isValidSBMLSId(mId))
logError(InvalidIdSyntax, sbmlLevel, sbmlVersion, "The id '" + mId + "' does not conform to the syntax.");
assigned = attributes.readInto("reaction", mReaction, getErrorLog(), true, getLine(), getColumn());
if (assigned && mReaction.empty())
{
logEmptyString(mReaction, sbmlLevel, sbmlVersion, "<geneAssociation>");
}
if (!SyntaxChecker::isValidSBMLSId(mReaction))
logError(InvalidIdSyntax, getLevel(), getVersion(),
"The syntax of the attribute reaction='" + mReaction + "' does not conform.");
}
示例6: if
/*
* Read values from the given XMLAttributes set into their specific fields.
*/
void
SedRepeatedTask::readAttributes (const XMLAttributes& attributes,
const ExpectedAttributes& expectedAttributes)
{
SedTask::readAttributes(attributes, expectedAttributes);
bool assigned = false;
//
// rangeId SIdRef ( use = "optional" )
//
assigned = attributes.readInto("range", mRangeId, getErrorLog(), false);
if (assigned == true)
{
// check string is not empty and correct syntax
if (mRangeId.empty() == true)
{
logEmptyString(mRangeId, getLevel(), getVersion(), "<SedRepeatedTask>");
}
else if (SyntaxChecker::isValidSBMLSId(mRangeId) == false)
{
logError(SedInvalidIdSyntax);
}
}
//
// resetModel bool ( use = "optional" )
//
mIsSetResetModel = attributes.readInto("resetModel", mResetModel, getErrorLog(), false);
}
示例7: readAttributes
/** @cond doxygenLibsbmlInternal */
void RenderCurve::readAttributes (const XMLAttributes& attributes, const ExpectedAttributes& expectedAttributes)
{
GraphicalPrimitive1D::readAttributes(attributes, expectedAttributes);
std::string s;
attributes.readInto("startHead", this->mStartHead, getErrorLog(), false, getLine(), getColumn());
attributes.readInto("endHead", this->mEndHead, getErrorLog(), false, getLine(), getColumn());
}
示例8: getErrorLog
/*
* Read values from the given XMLAttributes set into their specific fields.
*/
void
SedUniformTimeCourse::readAttributes (const XMLAttributes& attributes,
const ExpectedAttributes& expectedAttributes)
{
SedSimulation::readAttributes(attributes, expectedAttributes);
bool assigned = false;
//
// initialTime double ( use = "required" )
//
mIsSetInitialTime = attributes.readInto("initialTime", mInitialTime, getErrorLog(), true);
//
// outputStartTime double ( use = "required" )
//
mIsSetOutputStartTime = attributes.readInto("outputStartTime", mOutputStartTime, getErrorLog(), true);
//
// outputEndTime double ( use = "required" )
//
mIsSetOutputEndTime = attributes.readInto("outputEndTime", mOutputEndTime, getErrorLog(), true);
//
// numberOfPoints int ( use = "required" )
//
mIsSetNumberOfPoints = attributes.readInto("numberOfPoints", mNumberOfPoints, getErrorLog(), true);
}
示例9: readAttributes
void SpeciesReferenceGlyph::readAttributes (const XMLAttributes& attributes,
const ExpectedAttributes& expectedAttributes)
{
GraphicalObject::readAttributes(attributes,expectedAttributes);
const unsigned int sbmlLevel = getLevel ();
const unsigned int sbmlVersion = getVersion();
bool assigned = attributes.readInto("speciesReference", mSpeciesReference);
if (assigned && mSpeciesReference.empty())
{
logEmptyString(mSpeciesReference, sbmlLevel, sbmlVersion, "<" + getElementName() + ">");
}
if (!SyntaxChecker::isValidInternalSId(mSpeciesReference)) logError(InvalidIdSyntax);
assigned = attributes.readInto("speciesGlyph", mSpeciesGlyph);
if (assigned && mSpeciesGlyph.empty())
{
logEmptyString(mSpeciesGlyph, sbmlLevel, sbmlVersion, "<" + getElementName() + ">");
}
if (!SyntaxChecker::isValidInternalSId(mSpeciesGlyph)) logError(InvalidIdSyntax);
std::string role;
if(attributes.readInto("role", role))
{
this->setRole(role);
}
else
{
this->setRole(SPECIES_ROLE_UNDEFINED);
}
}
示例10: getLevel
/*
* Subclasses should override this method to read values from the given
* XMLAttributes set into their specific fields. Be sure to call your
* parents implementation of this method as well.
*
* @param attributes the XMLAttributes object to use
*/
void
Parameter::readL3Attributes (const XMLAttributes& attributes)
{
const unsigned int level = getLevel ();
const unsigned int version = getVersion();
// id: SId { use="required" } (L2v1, L2v2)
//
bool assigned = attributes.readInto("id", mId, getErrorLog(), false, getLine(), getColumn());
if (!assigned)
{
if (this->getTypeCode() == SBML_PARAMETER)
{
logError(AllowedAttributesOnParameter, level, version);
}
else
{
logError(AllowedAttributesOnLocalParameter,
level, version);
}
}
if (assigned && mId.size() == 0)
{
logEmptyString("id", level, version, "<parameter>");
}
if (!SyntaxChecker::isValidInternalSId(mId)) logError(InvalidIdSyntax);
//
// value: double { use="optional" } (L1v2->)
//
mIsSetValue = attributes.readInto("value", mValue, getErrorLog(), false, getLine(), getColumn());
//
// units: SId { use="optional" } (L2v1, L2v2)
//
assigned = attributes.readInto("units", mUnits, getErrorLog(), false, getLine(), getColumn());
if (assigned && mUnits.size() == 0)
{
logEmptyString("units", level, version, "<parameter>");
}
if (!SyntaxChecker::isValidInternalUnitSId(mUnits))
{
logError(InvalidUnitIdSyntax);
}
//
// name: string { use="optional" } (L2v1 ->)
//
attributes.readInto("name", mName, getErrorLog(), false, getLine(), getColumn());
if (this->getTypeCode() == SBML_PARAMETER)
{
mIsSetConstant = attributes.readInto("constant", mConstant,
getErrorLog(), false, getLine(), getColumn());
if (!mIsSetConstant)
{
logError(AllowedAttributesOnParameter, level, version);
}
}
}
示例11: getErrorLog
/*
* Subclasses should override this method to read values from the given
* XMLAttributes set into their specific fields. Be sure to call your
* parents implementation of this method as well.
*/
void
SpeciesReference::readL1Attributes (const XMLAttributes& attributes)
{
//
// stoichiometry: integer { use="optional" default="1" } (L1v1, L1v2)
// stoichiometry: double { use="optional" default="1" } (L2v1->)
//
mIsSetStoichiometry = attributes.readInto("stoichiometry", mStoichiometry, getErrorLog(), false, getLine(), getColumn());
if (!mIsSetStoichiometry)
{
//
// setting default value
//
mStoichiometry = 1;
mIsSetStoichiometry = true;
}
else
{
mExplicitlySetStoichiometry = true;
}
//
// denominator: integer { use="optional" default="1" } (L1v1, L1v2)
//
mExplicitlySetDenominator = attributes.readInto("denominator", mDenominator,getErrorLog(), false, getLine(), getColumn());
}
示例12: getVersion
/*
* Subclasses should override this method to read values from the given
* XMLAttributes set into their specific fields. Be sure to call your
* parents implementation of this method as well.
*/
void
SpeciesReference::readL3Attributes (const XMLAttributes& attributes)
{
const unsigned int level = 3;
const unsigned int version = getVersion();
//
// stoichiometry: double { use="optional" default="1" } (L2v1->)
//
mIsSetStoichiometry = attributes.readInto("stoichiometry", mStoichiometry, getErrorLog(), false, getLine(), getColumn());
string elplusid = "<" + getElementName() + ">";
if (!mId.empty()) {
elplusid += " with the id '" + mId + "'";
}
SBase* rxn = getAncestorOfType(SBML_REACTION);
if (rxn && rxn->isSetId())
{
elplusid += " from the <reaction> with the id '" + rxn->getId() + "'";
}
//
// constant: bool { use="required" } (L3v1 -> )
//
mIsSetConstant = attributes.readInto("constant", mConstant, getErrorLog(), false, getLine(), getColumn());
if (!mIsSetConstant && !isModifier())
{
logError(AllowedAttributesOnSpeciesReference, level, version,
"The required attribute 'constant' is missing from the "
+ elplusid + ".");
}
}
示例13: readAttributes
/** @cond doxygenLibsbmlInternal */
void ColorDefinition::readAttributes (const XMLAttributes& attributes, const ExpectedAttributes& expectedAttributes)
{
SBase::readAttributes(attributes,expectedAttributes);
std::string valueString;
attributes.readInto("id", mId, getErrorLog(), false, getLine(), getColumn());
attributes.readInto("value", valueString, getErrorLog(), false, getLine(), getColumn());
this->setColorValue(valueString);
}
示例14: readAttributes
/** @cond doxygenLibsbmlInternal */
void Style::readAttributes (const XMLAttributes& attributes, const ExpectedAttributes& expectedAttributes)
{
SBase::readAttributes(attributes, expectedAttributes);
attributes.readInto("id", mId, getErrorLog(), false, getLine(), getColumn());
attributes.readInto("name", mName, getErrorLog(), false, getLine(), getColumn());
readListOfRoles(attributes);
readListOfTypes(attributes);
}
示例15: getLevel
/*
* Subclasses should override this method to read values from the given
* XMLAttributes set into their specific fields. Be sure to call your
* parents implementation of this method as well.
*/
void
Event::readL2Attributes (const XMLAttributes& attributes)
{
const unsigned int level = getLevel();
const unsigned int version = getVersion();
//
// id: SId { use="optional" } (L2v1 ->)
//
bool assigned = attributes.readInto("id", mId, getErrorLog(), false, getLine(), getColumn());
if (assigned && mId.size() == 0)
{
logEmptyString("id", level, version, "<event>");
}
if (!SyntaxChecker::isValidInternalSId(mId)) logError(InvalidIdSyntax);
//
// name: string { use="optional" } (L2v1 ->)
//
attributes.readInto("name", mName, getErrorLog(), false, getLine(), getColumn());
//
// timeUnits: SId { use="optional" } (L2v1, L2v2)
// removed in l2v3
//
if (version < 3)
{
assigned = attributes.readInto("timeUnits", mTimeUnits, getErrorLog(), false, getLine(), getColumn());
if (assigned && mTimeUnits.size() == 0)
{
logEmptyString("timeUnits", level, version, "<event>");
}
if (!SyntaxChecker::isValidInternalUnitSId(mTimeUnits))
{
logError(InvalidUnitIdSyntax);
}
}
//
// sboTerm: SBOTerm { use="optional" } (L2v2 ->)
//
if (version == 2)
mSBOTerm = SBO::readTerm(attributes, this->getErrorLog(), level, version,
getLine(), getColumn());
//
// useValuesFromTriggerTime: bool {use="optional" default="true"} (L2V4 ->)
// useValuesFromTriggerTime: bool {use="optional" } (L3 ->)
//
if (version == 4)
{
mExplicitlySetUVFTT = attributes.readInto("useValuesFromTriggerTime",
mUseValuesFromTriggerTime, getErrorLog(), false, getLine(), getColumn());
}
}