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& 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;
            }
Esempio n. 3
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;
            }
Esempio n. 4
0
            ostream& Connector::operator<<(ostream &out) const {
                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<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;
            }
Esempio n. 5
0
            ostream& Polygon::operator<<(ostream &out) const {
                // Serializer super class.
                Shape::operator<<(out);

                SerializationFactory& sf=SerializationFactory::getInstance();

                std::shared_ptr<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;
            }
Esempio n. 6
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;
            }
Esempio n. 7
0
            ostream& BoundingBox::operator<<(ostream &out) const {
                SerializationFactory& sf=SerializationFactory::getInstance();

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

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

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

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

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

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

                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

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

                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;
        }
Esempio n. 10
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;
            }
Esempio n. 11
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;
            }
        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;
        }

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

            Deserializer &d = sf.getDeserializer(in);

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

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

            return in;
        }

    }
} // core::data
Esempio n. 13
0
                return out;
            }

            istream& Polygon::operator>>(istream &in) {
                // Deserializer super class.
                Shape::operator>>(in);

                SerializationFactory& sf=SerializationFactory::getInstance();

                std::shared_ptr<Deserializer> d = sf.getDeserializer(in);

                // Clean up.
                m_listOfVertices.clear();

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('h', 'e', 'i', 'g', 'h', 't') >::RESULT,
                       m_height);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('c', 'o', 'l', 'o', 'r') >::RESULT,
                       m_color);

                // Read number of vertices.
                uint32_t numberOfVertices = 0;
                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('n', 'u', 'm', 'v', 'e', 'r', 't', 's') >::RESULT,
                       numberOfVertices);

                if (numberOfVertices > 0) {
                    // Read string of vertices.
                    string vertices;
                    d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('v', 'e', 'r', 't', 'i', 'c', 'e', 's') >::RESULT,
                           vertices);
Esempio n. 14
0
                // Serializer super class.
                CoordinateSystem::operator<<(out);

                SerializationFactory sf;

                Serializer &s = sf.getSerializer(out);

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

                return out;
            }

            istream& WGS84CoordinateSystem::operator>>(istream &in) {
                // Deserializer super class.
                CoordinateSystem::operator>>(in);

                SerializationFactory sf;

                Deserializer &d = sf.getDeserializer(in);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('o', 'r', 'i', 'g', 'i', 'n') >::RESULT,
                       m_origin);

                return in;
            }

        }
    }
} // hesperia::data::scenario
                    s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('l', 'a', 'y', 'e', 'r', 's') >::RESULT,
                            sstr.str());
                }

                return out;
            }

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

                Deserializer &d = sf.getDeserializer(in);

                // Clean up.
                m_listOfLayers.clear();

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

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

                uint32_t numberOfLayers = 0;
                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('n', 'u', 'm', 'l', 'a', 'y', 'e', 'r') >::RESULT,
                       numberOfLayers);

                if (numberOfLayers > 0) {
                    string str;
                    // Read layers into stringstream.
                    d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('l', 'a', 'y', 'e', 'r', 's') >::RESULT,
                           str);
Esempio n. 16
0
                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;
            }

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

                Deserializer &d = sf.getDeserializer(in);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('s', 'o', 'u', 'r', 'c', 'e') >::RESULT,
                       m_source);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('t', 'a', 'r', 'g', 'e', 't') >::RESULT,
                       m_target);

                return in;
            }

        }
    }
} // hesperia::data::scenario
Esempio n. 17
0
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('l', 'o', 'n', 'd', 'i', 'r') >::RESULT,
                        static_cast<uint32_t>(m_LONGITUDE));

                return out;
            }

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

                Deserializer &d = sf.getDeserializer(in);

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

                uint32_t l = 0;
                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('l', 'a', 't', 'd', 'i', 'r') >::RESULT,
                       l);
                m_LATITUDE = static_cast<WGS84Coordinate::LATITUDE>(l);

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

                l = 0;
                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('l', 'o', 'n', 'd', 'i', 'r') >::RESULT,
                       l);
                m_LONGITUDE = static_cast<WGS84Coordinate::LONGITUDE>(l);

                return in;
            }

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

                return out;
            }

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

                std::shared_ptr<Deserializer> d = sf.getDeserializer(in);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('h', 'e', 'a', 'd', 'e', 'r') >::RESULT,
                       m_header);

                uint32_t numberOfObjects = 0;
                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('n', 'u', 'm', 'o', 'b', 's') >::RESULT,
                       numberOfObjects);

                if (numberOfObjects > 0) {
                    string str;
                    // Read layers into stringstream.
                    d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('o', 'b', 'j', 'e', 'c', 't', 's') >::RESULT,
                           str);

                    stringstream sstr(str);

                    // Read layer from stringstream.
Esempio n. 19
0
                s.write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('r', 'o', 't', 'z') >::RESULT,
                        getRotationZ());

                return out;
            }

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

                SerializationFactory sf;

                Deserializer &d = sf.getDeserializer(in);

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

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('b', 'e', 'g', 'i', 'n') >::RESULT,
                       m_beginInterval);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('e', 'n', 'd') >::RESULT,
                       m_endInterval);

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

                return in;
            }

        }
Esempio n. 20
0
                s->write(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('l', 'o', 'r', 'i', 'g', 'h', 't') >::RESULT,
                        m_lowerRight);

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

                return out;
            }

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

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

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('u', 'p', 'l', 'e', 'f', 't') >::RESULT,
                       m_upperLeft);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('u', 'p', 'r', 'i', 'g', 'h', 't') >::RESULT,
                       m_upperRight);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('l', 'o', 'r', 'i', 'g', 'h', 't') >::RESULT,
                       m_lowerRight);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('l', 'o', 'l', 'e', 'f', 't') >::RESULT,
                       m_lowerLeft);

                return in;
            }

        }