当前位置: 首页>>代码示例>>C++>>正文


C++ XMLAttributes::readInto方法代码示例

本文整理汇总了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);
    }
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:30,代码来源:RenderPoint.cpp

示例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);

}
开发者ID:TheCoSMoCompany,项目名称:biopredyn,代码行数:39,代码来源:CompositeDescription.cpp

示例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.");
  }
}
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:35,代码来源:Trigger.cpp

示例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);
        }
    }

}
开发者ID:0u812,项目名称:libSEDML,代码行数:36,代码来源:SedSubTask.cpp

示例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.");
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:27,代码来源:GeneAssociation.cpp

示例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);

}
开发者ID:jeicher,项目名称:libSEDML,代码行数:36,代码来源:SedRepeatedTask.cpp

示例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());
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:8,代码来源:RenderCurve.cpp

示例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);

}
开发者ID:jeicher,项目名称:libSEDML,代码行数:32,代码来源:SedUniformTimeCourse.cpp

示例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);
  }
  
}
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:33,代码来源:SpeciesReferenceGlyph.cpp

示例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);
    }
  }
}
开发者ID:Alcibiades586,项目名称:roadrunner,代码行数:67,代码来源:Parameter.cpp

示例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());

}
开发者ID:sbmlteam,项目名称:python-libsbml,代码行数:32,代码来源:SpeciesReference.cpp

示例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 + ".");
  }

}
开发者ID:sbmlteam,项目名称:python-libsbml,代码行数:36,代码来源:SpeciesReference.cpp

示例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);
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:9,代码来源:ColorDefinition.cpp

示例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);
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:9,代码来源:Style.cpp

示例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());
  }
}
开发者ID:0u812,项目名称:libsbml.js.frozen,代码行数:59,代码来源:Event.cpp


注:本文中的XMLAttributes::readInto方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。