Repository navigation
Expand file tree
/
Copy pathModelErrors.cc
More file actions
62 lines (53 loc) · 2.22 KB
/
Copy pathModelErrors.cc
File metadata and controls
62 lines (53 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/***
DEVSIM
Copyright 2013 DEVSIM LLC
SPDX-License-Identifier: Apache-2.0
***/
#include "ModelErrors.hh"
#include "GeneralErrors.hh"
#include "GeometryStream.hh"
#include "ErrorHelpers.hh"
#include <sstream>
#include <string>
namespace dsErrors {
std::string ModelModelDeletion(const Region ®ion, const std::string &dep_model, ModelInfo::ModelType dep_mt, const std::string &model, ModelInfo::ModelType mt, OutputStream::OutputType ot)
{
std::ostringstream os;
os << FormatDeviceAndRegionName(region)
<< " " <<
FormatModelNameAndType(dep_model, dep_mt) << " is being deleted as " <<
FormatModelNameAndType(model, mt) << " is being deleted\n";
GeometryStream::WriteOut(ot, region, os.str());
return os.str();
}
std::string MissingModelModelDependency(const Region ®ion, const std::string &req_model, ModelInfo::ModelType req_mt, const std::string &model, ModelInfo::ModelType mt, OutputStream::OutputType ot)
{
std::ostringstream os;
os << FormatDeviceAndRegionName(region)
<< " " <<
FormatModelNameAndType(req_model, req_mt) << " does not exist so " <<
FormatModelNameAndType(model, mt) << " cannot be calculated\n";
GeometryStream::WriteOut(ot, region, os.str());
return os.str();
}
std::string ReviveContainer(const Region ®ion, const std::string &rev_model, ModelInfo::ModelType rev_mt, const std::string &model, ModelInfo::ModelType mt, OutputStream::OutputType ot)
{
std::ostringstream os;
os << FormatDeviceAndRegionName(region)
<< " " <<
FormatModelNameAndType(rev_model, rev_mt) << " appears to have been deleted. Being recreated as calculating " <<
FormatModelNameAndType(model, mt) << "\n";
GeometryStream::WriteOut(ot, region, os.str());
return os.str();
}
std::string ChangedModelModelDependency(const Region ®ion, const std::string &req_model, ModelInfo::ModelType req_mt, const std::string &model, ModelInfo::ModelType mt, OutputStream::OutputType ot)
{
std::ostringstream os;
os << FormatDeviceAndRegionName(region)
<< " " <<
FormatModelNameAndType(req_model, req_mt) << " appears to have been redefined since last calculation of " <<
FormatModelNameAndType(model, mt) << "\n";
GeometryStream::WriteOut(ot, region, os.str());
return os.str();
}
}