Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-12-10 02:05:00 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-12-10 02:05:00 +0300
commit240b88c6834c9c94e8a6448a34dc4ad33bdf3fbd (patch)
treee9f43dba3717e8a430557c16a1d6543a13628ddf /moses-cmd
parentad5e27ae56298564dfd73637c160a682b5f5f028 (diff)
Passing around AllOptions or references thereto everywhere,
strong them locally where appropriate, so that compontents can become independent of StaticData once instantiated.
Diffstat (limited to 'moses-cmd')
-rw-r--r--moses-cmd/LatticeMBRGrid.cpp2
-rw-r--r--moses-cmd/MainVW.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/moses-cmd/LatticeMBRGrid.cpp b/moses-cmd/LatticeMBRGrid.cpp
index 0fddaa82d..f1dfd5b26 100644
--- a/moses-cmd/LatticeMBRGrid.cpp
+++ b/moses-cmd/LatticeMBRGrid.cpp
@@ -167,7 +167,7 @@ int main(int argc, char const* argv[])
MBR_Options& mbr = SD.options().mbr;
lmbr.enabled = true;
- boost::shared_ptr<IOWrapper> ioWrapper(new IOWrapper);
+ boost::shared_ptr<IOWrapper> ioWrapper(new IOWrapper(SD.options()));
if (!ioWrapper) {
throw runtime_error("Failed to initialise IOWrapper");
}
diff --git a/moses-cmd/MainVW.cpp b/moses-cmd/MainVW.cpp
index 94eee66d9..396a1c1d4 100644
--- a/moses-cmd/MainVW.cpp
+++ b/moses-cmd/MainVW.cpp
@@ -125,8 +125,8 @@ int main(int argc, char const** argv)
IFVERBOSE(1) {
PrintUserTime("Created input-output object");
}
-
- boost::shared_ptr<IOWrapper> ioWrapper(new IOWrapper());
+ AllOptions::ptr opts(new AllOptions(StaticData::Instance().options()));
+ boost::shared_ptr<IOWrapper> ioWrapper(new IOWrapper(*opts));
if (ioWrapper == NULL) {
cerr << "Error; Failed to create IO object" << endl;
exit(1);