mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-25 06:19:02 -06:00
Clean up interdace of Mission class
This commit is contained in:
@@ -62,26 +62,25 @@ public:
|
||||
* Returns the name of the MissionPhase.
|
||||
* \return The name of the MissionPhase
|
||||
*/
|
||||
const std::string& name() const;
|
||||
std::string name() const;
|
||||
|
||||
/**
|
||||
* Returns the TimeRange of the MissionPhase.
|
||||
* \return The TimeRange of the MissionPhase
|
||||
*/
|
||||
const TimeRange& timeRange() const;
|
||||
TimeRange timeRange() const;
|
||||
|
||||
/**
|
||||
* Returns the description of the MissionPhase.
|
||||
* \return The description of the MissionPhase
|
||||
*/
|
||||
const std::string& description() const;
|
||||
std::string description() const;
|
||||
|
||||
/**
|
||||
* Returns all subphases sorted by start time.
|
||||
* \return All subphases sorted by start time
|
||||
*/
|
||||
const std::vector<MissionPhase>& phases() const;
|
||||
|
||||
std::vector<MissionPhase> phases() const;
|
||||
|
||||
using Trace = std::vector<std::reference_wrapper<const MissionPhase>>;
|
||||
|
||||
@@ -111,6 +110,7 @@ protected:
|
||||
* \param time The time which the subphases have to cover to be added to the \p trace
|
||||
* \param trace The list of MissionPhase%s that are active during the time \p time
|
||||
* \param maxDepth The maximum depth of levels that will be considered
|
||||
* \pre maxDepth must not be negative
|
||||
*/
|
||||
void phaseTrace(double time, Trace& trace, int maxDepth) const;
|
||||
|
||||
@@ -139,7 +139,7 @@ using Mission = MissionPhase;
|
||||
* \pre \p filename must not contain tokens
|
||||
* \pre \p filename must exist
|
||||
*/
|
||||
Mission missionFromFile(std::string filename);
|
||||
Mission missionFromFile(const std::string& filename);
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
|
||||
@@ -137,19 +137,19 @@ MissionPhase::MissionPhase(const ghoul::Dictionary& dict) {
|
||||
}
|
||||
}
|
||||
|
||||
const std::string & MissionPhase::name() const {
|
||||
std::string MissionPhase::name() const {
|
||||
return _name;
|
||||
}
|
||||
|
||||
const TimeRange & MissionPhase::timeRange() const {
|
||||
TimeRange MissionPhase::timeRange() const {
|
||||
return _timeRange;
|
||||
}
|
||||
|
||||
const std::string & MissionPhase::description() const {
|
||||
std::string MissionPhase::description() const {
|
||||
return _description;
|
||||
}
|
||||
|
||||
const std::vector<MissionPhase>& MissionPhase::phases() const {
|
||||
std::vector<MissionPhase> MissionPhase::phases() const {
|
||||
return _subphases;
|
||||
}
|
||||
|
||||
@@ -163,6 +163,8 @@ MissionPhase::Trace MissionPhase::phaseTrace(double time, int maxDepth) const {
|
||||
}
|
||||
|
||||
void MissionPhase::phaseTrace(double time, Trace& trace, int maxDepth) const {
|
||||
ghoul_assert(maxDepth >= 0, "maxDepth must not be negative");
|
||||
|
||||
if (maxDepth == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -180,7 +182,7 @@ void MissionPhase::phaseTrace(double time, Trace& trace, int maxDepth) const {
|
||||
}
|
||||
}
|
||||
|
||||
Mission missionFromFile(std::string filename) {
|
||||
Mission missionFromFile(const std::string& filename) {
|
||||
ghoul_assert(!filename.empty(), "filename must not be empty");
|
||||
ghoul_assert(!FileSys.containsToken(filename), "filename must not contain tokens");
|
||||
ghoul_assert(FileSys.fileExists(filename), "filename must exist");
|
||||
|
||||
Reference in New Issue
Block a user