Ejemplo n.º 1
0
            ostream& PointIDDriver::operator<<(ostream &out) const {
                // Serializer super class.
                Behavior::operator<<(out);

                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<Serializer> s = sf.getSerializer(out);

                s->write(CRC32 < OPENDAVINCI_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 < OPENDAVINCI_CORE_STRINGLITERAL5('s', 't', 'a', 'r', 't') >::RESULT,
                            sstr.str());
                }

                s->write(CRC32 < OPENDAVINCI_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 < OPENDAVINCI_CORE_STRINGLITERAL4('s', 't', 'o', 'p') >::RESULT,
                            sstr.str());
                }

                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL1('a') >::RESULT,
                        m_constantAcceleration);

                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL1('v') >::RESULT,
                        m_constantVelocity);

                uint32_t numberOfPointIDs = static_cast<uint32_t>(m_listOfPointIDs.size());
                s->write(CRC32 < OPENDAVINCI_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 < OPENDAVINCI_CORE_STRINGLITERAL4('p', 'i', 'd', 's') >::RESULT,
						sstr.str());
                }

                return out;
            }
            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;
            }
Ejemplo n.º 3
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& 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;
	}
Ejemplo n.º 5
0
            ostream& Header::operator<<(ostream &out) const {
                SerializationFactory& sf=SerializationFactory::getInstance();

                std::shared_ptr<Serializer> s = sf.getSerializer(out);

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

                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('v', 'e', 'r', 's', 'i', 'o', 'n') >::RESULT,
                        m_version);

                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('d', 'a', 't', 'e') >::RESULT,
                        m_date);

                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('s', 'c', 'n') >::RESULT,
                        m_scenario);

                return out;
            }
Ejemplo n.º 6
0
            ostream& Object::operator<<(ostream &out) const {
                SerializationFactory& sf=SerializationFactory::getInstance();

                std::shared_ptr<Serializer> s = sf.getSerializer(out);

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

                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL2('i', 'd') >::RESULT,
                        m_identifier);

                s->write(CRC32 < OPENDAVINCI_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 < OPENDAVINCI_CORE_STRINGLITERAL5('s', 'h', 'a', 'p', 'e') >::RESULT,
                            sstr.str());
                }

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

                s->write(CRC32 < OPENDAVINCI_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 < OPENDAVINCI_CORE_STRINGLITERAL5('b', 'e', 'h', 'a', 'v') >::RESULT,
                            sstr.str());
                }
                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;
        }
Ejemplo n.º 8
0
            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;
            }
Ejemplo n.º 9
0
            ostream& Zone::operator<<(ostream &out) const {
                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<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;
            }
Ejemplo n.º 10
0
            ostream& Point3::operator<<(ostream &out) const {
                SerializationFactory& sf=SerializationFactory::getInstance();;

                core::SharedPointer<Serializer> s = sf.getSerializer(out);

                stringstream rawData;
                rawData.precision(10);

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

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

                return out;
            }
Ejemplo n.º 11
0
            ostream& Quaternion::operator<<(ostream &out) const {
                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

                stringstream rawData;
                rawData.precision(10);

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

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

                return out;
            }
Ejemplo n.º 12
0
            ostream& LaneAttribute::operator<<(ostream &out) const {
                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<Serializer> s = sf.getSerializer(out);

                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('w', 'i', 'd', 't', 'h') >::RESULT,
                        getWidth());

                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('l', 'e', 'f', 't') >::RESULT,
                        static_cast<uint32_t>(getLeftLaneMarking()));

                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('r', 'i', 'g', 'h', 't') >::RESULT,
                        static_cast<uint32_t>(getRightLaneMarking()));

                return out;
            }
Ejemplo n.º 13
0
            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;
            }
Ejemplo n.º 14
0
            }

            ostream& StartType::operator<<(ostream &out) const {
                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<Serializer> s = sf.getSerializer(out);

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

                return out;
            }

            istream& StartType::operator>>(istream &in) {
                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<Deserializer> d = sf.getDeserializer(in);

                uint32_t type = 0;
                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('t', 'y', 'p', 'e') >::RESULT,
                       type);

                m_type = static_cast<enum StartType::STARTTYPE>(type);

                return in;
            }

        }
    }
} // hesperia::data::situation
                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('h', 'e', 'a', 'd', 'i', 'n', 'g') >::RESULT,
                       m_heading);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('a', 'd', 'p') >::RESULT,
                       m_absTraveledPath);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('r', 'd', 'p') >::RESULT,
                       m_relTraveledPath);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('v', 'e', 'l', 'o', 'c', 'i', 't', 'y') >::RESULT,
                       m_velocity);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('s', 'p', 'e', 'e', 'd') >::RESULT,
                       m_speed);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('v', 'l', 'o', 'g') >::RESULT,
                       m_v_log);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('v', 'b', 'a', 't') >::RESULT,
                       m_v_batt);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('t', 'e', 'm', 'p') >::RESULT,
                       m_temp);

                return in;
            }

        }
    }
} // core::data::environment
Ejemplo n.º 16
0
                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('r', 'i', 'g', 'h', 't') >::RESULT,
                        static_cast<uint32_t>(getRightLaneMarking()));

                return out;
            }

            istream& LaneAttribute::operator>>(istream &in) {
                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<Deserializer> d = sf.getDeserializer(in);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('w', 'i', 'd', 't', 'h') >::RESULT,
                       m_width);

                uint32_t left;
                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('l', 'e', 'f', 't') >::RESULT,
                       left);
                m_leftLaneMarking = static_cast<enum BOUNDARYSTYLE>(left);

                uint32_t right;
                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('r', 'i', 'g', 'h', 't') >::RESULT,
                       right);
                m_rightLaneMarking = static_cast<enum BOUNDARYSTYLE>(right);

                return in;
            }

        }
    }
} // hesperia::data::scenario
Ejemplo n.º 17
0
                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('r', 'o', 't', 'z') >::RESULT,
                        getRotationZ());

                return out;
            }

            istream& Clothoid::operator>>(istream &in) {
                // Deserializer super class.
                StraightLine::operator>>(in);

                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<Deserializer> d = sf.getDeserializer(in);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL2('d', 'k') >::RESULT,
                       m_dk);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL1('k') >::RESULT,
                       m_k);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('r', 'o', 't', 'z') >::RESULT,
                       m_rotationZ);

                return in;
            }

        }
    }
} // hesperia::data::scenario
                if (size > 0) {
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('d', 'a', 't', 'a') >::RESULT,
                            dataStream.str());
                }

                return out;
            }

            istream& ModuleStatistics::operator>>(istream &in) {
                SerializationFactory sf;

                Deserializer &d = sf.getDeserializer(in);

                uint32_t size = 0;

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('s', 'i', 'z', 'e') >::RESULT,
                       size);

                if (size > 0) {
                    string dataStr;

                    d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('d', 'a', 't', 'a') >::RESULT,
                           dataStr);

                    stringstream data(dataStr);
                    for (uint32_t i = 0; i < size; i++) {
                        ModuleDescriptor md;
                        RuntimeStatistic rts;

                        data >> md >> rts;
Ejemplo n.º 19
0
                // Serializer super class.
                Line::operator<<(out);

                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<Serializer> s = sf.getSerializer(out);

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

                return out;
            }

            istream& NamedLine::operator>>(istream &in) {
                // Deserializer super class.
                Line::operator>>(in);

                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<Deserializer> d = sf.getDeserializer(in);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('n','a','m','e') >::RESULT,
                       m_name);

                return in;
            }

        }
    }
} // hesperia::data::environment
Ejemplo n.º 20
0
                rawData << m_w << endl << m_x << endl << m_y << endl << m_z;

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

                return out;
            }

            istream& Quaternion::operator>>(istream &in) {
                SerializationFactory sf;

                Deserializer &d = sf.getDeserializer(in);

                string data;

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('d', 'a', 't', 'a') >::RESULT,
                       data);

                stringstream rawData;
                rawData.precision(10);
                rawData.str(data);

                rawData >> m_w >> m_x >> m_y >> m_z;

                return in;
            }
        }
    }
} // hesperia::data::environment