Esempio n. 1
0
/*
 * Subclasses should override this method to write their XML attributes
 * to the XMLOutputStream.  Be sure to call your parents implementation
 * of this method as well.
 */
void
Domain::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetSpatialId())
  stream.writeAttribute("spatialId",   getPrefix(), mSpatialId);
  if (isSetDomainType())
  stream.writeAttribute("domainType",   getPrefix(), mDomainType);  

  //
  // (EXTENSION)
  //
  SBase::writeExtensionAttributes(stream);
}
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
GeneProductRef::writeAttributes (XMLOutputStream& stream) const
{
  FbcAssociation::writeAttributes(stream);

  if (isSetId() == true)
    stream.writeAttribute("id", getPrefix(), mId);

  if (isSetGeneProduct() == true)
    stream.writeAttribute("geneProduct", getPrefix(), mGeneProduct);

  if (isSetName() == true)
    stream.writeAttribute("name", getPrefix(), mName);

}
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
CoordinateComponent::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetId() == true)
    stream.writeAttribute("id", getPrefix(), mId);

  if (isSetType() == true)
    stream.writeAttribute("type", getPrefix(), CoordinateKind_toString(mType));

  if (isSetUnit() == true)
    stream.writeAttribute("unit", getPrefix(), mUnit);

}
Esempio n. 4
0
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
CSGScale::writeAttributes (XMLOutputStream& stream) const
{
  CSGTransformation::writeAttributes(stream);

  if (isSetScaleX() == true)
    stream.writeAttribute("scaleX", getPrefix(), mScaleX);

  if (isSetScaleY() == true)
    stream.writeAttribute("scaleY", getPrefix(), mScaleY);

  if (isSetScaleZ() == true)
    stream.writeAttribute("scaleZ", getPrefix(), mScaleZ);

}
Esempio n. 5
0
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
AdjacentDomains::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetId() == true)
    stream.writeAttribute("id", getPrefix(), mId);

  if (isSetDomain1() == true)
    stream.writeAttribute("domain1", getPrefix(), mDomain1);

  if (isSetDomain2() == true)
    stream.writeAttribute("domain2", getPrefix(), mDomain2);

}
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
CompartmentMapping::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetId() == true)
    stream.writeAttribute("id", getPrefix(), mId);

  if (isSetDomainType() == true)
    stream.writeAttribute("domainType", getPrefix(), mDomainType);

  if (isSetUnitSize() == true)
    stream.writeAttribute("unitSize", getPrefix(), mUnitSize);

}
Esempio n. 7
0
/*
 * Writes this XMLAttributes set to stream.
 */
void
XMLAttributes::write (XMLOutputStream& stream) const
{
  for (int n = 0; n < getLength(); ++n)
  {
    if ( getPrefix(n).empty() )
    {
      stream.writeAttribute( getName(n), getValue(n) );
    }
    else
    {
      stream.writeAttribute( mNames[(size_t)n], getValue(n) );
    }
  }
}
Esempio n. 8
0
void 
ASTBase::writeAttributes (XMLOutputStream& stream) const
{
  if (isSetId())
    stream.writeAttribute("id", getId());
  if (isSetClass())
	  stream.writeAttribute("class", getClass());
  if (isSetStyle())
    stream.writeAttribute("style", getStyle());

  for (unsigned int i = 0; i < getNumPlugins(); i++)
  {
    getPlugin(i)->writeAttributes(stream, getExtendedType());
  }
}
Esempio n. 9
0
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
OutwardBindingSite::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetBindingStatus() == true)
    stream.writeAttribute("bindingStatus", getPrefix(), 
    BindingStatus_toString(mBindingStatus));

  if (isSetComponent() == true)
    stream.writeAttribute("component", getPrefix(), mComponent);

  SBase::writeExtensionAttributes(stream);

}
Esempio n. 10
0
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
InteriorPoint::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetCoord1() == true)
    stream.writeAttribute("coord1", getPrefix(), mCoord1);

  if (isSetCoord2() == true)
    stream.writeAttribute("coord2", getPrefix(), mCoord2);

  if (isSetCoord3() == true)
    stream.writeAttribute("coord3", getPrefix(), mCoord3);

}
void
ASTCnExponentialNode::write(XMLOutputStream& stream) const
{
  stream.startElement("cn");

  stream.setAutoIndent(false);

  ASTCnBase::write(stream);

  writeENotation (  getMantissa(), getExponent(), stream);
  
  stream.endElement("cn");
  
  stream.setAutoIndent(true);
}
Esempio n. 12
0
/*
 * Writes this XMLToken to stream.
 */
void
XMLToken::write (XMLOutputStream& stream) const
{
  if ( isEOF () ) return;

  if ( isText() )
  {
    stream << getCharacters();
    return;
  }

  if ( isStart() ) stream.startElement( mTriple );
  if ( isStart() ) stream << mNamespaces << mAttributes;
  if ( isEnd()   ) stream.endElement( mTriple );
}
Esempio n. 13
0
/*
 * Subclasses should override this method to write their XML attributes
 * to the XMLOutputStream.  Be sure to call your parents implementation
 * of this method as well.
 */
void
DiffusionCoefficient::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetVariable())
  stream.writeAttribute("variable",   getPrefix(), mVariable);

  if (isSetCoordinateIndex())
  stream.writeAttribute("coordinateIndex",   getPrefix(), mCoordinateIndex);

  //
  // (EXTENSION)
  //
  SBase::writeExtensionAttributes(stream);
}
Esempio n. 14
0
/*
 * Writes the XML namespace declarations to stream.
 */
void
XMLNamespaces::write (XMLOutputStream& stream) const
{
  for (int n = 0; n < getLength(); ++n)
  {
    if ( getPrefix(n).empty() )
    {
      stream.writeAttribute( "xmlns", getURI(n) );
    }
    else
    {
      const XMLTriple triple(getPrefix(n), "", "xmlns");
      stream.writeAttribute( triple, getURI(n) );
    }
  }
}
Esempio n. 15
0
void 
ASTBase::writeStartElement (XMLOutputStream& stream) const
{
  std::string name = getNameFromType(getExtendedType());
	stream.startElement(name);
  writeAttributes(stream);
}
void
ASTLambdaFunctionNode::write(XMLOutputStream& stream) const
{

  ASTBase::writeStartElement(stream);

  /* HACK TO REPLICATE OLD AST */
  /* all but the last child will be wrapped as bvars
   * even if they are technically not
   */
  unsigned int numChildren = ASTFunctionBase::getNumChildren();
  for (unsigned int i = 0; i < numChildren; i++)
  {
    if (i < numChildren-1 && ASTFunctionBase::getChild(i)->getType() != AST_QUALIFIER_BVAR)
    {
      ASTQualifierNode * bvar = new ASTQualifierNode(AST_QUALIFIER_BVAR);
      bvar->addChild(ASTFunctionBase::getChild(i)->deepCopy());
      bvar->write(stream);
      delete bvar;
    }
    else
    {
      ASTFunctionBase::getChild(i)->write(stream);
    }
  }
    
  stream.endElement("lambda");
}
void
MultiASTPlugin::writeAttributes(XMLOutputStream& stream, int type) const
{
  if (type != AST_NAME)
  {
    return;
  }
  else
  {
    if (isSetSpeciesReference())
      stream.writeAttribute("speciesReference", getPrefix(), getSpeciesReference());

    if (isSetRepresentationType())
      stream.writeAttribute("representationType", getPrefix(), getRepresentationType());
  }
}
/*
 * Subclasses should override this method to write their XML attributes
 * to the XMLOutputStream.  Be sure to call your parents implementation
 * of this method as well.
 */
void
InitialAssignment::writeAttributes (XMLOutputStream& stream) const
{
    SBase::writeAttributes(stream);

    const unsigned int level   = getLevel  ();
    const unsigned int version = getVersion();

    //
    // sboTerm: SBOTerm { use="optional" }  (L2v2)
    //
    // sboTerm for L2V3 or later is written in SBase::writeAttributes()
    //
    if ( (level == 2) && (version == 2) )
    {
        SBO::writeTerm(stream, mSBOTerm);
    }

    //
    // symbol: SId  { use="required" }  (L2v2)
    //
    stream.writeAttribute("symbol", mSymbol);

    //
    // (EXTENSION)
    //
    SBase::writeExtensionAttributes(stream);
}
/**
 * Subclasses should override this method to write their XML attributes
 * to the XMLOutputStream.  Be sure to call your parents implementation
 * of this method as well.  For example:
 *
 *   SBase::writeAttributes(stream);
 *   stream.writeAttribute( "id"  , mId   );
 *   stream.writeAttribute( "name", mName );
 *   ...
 */
void SpeciesReferenceGlyph::writeAttributes (XMLOutputStream& stream) const
{
  GraphicalObject::writeAttributes(stream);
  if(this->isSetSpeciesReferenceId())
  {
    stream.writeAttribute("speciesReference", mSpeciesReference);
  }
  if(this->isSetSpeciesGlyphId())
  {
    stream.writeAttribute("speciesGlyph", mSpeciesGlyph);
  }
  if(this->isSetRole())
  {
    stream.writeAttribute("role", this->getRoleString().c_str() );
  }
}
Esempio n. 20
0
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
Objective::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetId() == true)
    stream.writeAttribute("id", getPrefix(), mId);

  if (isSetName() == true)
    stream.writeAttribute("name", getPrefix(), mName);

  if (isSetType() == true)
    stream.writeAttribute("type", getPrefix(),
    ObjectiveType_toString(mType));

}
/*
 * Subclasses should override this method to write their XML attributes
 * to the XMLOutputStream.  Be sure to call your parents implementation
 * of this method as well.
 */
void
EventAssignment::writeAttributes (XMLOutputStream& stream) const
{
  const unsigned int level = getLevel();
  const unsigned int version = getVersion();

  /* invalid level/version */
  if (level < 2)
  {
    return;
  }

  SBase::writeAttributes(stream);

  //
  // sboTerm: SBOTerm { use="optional" }  (L2v2 ->)
  //
  // sboTerm for L2V3 or later is written in SBase::writeAttributes()
  //
  if ( (level == 2) && (version == 2) )
  {
    SBO::writeTerm(stream, mSBOTerm);
  }

  //
  // variable: SId  { use="required" }  (L2v1 ->)
  //
  stream.writeAttribute("variable", mVariable);

  //
  // (EXTENSION)
  //
  SBase::writeExtensionAttributes(stream);
}
void
MultiASTPlugin::writeXMLNS(XMLOutputStream& stream) const
{
  bool hasAttributes = false;

  if (hasAttributesSet() == true)
    stream.writeAttribute(getPrefix(), "xmlns", getURI());
}
Esempio n. 23
0
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
DistribInput::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetId() == true)
    stream.writeAttribute("id", getPrefix(), mId);

  if (isSetName() == true)
    stream.writeAttribute("name", getPrefix(), mName);

  if (isSetIndex() == true)
    stream.writeAttribute("index", getPrefix(), mIndex);

  SBase::writeExtensionAttributes(stream);

}
Esempio n. 24
0
/*
 * Writes the role list to an XML stream.
 */
void Style::writeRolesList(XMLOutputStream& stream) const
{
    std::string s=createStringFromSet(this->mRoleList);
    if(!s.empty())
    {
        stream.writeAttribute("roleList", getPrefix(),  s);
    }
}
Esempio n. 25
0
/*
 * Subclasses should override this method to write their XML attributes
 * to the XMLOutputStream.  Be sure to call your parents implementation
 * of this method as well.  For example:
 *
 *   SBase::writeAttributes(stream);
 *   stream.writeAttribute( "id"  , mId   );
 *   stream.writeAttribute( "name", mName );
 *   ...
 */
void Transformation2D::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);
  if(this->isSetMatrix() && memcmp(this->mMatrix,getIdentityMatrix(),12*sizeof(double))!=0)
    {
        stream.writeAttribute("transform", getPrefix(), this->get2DTransformationString());
    }
}
Esempio n. 26
0
/**
 * Subclasses should override this method to write their XML attributes
 * to the XMLOutputStream.  Be sure to call your parents implementation
 * of this method as well.  For example:
 *
 *   SBase::writeAttributes(stream);
 *   stream.writeAttribute( "id"  , mId   );
 *   stream.writeAttribute( "name", mName );
 *   ...
 */
void SpeciesGlyph::writeAttributes (XMLOutputStream& stream) const
{
  GraphicalObject::writeAttributes(stream);
  if(this->isSetSpeciesId())
  {
    stream.writeAttribute("species", mSpecies);
  }
}
Esempio n. 27
0
/*
 * Write values of XMLAttributes to the output stream.
 */
void
ListOfMemberConstraints::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetId() == true)
    stream.writeAttribute("id", getPrefix(), mId);

  if (isSetName() == true)
    stream.writeAttribute("name", getPrefix(), mName);

  if (isSetMembersShareType() == true)
    stream.writeAttribute("membersShareType", getPrefix(), mMembersShareType);

  SBase::writeExtensionAttributes(stream);

}
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
SpeciesTypeComponentMapInProduct::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetReactant() == true)
    stream.writeAttribute("reactant", getPrefix(), mReactant);

  if (isSetReactantComponent() == true)
    stream.writeAttribute("reactantComponent", getPrefix(), mReactantComponent);

  if (isSetProductComponent() == true)
    stream.writeAttribute("productComponent", getPrefix(), mProductComponent);

  SBase::writeExtensionAttributes(stream);

}
Esempio n. 29
0
/*
 * Writes the attributes to the stream
 */
void
Uncertainty::writeAttributes(XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetId() == true)
  {
    stream.writeAttribute("id", getPrefix(), mId);
  }

  if (isSetName() == true)
  {
    stream.writeAttribute("name", getPrefix(), mName);
  }

  SBase::writeExtensionAttributes(stream);
}
Esempio n. 30
0
/*
 * Write values of XMLAttributes to the output stream.
 */
  void
SpeciesFeatureType::writeAttributes (XMLOutputStream& stream) const
{
  SBase::writeAttributes(stream);

  if (isSetId() == true)
    stream.writeAttribute("id", getPrefix(), mId);

  if (isSetName() == true)
    stream.writeAttribute("name", getPrefix(), mName);

  if (isSetOccur() == true)
    stream.writeAttribute("occur", getPrefix(), mOccur);

  SBase::writeExtensionAttributes(stream);

}