23 #ifndef MESSAGE_VAR20091211H 24 #define MESSAGE_VAR20091211H 36 #include <boost/lexical_cast.hpp> 38 #include "dccl_constants.h" 39 #include "goby/acomms/dccl.h" 40 #include "message_val.h" 43 namespace transitional
47 class DCCLAlgorithmPerformer;
54 virtual void write_schema_to_dccl2(std::ofstream* proto_file,
int sequence_number);
59 void set_name(std::string name) { name_ = name; }
60 void set_source_var(std::string source_var)
62 source_var_ = source_var;
65 void set_source_key(std::string source_key) { source_key_ = source_key; }
66 void set_source_set(
bool source_set) { source_set_ = source_set; }
67 void set_algorithms(
const std::vector<std::string>& algorithm) { algorithms_ = algorithm; }
70 virtual void set_max(
const std::string& s) { bad_overload(
"set_max()"); }
71 virtual void set_min(
const std::string& s) { bad_overload(
"set_min()"); }
72 virtual void set_precision(
const std::string& s) { bad_overload(
"set_precision()"); }
73 virtual void set_max_length(
const std::string& s) { bad_overload(
"set_max_length()"); }
74 virtual void set_num_bytes(
const std::string& s) { bad_overload(
"set_num_bytes()"); }
75 virtual void set_static_val(
const std::string& static_val) { bad_overload(
"set_static_val()"); }
76 virtual void add_enum(std::string senum) { bad_overload(
"add_enum()"); }
77 virtual void set_max_delta(
const std::string& s) { bad_overload(
"set_max_delta()"); }
79 void set_array_length(
unsigned u) { array_length_ = u; }
80 void set_array_length(
const std::string& s)
82 set_array_length(boost::lexical_cast<unsigned>(s));
85 virtual double max()
const 87 bad_overload(
"max()");
90 virtual double min()
const 92 bad_overload(
"min()");
95 virtual int precision()
const 97 bad_overload(
"precision()");
100 virtual unsigned max_length()
const 102 bad_overload(
"max_length()");
105 virtual unsigned num_bytes()
const 107 bad_overload(
"num_bytes()");
110 virtual std::string static_val()
const 112 bad_overload(
"static_val()");
115 virtual std::vector<std::string>* enums()
117 bad_overload(
"enums()");
121 unsigned array_length()
const {
return array_length_; }
126 std::string name()
const {
return name_; }
127 std::string source_var()
const {
return source_var_; }
129 int sequence_number()
const {
return sequence_number_; }
130 const std::vector<std::string>& algorithms()
const {
return algorithms_; }
136 void set_defaults(std::map<std::string, std::vector<DCCLMessageVal> >& vals,
unsigned modem_id,
140 virtual void initialize_specific() = 0;
142 virtual std::string additional_option_extensions() {
return ""; }
144 virtual void set_defaults_specific(
DCCLMessageVal& v,
unsigned modem_id,
unsigned id)
146 bad_overload(
"set_defaults_specific()");
150 void bad_overload(
const std::string& s)
const 152 throw(goby::acomms::DCCLException(
153 std::string(s +
" not supported by this DCCLMessageVar: " + name() +
" (" +
154 type_to_string(type()) +
")")));
158 unsigned array_length_;
161 std::string source_var_;
163 int sequence_number_;
168 std::string source_key_;
169 std::vector<std::string> algorithms_;
DCCLType
Enumeration of DCCL types used for sending messages. dccl_enum and dccl_string primarily map to cpp_s...
The global namespace for the Goby project.