ostream& PointModel::operator<<(ostream &out) const {
                // Serializer super class.
                LaneModel::operator<<(out);

                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                uint32_t numberOfIdentifiableVertices = static_cast<uint32_t>(m_listOfIdentifiableVertices.size());
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('n', 'u', 'm', 'i', 'd', 'v', 's') >::RESULT,
                        numberOfIdentifiableVertices);

                // Write identifiable vertices to stringstream.
                stringstream sstr;
                for (uint32_t i = 0; i < numberOfIdentifiableVertices; i++) {
                    // Write data to stringstream.
                    sstr << m_listOfIdentifiableVertices.at(i);
                }

                // Write identifiable vertices.
                if (numberOfIdentifiableVertices > 0) {
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('i', 'd', 'v', 's') >::RESULT,
                            sstr.str());
                }

                return out;
            }
            ostream& Scenario::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('h', 'e', 'a', 'd', 'e', 'r') >::RESULT,
                        m_header);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('g', 'r', 'o', 'u', 'n', 'd') >::RESULT,
                        m_ground);

                uint32_t numberOfLayers = static_cast<uint32_t>(m_listOfLayers.size());
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('n', 'u', 'm', 'l', 'a', 'y', 'e', 'r') >::RESULT,
                        numberOfLayers);

                // Write roads to stringstream.
                stringstream sstr;
                for (uint32_t i = 0; i < numberOfLayers; i++) {
                    // Write data to stringstream.
                    sstr << m_listOfLayers.at(i);
                }

                // Write layers.
                if (numberOfLayers > 0) {
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('l', 'a', 'y', 'e', 'r', 's') >::RESULT,
                            sstr.str());
                }

                return out;
            }
            ostream& Polygon::operator<<(ostream &out) const {
                // Serializer super class.
                Shape::operator<<(out);

                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('h', 'e', 'i', 'g', 'h', 't') >::RESULT,
                        m_height);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('c', 'o', 'l', 'o', 'r') >::RESULT,
                        m_color);

                // Write number of vertices.
                uint32_t numberOfVertices = static_cast<uint32_t>(m_listOfVertices.size());
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('n', 'u', 'm', 'v', 'e', 'r', 't', 's') >::RESULT,
                        numberOfVertices);

                // Write actual vertices to stringstream.
                stringstream sstr;
                for (uint32_t i = 0; i < numberOfVertices; i++) {
                    sstr << m_listOfVertices.at(i);
                }

                // Write string of vertices.
                if (numberOfVertices > 0) {
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('v', 'e', 'r', 't', 'i', 'c', 'e', 's') >::RESULT,
                            sstr.str());
                }

                return out;
            }
Beispiel #4
0
            ostream& Road::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL2('i', 'd') >::RESULT,
                        getID());

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('n', 'a', 'm', 'e') >::RESULT,
                        getName());

                uint32_t numberOfLanes = static_cast<uint32_t>(m_listOfLanes.size());
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('n', 'u', 'm', 'l', 'a', 'n', 'e', 's') >::RESULT,
                        numberOfLanes);

                // Write lanes to stringstream.
                stringstream sstr;
                for (uint32_t i = 0; i < numberOfLanes; i++) {
                    // Write data to stringstream.
                    sstr << m_listOfLanes.at(i);
                }

                // Write lanes.
                if (numberOfLanes > 0) {
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('l', 'a', 'n', 'e', 's') >::RESULT,
                            sstr.str());
                }

                return out;
            }
            ostream& Situation::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('h', 'e', 'a', 'd', 'e', 'r') >::RESULT,
                        m_header);

                uint32_t numberOfObjects = static_cast<uint32_t>(m_listOfObjects.size());
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('n', 'u', 'm', 'o', 'b', 's') >::RESULT,
                        numberOfObjects);

                // Write roads to stringstream.
                stringstream sstr;
                for (uint32_t i = 0; i < numberOfObjects; i++) {
                    // Write data to stringstream.
                    sstr << m_listOfObjects.at(i);
                }

                // Write objects.
                if (numberOfObjects > 0) {
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('o', 'b', 'j', 'e', 'c', 't', 's') >::RESULT,
                            sstr.str());
                }

                return out;
            }
            ostream& PointIDDriver::operator<<(ostream &out) const {
                // Serializer super class.
                Behavior::operator<<(out);

                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL8('h', 'a', 's', 's', 't', 'a', 'r', 't') >::RESULT,
                        (m_startType != NULL));

                if (m_startType != NULL) {
                    // Write data to stringstream.
                    stringstream sstr;
                    sstr << static_cast<uint32_t>(m_startType->getType())
                    << *m_startType;

                    s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL5('s', 't', 'a', 'r', 't') >::RESULT,
                            sstr.str());
                }

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL7('h', 'a', 's', 's', 't', 'o', 'p') >::RESULT,
                        (m_stopType != NULL));

                if (m_stopType != NULL) {
                    // Write data to stringstream.
                    stringstream sstr;
                    sstr << static_cast<uint32_t>(m_stopType->getType())
                    << *m_stopType;

                    s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL4('s', 't', 'o', 'p') >::RESULT,
                            sstr.str());
                }

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL1('a') >::RESULT,
                        m_constantAcceleration);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL1('v') >::RESULT,
                        m_constantVelocity);

                uint32_t numberOfPointIDs = static_cast<uint32_t>(m_listOfPointIDs.size());
                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL7('n', 'u', 'm', 'p', 'i', 'd', 's') >::RESULT,
                        numberOfPointIDs);

                // Write PointIDs to stringstream.
                stringstream sstr;
                for (uint32_t i = 0; i < numberOfPointIDs; i++) {
                    // Write data to stringstream.
                    sstr << m_listOfPointIDs.at(i);
                }

                // Write PointIDs.
                if (numberOfPointIDs > 0) {
                    s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL4('p', 'i', 'd', 's') >::RESULT,
						sstr.str());
                }

                return out;
            }
	ostream& SteeringData::operator<<(ostream &out) const {
		SerializationFactory sf;
	
		Serializer &s = sf.getSerializer(out);
	
		s.write(CRC32 < CharList<'e', CharList<'x', CharList<'a', CharList<'m', CharList<'p', CharList<'l', CharList<'e', CharList<'D', CharList<'a', CharList<'t', CharList<'a', NullType> > > > > > > > > > >  >::RESULT,
				m_exampleData);
		return out;
	}
	ostream& SensorBoardData::operator<<(ostream &out) const {
		SerializationFactory sf;

		Serializer &s = sf.getSerializer(out);

		s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('d', 'i', 's', 't') >::RESULT,
				toString());

		return out;
	}
	ostream& Example3Data::operator<<(ostream &out) const {
		SerializationFactory sf;

		Serializer &s = sf.getSerializer(out);

		s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('n', 'u', 'm') >::RESULT,
				m_numericalValue);

		s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('s', 't', 'r') >::RESULT,
				m_stringValue);

		return out;
	}
        ostream& SharedData::operator<<(ostream &out) const {
            SerializationFactory sf;

            Serializer &s = sf.getSerializer(out);

            s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('n', 'a', 'm', 'e') >::RESULT,
                    m_name);

            s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('l', 'e', 'n', 'g', 't', 'h') >::RESULT,
                    m_size);

            return out;
        }
        ostream& TimeStamp::operator<<(ostream &out) const {
            SerializationFactory sf;

            Serializer &s = sf.getSerializer(out);

            s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('s', 'e', 'c') >::RESULT,
                    m_seconds);

            s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('m', 'i', 'c') >::RESULT,
                    m_microseconds);

            return out;
        }
Beispiel #12
0
            ostream& Connector::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('s', 'o', 'u', 'r', 'c', 'e') >::RESULT,
                        getSource());

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('t', 'a', 'r', 'g', 'e', 't') >::RESULT,
                        getTarget());

                return out;
            }
            ostream& WGS84CoordinateSystem::operator<<(ostream &out) const {
                // Serializer super class.
                CoordinateSystem::operator<<(out);

                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL6('o', 'r', 'i', 'g', 'i', 'n') >::RESULT,
                        m_origin);

                return out;
            }
Beispiel #14
0
            ostream& TrafficSign::operator<<(ostream &out) const {
                // Serializer super class.
                TrafficControl::operator<<(out);

                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('v', 'a', 'l', 'u', 'e') >::RESULT,
                        getValue());

                return out;
            }
Beispiel #15
0
            ostream& Zone::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL2('i', 'd') >::RESULT,
                        getID());

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('n', 'a', 'm', 'e') >::RESULT,
                        getName());

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('p', 'e', 'r', 'i', 'm', 't', 'e', 'r') >::RESULT,
                        getPerimeter());

                uint32_t numberOfConnectors = static_cast<uint32_t>(m_listOfConnectors.size());
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('n', 'u', 'm', 'c', 'o', 'n', 'n', 's') >::RESULT,
                        numberOfConnectors);

                // Write connectors to stringstream.
                stringstream sstr;
                for (uint32_t i = 0; i < numberOfConnectors; i++) {
                    // Write data to stringstream.
                    sstr << m_listOfConnectors.at(i);
                }

                // Write connectors.
                if (numberOfConnectors > 0) {
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('c', 'o', 'n', 'n', 's') >::RESULT,
                            sstr.str());
                }

                uint32_t numberOfSpots = static_cast<uint32_t>(m_listOfSpots.size());
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('n', 'u', 'm', 's', 'p', 'o', 't', 's') >::RESULT,
                        numberOfSpots);

                // Write spots to stringstream.
                sstr.str("");
                for (uint32_t i = 0; i < numberOfSpots; i++) {
                    // Write data to stringstream.
                    sstr << m_listOfSpots.at(i);
                }

                // Write spots.
                if (numberOfSpots > 0) {
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('s', 'p', 'o', 't', 's') >::RESULT,
                            sstr.str());
                }

                return out;
            }
            ostream& Layer::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('n', 'a', 'm', 'e') >::RESULT,
                        getName());

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL2('i', 'd') >::RESULT,
                        getID());

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('h', 'e', 'i', 'g', 'h', 't') >::RESULT,
                        getHeight());

                uint32_t numberOfRoads = static_cast<uint32_t>(m_listOfRoads.size());
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('n', 'u', 'm', 'r', 'o', 'a', 'd', 's') >::RESULT,
                        numberOfRoads);

                // Write roads to stringstream.
                stringstream sstr;
                for (uint32_t i = 0; i < numberOfRoads; i++) {
                    // Write data to stringstream.
                    sstr << m_listOfRoads.at(i);
                }

                // Write roads.
                if (numberOfRoads > 0) {
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('r', 'o', 'a', 'd', 's') >::RESULT,
                            sstr.str());
                }

                uint32_t numberOfZones = static_cast<uint32_t>(m_listOfZones.size());
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('n', 'u', 'm', 'z', 'o', 'n', 'e', 's') >::RESULT,
                        numberOfZones);

                // Write zones to stringstream.
                sstr.str("");
                for (uint32_t i = 0; i < numberOfZones; i++) {
                    // Write data to stringstream.
                    sstr << m_listOfZones.at(i);
                }

                // Write zones.
                if (numberOfZones > 0) {
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('z', 'o', 'n', 'e', 's') >::RESULT,
                            sstr.str());
                }

                return out;
            }
            ostream& Point3::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                stringstream rawData;
                rawData.precision(10);

                rawData << m_x << endl << m_y << endl << m_z;

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL4('d', 'a', 't', 'a') >::RESULT,
                        rawData.str());

                return out;
            }
            ostream& Spot::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL2('i', 'd') >::RESULT,
                        getID());

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL5('f', 'i', 'r', 's', 't') >::RESULT,
                        getFirstVertex());

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL6('s', 'e', 'c', 'o', 'n', 'd') >::RESULT,
                        getSecondVertex());

                return out;
            }
Beispiel #19
0
            ostream& WGS84Coordinate::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('l', 'a', 't') >::RESULT,
                        m_lat);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('l', 'a', 't', 'd', 'i', 'r') >::RESULT,
                        static_cast<uint32_t>(m_LATITUDE));

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('l', 'o', 'n') >::RESULT,
                        m_lon);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('l', 'o', 'n', 'd', 'i', 'r') >::RESULT,
                        static_cast<uint32_t>(m_LONGITUDE));

                return out;
            }
Beispiel #20
0
            ostream& IntrinsicParameters::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('p', 'r', 'i', 'n', 'c', 'i', 'p', 'l') >::RESULT,
                        m_principlePoint);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('f', 'o', 'c', 'a', 'l', 'l', 'e', 'n') >::RESULT,
                        m_focalLength);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('f', 'o', 'c', 'd', 'i', 's', 't') >::RESULT,
                        m_focalDistance);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('a', 'l', 'p', 'h', 'a') >::RESULT,
                        m_alpha);

                return out;
            }
            ostream& HeightImage::operator<<(ostream &out) const {
                // Serializer super class.
                Image::operator<<(out);

                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL7('g', 'r', 'o', 'u', 'n', 'd', 'h') >::RESULT,
                        m_groundHeight);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL4('m', 'i', 'n', 'h') >::RESULT,
                        m_minimumHeight);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL4('m', 'a', 'x', 'h') >::RESULT,
                        m_maximumHeight);

                return out;
            }
            ostream& BoundingBox::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL6('u', 'p', 'l', 'e', 'f', 't') >::RESULT,
                        m_upperLeft);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL7('u', 'p', 'r', 'i', 'g', 'h', 't') >::RESULT,
                        m_upperRight);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL7('l', 'o', 'r', 'i', 'g', 'h', 't') >::RESULT,
                        m_lowerRight);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL6('l', 'o', 'l', 'e', 'f', 't') >::RESULT,
                        m_lowerLeft);

                return out;
            }
            ostream& Object::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL4('n', 'a', 'm', 'e') >::RESULT,
                        m_name);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL2('i', 'd') >::RESULT,
                        m_id);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL8('h', 'a', 's', 's', 'h', 'a', 'p', 'e') >::RESULT,
                        (m_shape != NULL));

                if (m_shape != NULL) {
                    // Write data to stringstream.
                    stringstream sstr;
                    sstr << static_cast<uint32_t>(m_shape->getType())
                    << *m_shape;

                    s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL5('s', 'h', 'a', 'p', 'e') >::RESULT,
                            sstr.str());
                }

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL4('r', 'o', 't', 'z') >::RESULT,
                        m_rotationZ);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL8('h', 'a', 's', 'b', 'e', 'h', 'a', 'v') >::RESULT,
                        (m_behavior != NULL));

                if (m_behavior != NULL) {
                    // Write data to stringstream.
                    stringstream sstr;
                    sstr << static_cast<uint32_t>(m_behavior->getType())
                    << *m_behavior;

                    s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL5('b', 'e', 'h', 'a', 'v') >::RESULT,
                            sstr.str());
                }
                return out;
            }
            ostream& Arc::operator<<(ostream &out) const {
                // Serializer super class.
                StraightLine::operator<<(out);

                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('r', 'a', 'd', 'i', 'u', 's') >::RESULT,
                        getRadius());

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('b', 'e', 'g', 'i', 'n') >::RESULT,
                        getBeginInterval());

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('e', 'n', 'd') >::RESULT,
                        getEndInterval());

                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('r', 'o', 't', 'z') >::RESULT,
                        getRotationZ());

                return out;
            }
            ostream& Surroundings::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                // Do not serialize UNKNOWN TYPES.
                uint32_t numberOfShapes = 0;
                vector<Shape*>::const_iterator it = m_listOfShapes.begin();
                while (it != m_listOfShapes.end()) {
                    Shape *shape = (*it++);
                    if (shape != NULL) {
                        numberOfShapes++;
                    }
                }
                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL8('n', 'u', 'm', 's', 'h', 'a', 'p', 'e') >::RESULT,
                        numberOfShapes);

                // Write shapes to stringstream.
                stringstream sstr;
                for (uint32_t i = 0; i < m_listOfShapes.size(); i++) {
                    Shape *shape = m_listOfShapes.at(i);
                    if (shape != NULL) {
                        // Write data to stringstream.
                        sstr << static_cast<uint32_t>(shape->getType())
                        << *shape
                        << endl;
                    }
                }

                // Write shapes.
                if (numberOfShapes > 0) {
                    s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL6('s', 'h', 'a', 'p', 'e', 's') >::RESULT,
                            sstr.str());
                }

                return out;
            }
            ostream& ContouredObjects::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                // Write contoured objects.
                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL8('c', 'o', 'b', 'j', 's', 'i', 'z', 'e') >::RESULT,
                        static_cast<uint32_t>(m_contouredObjects.size()));

                // Contour.
                stringstream sstr;
                vector<ContouredObject>::const_iterator it = m_contouredObjects.begin();
                while (it != m_contouredObjects.end()) {
                    sstr << (*it++);
                }
                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL7('c', 'o', 'n', 't', 'o', 'u', 'r') >::RESULT,
                        sstr.str());

                // Color.
                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL5('c', 'o', 'l', 'o', 'r') >::RESULT,
                        static_cast<uint32_t>(m_color));

                return out;
            }
            ostream& LaneModel::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL5('l', 'a', 't', 't', 'r') >::RESULT,
                        getLaneAttribute());

                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL4('t', 'y', 'p', 'e') >::RESULT,
                        static_cast<uint32_t>(m_type));

                // Serialize traffic controls.
                uint32_t numberOfTrafficControls = 0;
                vector<TrafficControl*>::const_iterator it = m_listOfTrafficControls.begin();
                while (it != m_listOfTrafficControls.end()) {
                    TrafficControl *tc = (*it++);
                    if (tc != NULL) {
                        numberOfTrafficControls++;
                    }
                }
                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL8('n', 'u', 'm', 't', 'r', 'a', 'f', 'c') >::RESULT,
                        numberOfTrafficControls);

                // Write traffic controls to stringstream.
                stringstream sstr;
                for (uint32_t i = 0; i < m_listOfTrafficControls.size(); i++) {
                    TrafficControl *tc = m_listOfTrafficControls.at(i);
                    if (tc != NULL) {
                        // Write data to stringstream.
                        sstr << static_cast<uint32_t>(tc->getType())
                        << *tc
                        << endl;
                    }
                }

                // Write traffic controls.
                if (numberOfTrafficControls > 0) {
                    s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL6('t', 'r', 'a', 'f', 'c', 's') >::RESULT,
                            sstr.str());
                }

                // Serialize connectors.
                uint32_t numberOfConnectors = static_cast<uint32_t>(m_listOfConnectors.size());
                s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL8('n', 'u', 'm', 'c', 'o', 'n', 'n', 's') >::RESULT,
                        numberOfConnectors);

                // Write connectors to stringstream.
                sstr.str("");
                for (uint32_t i = 0; i < numberOfConnectors; i++) {
                    // Write data to stringstream.
                    sstr << m_listOfConnectors.at(i);
                }

                // Write lanes.
                if (numberOfConnectors > 0) {
                    s.write(CRC32 < HESPERIA_CORE_STRINGLITERAL4('c', 'o', 'n', 'n') >::RESULT,
                            sstr.str());
                }

                return out;
            }