Goby v2
|
defines a DCCL value More...
#include <goby/moos/transitional/message_val.h>
Public Types | |
enum | { MAX_DBL_PRECISION = 15 } |
Public Member Functions | |
Constructors/Destructor | |
DCCLMessageVal () | |
empty | |
DCCLMessageVal (const std::string &s) | |
construct with string value | |
DCCLMessageVal (const char *s) | |
construct with char* value | |
DCCLMessageVal (double d, int p=MAX_DBL_PRECISION) | |
construct with double value, optionally givig the precision of the double (number of decimal places) which is used if a cast to std::string is required in the future. | |
DCCLMessageVal (long l) | |
construct with long value | |
DCCLMessageVal (int i) | |
construct with int value | |
DCCLMessageVal (float f) | |
construct with float value | |
DCCLMessageVal (bool b) | |
construct with bool value | |
DCCLMessageVal (const std::vector< DCCLMessageVal > &vm) | |
construct with vector | |
Setters | |
void | set (std::string sval) |
set the value with a string (overwrites previous value regardless of type) | |
void | set (double dval, int precision=MAX_DBL_PRECISION) |
set the value with a double (overwrites previous value regardless of type) More... | |
void | set (long lval) |
set the value with a long (overwrites previous value regardless of type) | |
void | set (bool bval) |
set the value with a bool (overwrites previous value regardless of type) | |
Getters | |
bool | get (std::string &s) const |
extract as std::string (all reasonable casts are done) More... | |
bool | get (bool &b) const |
extract as bool (all reasonable casts are done) More... | |
bool | get (long &t) const |
extract as long (all reasonable casts are done) More... | |
bool | get (double &d) const |
extract as double (all reasonable casts are done) More... | |
operator double () const | |
allows statements of the form More... | |
operator bool () const | |
allows statements of the form More... | |
operator std::string () const | |
allows statements of the form More... | |
operator long () const | |
allows statements of the form More... | |
operator int () const | |
allows statements of the form More... | |
operator unsigned () const | |
allows statements of the form More... | |
operator float () const | |
allows statements of the form More... | |
operator std::vector< DCCLMessageVal > () const | |
DCCLCppType | type () const |
what type is the original type of this DCCLMessageVal? | |
bool | empty () const |
was this just constructed with DCCLMessageVal() ? | |
unsigned | precision () const |
Comparison | |
bool | operator== (const DCCLMessageVal &mv) const |
bool | operator== (const std::string &s) const |
bool | operator== (double d) const |
bool | operator== (long l) const |
bool | operator== (bool b) const |
Friends | |
std::ostream & | operator<< (std::ostream &os, const DCCLMessageVal &mv) |
defines a DCCL value
Definition at line 35 of file message_val.h.
bool goby::transitional::DCCLMessageVal::get | ( | std::string & | s | ) | const |
extract as std::string (all reasonable casts are done)
s | std::string to store value in |
Definition at line 132 of file message_val.cpp.
extract as bool (all reasonable casts are done)
b | bool to store value in |
Definition at line 156 of file message_val.cpp.
bool goby::transitional::DCCLMessageVal::get | ( | long & | t | ) | const |
extract as long (all reasonable casts are done)
t | long to store value in |
Definition at line 197 of file message_val.cpp.
extract as double (all reasonable casts are done)
d | double to store value in |
Definition at line 237 of file message_val.cpp.
goby::transitional::DCCLMessageVal::operator bool | ( | ) | const |
goby::transitional::DCCLMessageVal::operator double | ( | ) | const |
goby::transitional::DCCLMessageVal::operator float | ( | ) | const |
goby::transitional::DCCLMessageVal::operator int | ( | ) | const |
allows statements of the form
Definition at line 312 of file message_val.cpp.
goby::transitional::DCCLMessageVal::operator long | ( | ) | const |
allows statements of the form
Definition at line 303 of file message_val.cpp.
goby::transitional::DCCLMessageVal::operator std::string | ( | ) | const |
allows statements of the form
Definition at line 294 of file message_val.cpp.
goby::transitional::DCCLMessageVal::operator unsigned | ( | ) | const |
allows statements of the form
Definition at line 314 of file message_val.cpp.
set the value with a double (overwrites previous value regardless of type)
dval | values to set |
precision | decimal places of precision to preserve if this is cast to a string |
Definition at line 115 of file message_val.cpp.