Class XMLStateWriter

Inheritance Relationships

Base Type

Class Documentation

class flamegpu::io::XMLStateWriter : public flamegpu::io::StateWriter

XML format StateWriter

Public Functions

XMLStateWriter(const std::string &model_name, const unsigned int &sim_instance_id, const util::StringPairUnorderedMap<std::shared_ptr<AgentVector>> &model_state, const unsigned int &iterations, const std::string &output_file, const Simulation *sim_instance)

Returns a writer capable of writing model state to an XML file Environment properties from the Simulation instance pointed to by ‘sim_instance_id’ will be used Agent data will be read from ‘model_state’

  • model_name – Name from the model description hierarchy of the model to be exported

  • sim_instance_id – Instance is from the Simulation instance to export the environment properties from

  • model_state – Map of AgentVector to read the agent data from per agent, key should be agent name

  • iterations – The value from the step counter at the time of export.

  • output_file – Filename of the input file (This will be used to determine which reader to return)

  • sim_instance – Instance of the Simulation object (This is used for setting/getting config)

virtual int writeStates(bool prettyPrint) override

Actually perform the writing to file


prettyPrint – Whether to include indentation and line breaks to aide human reading


exception::TinyXMLError – If export of the model state fails


Always tinyxml2::XML_SUCCESS