ostream& Lane::operator<<(ostream &out) const { odcore::serialization::SerializationFactory& sf=odcore::serialization::SerializationFactory::getInstance(); std::shared_ptr<odcore::serialization::Serializer> s = sf.getQueryableNetstringsSerializer(out); s->write(1, getIdentifier()); // Check if we have to serialize a lane model. bool hasLaneModel = (getLaneModel() != NULL); s->write(2, hasLaneModel); if (hasLaneModel) { s->write(3, static_cast<uint32_t>(getLaneModel()->getType())); s->write(4, *getLaneModel()); } return out; }
ostream& Lane::operator<<(ostream &out) const { SerializationFactory& sf=SerializationFactory::getInstance(); std::shared_ptr<Serializer> s = sf.getSerializer(out); s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL2('i', 'd') >::RESULT, getIdentifier()); // Check if we have to serialize a lane model. bool hasLaneModel = (getLaneModel() != NULL); s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('h', 'a', 's', 'l', 'a', 'm', 'd') >::RESULT, hasLaneModel); if (hasLaneModel) { s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('l', 'a', 'n', 'e', 'm', 'd', 'l') >::RESULT, static_cast<uint32_t>(getLaneModel()->getType())); s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('m', 'o', 'd', 'e', 'l') >::RESULT, *getLaneModel()); } return out; }