示例#1
0
inline void Circuit::saveVirtualElement(std::list <CircuitElementVirtual>::iterator element, bool save_edges) {
	std::ostringstream out(std::ios_base::binary);
	element->serialize(out);
	m_virtual_database->put(itos(element->getId()), out.str());
	if(save_edges) {
		for(std::list <CircuitElementVirtualContainer>::iterator i = element->begin(); i != element->end(); ++i) {
			std::ostringstream out(std::ios_base::binary);
			i->element_pointer->serialize(out);
			m_database->put(itos(i->element_pointer->getId()), out.str());
		}
	}
}
示例#2
0
inline void Circuit::saveElement(std::list<CircuitElement>::iterator element, bool save_edges) {
	std::ostringstream out(std::ios_base::binary);
	element->serialize(out);
	m_database->put(itos(element->getId()), out.str());
	if(save_edges) {
		for(int i = 0; i < 6; ++i) {
			CircuitElementContainer tmp_container = element->getFace(i);
			if(tmp_container.is_connected) {
				std::ostringstream out(std::ios_base::binary);
				tmp_container.list_pointer->serialize(out);
				m_virtual_database->put(itos(tmp_container.list_pointer->getId()), out.str());
			}
		}
	}
}