Goby v2
moos_liaison_load.cpp
1 // Copyright 2009-2018 Toby Schneider (http://gobysoft.org/index.wt/people/toby)
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 //
6 //
7 // This file is part of the Goby Underwater Autonomy Project Libraries
8 // ("The Goby Libraries").
9 //
10 // The Goby Libraries are free software: you can redistribute them and/or modify
11 // them under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 2.1 of the License, or
13 // (at your option) any later version.
14 //
15 // The Goby Libraries are distributed in the hope that they will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with Goby. If not, see <http://www.gnu.org/licenses/>.
22 
23 #include "goby/moos/liaison_acomms.h"
24 #include "goby/moos/liaison_commander.h"
25 #include "goby/moos/liaison_geodesy.h"
26 #include "goby/moos/liaison_scope.h"
27 
28 #include "moos_liaison_load.h"
29 
30 std::vector<boost::shared_ptr<goby::common::ZeroMQService> > services_;
31 
32 extern "C"
33 {
34  std::vector<goby::common::LiaisonContainer*>
35  goby_liaison_load(const goby::common::protobuf::LiaisonConfig& cfg,
36  boost::shared_ptr<zmq::context_t> zmq_context)
37  {
38  std::vector<goby::common::LiaisonContainer*> containers;
39 
40  services_.push_back(boost::shared_ptr<goby::common::ZeroMQService>(
41  new goby::common::ZeroMQService(zmq_context)));
42  containers.push_back(new goby::common::LiaisonCommander(services_.back().get(), cfg));
43 
44  services_.push_back(boost::shared_ptr<goby::common::ZeroMQService>(
45  new goby::common::ZeroMQService(zmq_context)));
46  containers.push_back(new goby::common::LiaisonScope(services_.back().get(), cfg));
47 
48  containers.push_back(new goby::common::LiaisonGeodesy(cfg));
49 
50  services_.push_back(boost::shared_ptr<goby::common::ZeroMQService>(
51  new goby::common::ZeroMQService(zmq_context)));
52  containers.push_back(new goby::common::LiaisonAcomms(services_.back().get(), cfg));
53 
54  return containers;
55  }
56 }