----------------------------------------------------------------------------- Write ourselves to an XML document -----------------------------------------------------------------------------
| 194 | // Write ourselves to an XML document |
| 195 | //----------------------------------------------------------------------------- |
| 196 | void Group::WriteXML |
| 197 | ( |
| 198 | TiXmlElement* _groupElement |
| 199 | ) |
| 200 | { |
| 201 | char str[16]; |
| 202 | |
| 203 | snprintf( str, 16, "%d", m_groupIdx ); |
| 204 | _groupElement->SetAttribute( "index", str ); |
| 205 | |
| 206 | snprintf( str, 16, "%d", m_maxAssociations ); |
| 207 | _groupElement->SetAttribute( "max_associations", str ); |
| 208 | |
| 209 | _groupElement->SetAttribute( "label", m_label.c_str() ); |
| 210 | _groupElement->SetAttribute( "auto", m_auto ? "true" : "false" ); |
| 211 | if( m_multiInstance ) |
| 212 | { |
| 213 | _groupElement->SetAttribute( "multiInstance", m_multiInstance ? "true" : "false" ); |
| 214 | } |
| 215 | |
| 216 | for( map<InstanceAssociation,AssociationCommandVec,classcomp>::iterator it = m_associations.begin(); it != m_associations.end(); ++it ) |
| 217 | { |
| 218 | TiXmlElement* associationElement = new TiXmlElement( "Node" ); |
| 219 | |
| 220 | snprintf( str, 16, "%d", it->first.m_nodeId ); |
| 221 | associationElement->SetAttribute( "id", str ); |
| 222 | if (it->first.m_instance != 0) |
| 223 | { |
| 224 | snprintf( str, 16, "%d", it->first.m_instance ); |
| 225 | associationElement->SetAttribute( "instance", str ); |
| 226 | } |
| 227 | |
| 228 | _groupElement->LinkEndChild( associationElement ); |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | //----------------------------------------------------------------------------- |
| 233 | // <Group::Contains> |
nothing calls this directly
no test coverage detected