##// END OF EJS Templates
Correction MR
perrinel -
r278:462cefb59d8a
parent child
Show More
@@ -30,7 +30,7 public:
30
30
31 QVector<SqpDateTime> dateCacheList(std::shared_ptr<Variable> variable) const noexcept;
31 QVector<SqpDateTime> dateCacheList(std::shared_ptr<Variable> variable) const noexcept;
32
32
33 void displayCache(std::shared_ptr<Variable> variable);
33 void displayCache(std::shared_ptr<Variable> variable) const;
34
34
35 private:
35 private:
36 class VariableCacheControllerPrivate;
36 class VariableCacheControllerPrivate;
@@ -50,8 +50,13 void VariableCacheController::addDateTime(std::shared_ptr<Variable> variable,
50 // will be compared to the next interval. The old one is remove from the list
50 // will be compared to the next interval. The old one is remove from the list
51 // C: if it is superior, we do the same with the next interval of the list
51 // C: if it is superior, we do the same with the next interval of the list
52
52
53 impl->addDateTimeRecurse(dateTime, impl->m_VariableToSqpDateTimeListMap.at(variable),
53 try {
54 0);
54 impl->addDateTimeRecurse(dateTime,
55 impl->m_VariableToSqpDateTimeListMap.at(variable), 0);
56 }
57 catch (const std::out_of_range &e) {
58 qCInfo(LOG_VariableCacheController()) << e.what();
59 }
55 }
60 }
56 }
61 }
57 }
62 }
@@ -67,8 +72,13 VariableCacheController::provideNotInCacheDateTimeList(std::shared_ptr<Variable>
67 // We assume that the list is ordered in a way that l(0) < l(1). We assume also a < b
72 // We assume that the list is ordered in a way that l(0) < l(1). We assume also a < b
68 // (with a & b of type SqpDateTime) means ts(b) > te(a)
73 // (with a & b of type SqpDateTime) means ts(b) > te(a)
69
74
70 impl->addInCacheDataByStart(dateTime, impl->m_VariableToSqpDateTimeListMap.at(variable),
75 try {
71 notInCache, 0, dateTime.m_TStart);
76 impl->addInCacheDataByStart(dateTime, impl->m_VariableToSqpDateTimeListMap.at(variable),
77 notInCache, 0, dateTime.m_TStart);
78 }
79 catch (const std::out_of_range &e) {
80 qCInfo(LOG_VariableCacheController()) << e.what();
81 }
72
82
73 return notInCache;
83 return notInCache;
74 }
84 }
@@ -76,7 +86,13 VariableCacheController::provideNotInCacheDateTimeList(std::shared_ptr<Variable>
76 QVector<SqpDateTime>
86 QVector<SqpDateTime>
77 VariableCacheController::dateCacheList(std::shared_ptr<Variable> variable) const noexcept
87 VariableCacheController::dateCacheList(std::shared_ptr<Variable> variable) const noexcept
78 {
88 {
79 return impl->m_VariableToSqpDateTimeListMap.at(variable);
89 try {
90 return impl->m_VariableToSqpDateTimeListMap.at(variable);
91 }
92 catch (const std::out_of_range &e) {
93 qCInfo(LOG_VariableCacheController()) << e.what();
94 return QVector<SqpDateTime>{};
95 }
80 }
96 }
81
97
82 void VariableCacheController::VariableCacheControllerPrivate::addDateTimeRecurse(
98 void VariableCacheController::VariableCacheControllerPrivate::addDateTimeRecurse(
@@ -175,9 +191,15 void VariableCacheController::VariableCacheControllerPrivate::addInCacheDataBySt
175 }
191 }
176
192
177
193
178 void VariableCacheController::displayCache(std::shared_ptr<Variable> variable)
194 void VariableCacheController::displayCache(std::shared_ptr<Variable> variable) const
179 {
195 {
180 auto variableDateTimeList = impl->m_VariableToSqpDateTimeListMap.at(variable);
196 auto variableDateTimeList = impl->m_VariableToSqpDateTimeListMap.find(variable);
181 qCInfo(LOG_VariableCacheController()) << tr("VariableCacheController::displayCache")
197 if (variableDateTimeList != impl->m_VariableToSqpDateTimeListMap.end()) {
182 << variableDateTimeList;
198 qCInfo(LOG_VariableCacheController()) << tr("VariableCacheController::displayCache")
199 << variableDateTimeList->second;
200 }
201 else {
202 qCWarning(LOG_VariableCacheController())
203 << tr("Cannot display a variable that is not in the cache");
204 }
183 }
205 }
General Comments 1
Under Review
author

Auto status change to "Under Review"

You need to be logged in to leave comments. Login now