Goby v2
test.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 //
5 //
6 // This file is part of the Goby Underwater Autonomy Project Binaries
7 // ("The Goby Binaries").
8 //
9 // The Goby Binaries are free software: you can redistribute them and/or modify
10 // them under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 2 of the License, or
12 // (at your option) any later version.
13 //
14 // The Goby Binaries are distributed in the hope that they will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with Goby. If not, see <http://www.gnu.org/licenses/>.
21 
22 #include "goby/acomms/dccl/dccl.h"
23 #include "goby/moos/transitional/dccl_transitional.h"
24 
25 #include <cassert>
26 #include <iostream>
27 
28 using namespace goby;
29 using goby::acomms::operator<<;
30 using goby::transitional::operator<<;
31 
32 int main(int argc, char* argv[])
33 {
34  goby::glog.add_stream(goby::common::logger::DEBUG3, &std::cerr);
35  goby::glog.set_name(argv[0]);
36 
37  std::cout << "loading xml file: " << DCCL_EXAMPLES_DIR "transitional1/test.xml" << std::endl;
38 
39  // instantiate the parser with a single xml file
42  cfg.mutable_transitional_cfg()->add_message_file()->set_path(DCCL_EXAMPLES_DIR
43  "/transitional1/test.xml");
44 
45  transitional_dccl.convert_to_v2_representation(&cfg);
46 
47  std::cout << cfg.DebugString() << std::endl;
48 
49  std::cout << "all tests passed" << std::endl;
50 }
provides an API to the Transitional Dynamic CCL Codec (looks like DCCLv1, but calls DCCLv2)...
void set_name(const std::string &s)
Set the name of the application that the logger is serving.
Definition: flex_ostream.h:67
common::FlexOstream glog
Access the Goby logger through this object.
The global namespace for the Goby project.
void add_stream(logger::Verbosity verbosity=logger::VERBOSE, std::ostream *os=0)
Attach a stream object (e.g. std::cout, std::ofstream, ...) to the logger with desired verbosity...
Definition: flex_ostream.h:96