Goby v2
waveglider_sv2_codecs.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 <dccl/codecs3/field_codec_default.h>
24 
25 #include "waveglider_sv2_codecs.h"
26 #include "waveglider_sv2_frontseat_driver.pb.h"
27 
28 extern "C"
29 {
30  void dccl3_load(dccl::Codec* dccl)
31  {
32  using namespace dccl;
33 
34  FieldCodecManager::add<goby::moos::SV2IdentifierCodec>("SV2.id");
35  FieldCodecManager::add<dccl::v3::DefaultMessageCodec,
36  google::protobuf::FieldDescriptor::TYPE_MESSAGE>("SV2");
37  FieldCodecManager::add<dccl::v3::DefaultBytesCodec,
38  google::protobuf::FieldDescriptor::TYPE_BYTES>("SV2");
39  FieldCodecManager::add<goby::moos::SV2NumericCodec<dccl::uint32> >("SV2");
40 
52  dccl->load<
54  }
55 
56  void dccl3_unload(dccl::Codec* dccl)
57  {
58  using namespace dccl;
59 
71  dccl->unload<
73 
74  FieldCodecManager::remove<goby::moos::SV2IdentifierCodec>("SV2.id");
75  FieldCodecManager::remove<dccl::v3::DefaultMessageCodec,
76  google::protobuf::FieldDescriptor::TYPE_MESSAGE>("SV2");
77  FieldCodecManager::remove<dccl::v3::DefaultBytesCodec,
78  google::protobuf::FieldDescriptor::TYPE_BYTES>("SV2");
79  FieldCodecManager::remove<goby::moos::SV2NumericCodec<dccl::uint32> >("SV2");
80  }
81 }