WSF
EclipseReport.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2017 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef ECLIPSEREPORT_HPP
13#define ECLIPSEREPORT_HPP
14
15#include <iostream>
16#include <map>
17#include <string>
18#include <unordered_set>
19
20#include "post_processor_lib_export.h"
21
22#include "Report.hpp"
23class UtInput;
24
25class POST_PROCESSOR_LIB_EXPORT EclipseReport : public Report
26{
27 public:
28
29 EclipseReport() = delete;
30 explicit EclipseReport(const Options& aOptions);
31 ~EclipseReport() override = default;
32
33 //Time elements for Eclipse events
35 {
36 EclipseInterval() = default;
37 EclipseInterval(const EclipseInterval& aEclipseInterval);
38 EclipseInterval(double aStart,
39 double aEnd);
40 double mStart;
41 double mEnd;
42 double mDuration;
43
44 bool operator<(const EclipseInterval& aRhs) const;
45 };
46
47 //Eclipse events
49 {
50 EclipseEvent() = default;
51 EclipseEvent(const std::string& aPlatform, const EclipseInterval& aEclipseInterval);
52 std::string mPlatform;
54
55 bool operator<(const EclipseEvent& aRhs) const;
56 };
57
58 using EclipseMap = std::map< std::string, EclipseInterval >;
59 using EclipseQueue = std::priority_queue<EclipseEvent>;
60
61 bool CreateRequiredData(std::string& aOutputDir) override;
62 bool Filter(std::vector<std::string>& aLine) override;
63 void PrintReportHeader(std::ostream& aStream) override;
64 void PrintReport(std::istream& aInStream, std::ostream& aOutStream) override;
65 bool ProcessInputConfiguration(UtInput& aInput) override;
66 bool UpdateEclipseReport(std::vector<std::string>& aDataStrVec, double aEvtTime);
67
68 private:
69
70 //Tracks the platforms that the user wants to have data for in the report
71 std::unordered_set<std::string> mPlatforms;
72
73 //Tracks the set of platforms that currently has an ECLIPSE_ENTRY event without a corresponding ECLIPSE_EXIT event.
74 EclipseMap mEclipseMap;
75
76 //Tracks the intervals of all platforms' eclipse entry and exit
77 EclipseQueue mEclipseQueue;
78};
79
80#endif
std::priority_queue< EclipseEvent > EclipseQueue
Definition EclipseReport.hpp:59
~EclipseReport() override=default
EclipseReport()=delete
std::map< std::string, EclipseInterval > EclipseMap
Definition EclipseReport.hpp:58
bool UpdateEclipseReport(std::vector< std::string > &aDataStrVec, double aEvtTime)
Definition EclipseReport.cpp:180
virtual bool ProcessInputConfiguration(UtInput &aInput)
Definition Report.cpp:67
bool PrintReport()
Definition Report.cpp:267
virtual void PrintReportHeader(std::ostream &aStream)
Definition Report.hpp:138
virtual bool Filter(std::vector< std::string > &aLine)
Definition Report.hpp:139
Report()=delete
virtual bool CreateRequiredData(std::string &aOutputDir)
Definition Report.hpp:136
std::string mPlatform
Definition EclipseReport.hpp:52
EclipseInterval mInterval
Definition EclipseReport.hpp:53
bool operator<(const EclipseEvent &aRhs) const
Definition EclipseReport.cpp:279
Definition EclipseReport.hpp:35
bool operator<(const EclipseInterval &aRhs) const
Definition EclipseReport.cpp:285
double mStart
Definition EclipseReport.hpp:40
double mDuration
Definition EclipseReport.hpp:42
double mEnd
Definition EclipseReport.hpp:41
Definition Options.hpp:21
Copyrights Multiple, All Rights Reserved