📄 datastructures.hpp
字号:
satTypeValueMap& removeSatID(const SatID& satellite) { (*this).erase(satellite); return (*this); } /// Modifies this object, removing these satellites. /// @param satSet Set (SatIDSet) containing the satellites /// to be removed. satTypeValueMap& removeSatID(const SatIDSet& satSet); /// Modifies this object, removing this type of data. /// @param type Type of value to be removed. satTypeValueMap& removeTypeID(const TypeID& type); /// Modifies this object, removing these types of data. /// @param typeSet Set (TypeIDSet) containing the types of data /// to be kept. satTypeValueMap& removeTypeID(const TypeIDSet& typeSet); /// Returns a GPSTk::Vector containing the data values with this type. /// @param type Type of value to be returned. /// This method returns zero if a given satellite does not have /// this type. Vector<double> getVectorOfTypeID(const TypeID& type) const; /// Returns a GPSTk::Matrix containing the data values in this set. /// @param typeSet TypeIDSet of values to be returned. Matrix<double> getMatrixOfTypes(const TypeIDSet& typeSet) const; /** Modifies this object, adding one vector of data with this type, * one value per satellite. * * If type already exists, data is overwritten. If the number of * values does not match with the number of satellites, a * NumberOfSatsMismatch exception is thrown. * * Given that dataVector does not store information about the * satellites the values correspond to, the user is held responsible * for having the data values stored in dataVector in the proper * order regarding the SatIDs in this object. * * @param type Type of data to be added. * @param dataVector GPSTk Vector containing the data to be added. */ satTypeValueMap& insertTypeIDVector( const TypeID& type, const Vector<double> dataVector ) throw(NumberOfSatsMismatch); /** Modifies this object, adding a matrix of data, one vector * per satellite. * * If types already exists, data is overwritten. If the number of * rows in matrix does not match with the number of satellites, a * NumberOfSatsMismatch exception is thrown. If the number of columns * in matrix does not match with the number of types in typeSet, a * NumberOfTypesMismatch exception is thrown. * * Given that dataMatrix does not store information about the * satellites and types the values correspond to, the user is held * responsible for having those data values stored in dataMatrix in * the proper order regarding the SatIDs in this object and the * provided typeSet. * * @param typeSet Set (TypeIDSet) containing the types of data * to be added. * @param dataMatrix GPSTk Matrix containing the data to be added. */ satTypeValueMap& insertMatrix( const TypeIDSet& typeSet, const Matrix<double> dataMatrix ) throw(NumberOfSatsMismatch, NumberOfTypesMismatch); /// Returns a reference to the typeValueMap with corresponding SatID. /// @param type Type of value to be look for. typeValueMap& operator()(const SatID& satellite) throw(SatIDNotFound); /// Convenience output method virtual std::ostream& dump( std::ostream& s, int mode = 0) const; /// Destructor. virtual ~satTypeValueMap() {}; }; // End of satTypeValueMap /// stream output for satTypeValueMap std::ostream& operator<<( std::ostream& s, const satTypeValueMap& stvMap); /// Map holding epoch with corresponding satTypeValueMap. typedef std::map<DayTime, satTypeValueMap> epochSatTypeValueMap; /// Map holding epoch with corresponding satValueMap. typedef std::map<DayTime, satValueMap> epochSatValueMap; /// Map holding epoch with corresponding typeValueMap. typedef std::map<DayTime, typeValueMap> epochTypeValueMap; /// Basic gnssData structure. template <class HEADER_CLASS, class BODY_CLASS> struct gnssData { /// Header. HEADER_CLASS header; /// Body. BODY_CLASS body; /// Default constructor. gnssData() {} /// Common constructor. gnssData( const HEADER_CLASS& h, const BODY_CLASS& b ) { header = h; body = b; } /// Copy constructor. template<class H, class B> gnssData(const gnssData<H,B>& g) { header = g.header; body = g.body; } /// Destructor. virtual ~gnssData() {}; }; // End of gnssData // Further type definitions /// GNSS data structure with source, epoch and data type as header /// (common indexes) and satValueMap as body. struct gnssSatValue : gnssData<sourceEpochTypeHeader, satValueMap> { /// Returns the number of satellites available in the body, /// which is a satValueMap. size_t numSats() const { return body.numSats(); }; /// Returns a SatIDSet with all the satellites present in this object. SatIDSet getSatID() const { return (*this).body.getSatID(); } /// Returns a Vector with all the satellites present in this object. Vector<SatID> getVectorOfSatID() const { return body.getVectorOfSatID(); } /// Returns a gnssSatValue with only this satellite. /// @param satellite Satellite to be extracted. gnssSatValue extractSatID(const SatID& satellite) const; /// Returns a gnssSatValue with only one satellite, identified by /// the given parameters. /// @param p Satellite PRN number. /// @param p System the satellite belongs to. gnssSatValue extractSatID( const int& p, const SatID::SatelliteSystem& s ) const; /// Returns a gnssSatValue with only these satellites. /// @param satSet Set (SatIDSet) containing the satellites /// to be extracted. gnssSatValue extractSatID(const SatIDSet& satSet) const; /// Modifies this object, keeping only this satellite. /// @param satellite Satellite to be kept. gnssSatValue& keepOnlySatID(const SatID& satellite); /// Modifies this object, keeping only this satellite. /// @param p Satellite PRN number. /// @param p System the satellite belongs to. gnssSatValue& keepOnlySatID( const int& p, const SatID::SatelliteSystem& s ); /// Modifies this object, keeping only these satellites. /// @param satSet Set (SatIDSet) containing the satellites to be kept. gnssSatValue& keepOnlySatID(const SatIDSet& satSet); /// Modifies this object, removing this satellite. /// @param satellite Satellite to be removed. gnssSatValue& removeSatID(const SatID& satellite) { (*this).body.erase(satellite); return (*this); } /// Modifies this object, removing these satellites. /// @param satSet Set (SatIDSet) containing the satellites /// to be removed. gnssSatValue& removeSatID(const SatIDSet& satSet); /// Returns a reference to the value (double) with corresponding /// satellite. /// @param satellite Satellite to be looked for. double& operator()(const SatID& satellite) throw(SatIDNotFound) { return (*this).body(satellite); } /// Destructor. virtual ~gnssSatValue() {}; }; // End of gnssSatValue /// GNSS data structure with source, epoch and satellite as header /// (common indexes) and typeValueMap as body. struct gnssTypeValue : gnssData<sourceEpochSatHeader, typeValueMap> { /// Returns the number of types available in the body, /// which is a typeValueMap. size_t numTypes() const { return body.numTypes(); }; /// Returns a TypeIDSet with all the data types present /// in this object. TypeIDSet getTypeID() const { return (*this).body.getTypeID(); } /// Returns a gnssTypeValue with only this type of data. /// @param type Type of value to be extracted. gnssTypeValue extractTypeID(const TypeID& type) const; /// Returns a gnssTypeValue with only these types of data. /// @param typeSet Set (TypeIDSet) containing the types of data /// to be extracted. gnssTypeValue extractTypeID(const TypeIDSet& typeSet) const; /// Modifies this object, keeping only this type of data. /// @param type Type of value to be kept. gnssTypeValue& keepOnlyTypeID(const TypeID& type); /// Modifies this object, keeping only these types of data. /// @param typeSet Set (TypeIDSet) containing the types of data /// to be kept. gnssTypeValue& keepOnlyTypeID(const TypeIDSet& typeSet); /// Modifies this object, removing this type of data. /// @param type Type of value to be removed. gnssTypeValue& removeTypeID(const TypeID& type) { (*this).body.erase(type); return (*this); } /// Modifies this object, removing these types of data. /// @param typeSet Set (TypeIDSet) containing the types of data /// to be kept. gnssTypeValue& removeTypeID(const TypeIDSet& typeSet); /// Returns a reference to the value (double) with corresponding type. /// @param type TypeID to be looked for. double& operator()(const TypeID& type) throw(TypeIDNotFound) { return (*this).body(type); } /// Destructor. virtual ~gnssTypeValue() {}; }; // End of gnssTypeValue /// GNSS data structure with source and epoch as header /// (common indexes) and satTypeValueMap as body. struct gnssSatTypeValue : gnssData<sourceEpochHeader, satTypeValueMap> { /// Returns the number of satellites available in the body, /// which is a satTypeValueMap. size_t numSats() const { return body.numSats(); }; /// Returns a TypeIDSet with all the data types present in /// this object. TypeIDSet getTypeID() const { return (*this).body.getTypeID(); } /// Returns a SatIDSet with all the satellites present in this object. SatIDSet getSatID() const { return (*this).body.getSatID(); } /// Returns a Vector with all the satellites present in this object. Vector<SatID> getVectorOfSatID() const { return (*this).body.getVectorOfSatID(); } /** Returns the total number of data elements in the body. * This method DOES NOT suppose that all the satellites have * the same number of type values. */ size_t numElements() const { return body.numElements(); }; /// Returns a gnssSatTypeValue with only this satellite. /// @param satellite Satellite to be extracted. gnssSatTypeValue extractSatID(const SatID& satellite) const; /// Returns a gnssSatTypeValue with only one satellite, identified /// by the given parameters. /// @param p Satellite PRN number. /// @param p System the satellite belongs to. gnssSatTypeValue extractSatID( const int& p, const SatID::SatelliteSystem& s ) const; /// Returns a gnssSatTypeValue with only these satellites. /// @param satSet Set (SatIDSet) containing the satellites /// to be extracted. gnssSatTypeValue extractSatID(const SatIDSet& satSet) const; /// Modifies this object, keeping only this satellite. /// @param satellite Satellite to be kept. gnssSatTypeValue& keepOnlySatID(const SatID& satellite); /// Modifies this object, keeping only this satellite. /// @param p Satellite PRN number. /// @param p System the satellite belongs to. gnssSatTypeValue& keepOnlySatID( const int& p, const SatID::SatelliteSystem& s ); /// Modifies this object, keeping only these satellites. /// @param satSet Set (SatIDSet) containing the satellites to be kept. gnssSatTypeValue& keepOnlySatID(const SatIDSet& satSet);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -