00001 #ifndef DBALLE_CPP_MSG_H 00002 #define DBALLE_CPP_MSG_H 00003 00004 #include <dballe/msg/msg.h> 00005 00006 #include <dballe++/var.h> 00007 00008 namespace dballe { 00009 00013 class Msg 00014 { 00015 dba_msg m_msg; 00016 00018 Msg(const Msg& var); 00020 Msg& operator=(const Msg& var); 00021 public: 00023 Msg(); 00024 ~Msg(); 00025 00026 void set(Var& var, dba_varcode code, int ltype1, int l1, int ltype2, int l2, int pind, int p1, int p2) 00027 { 00028 checked(dba_msg_set(m_msg, var.var(), code, ltype1, l1, ltype2, l2, pind, p1, p2)); 00029 } 00030 00031 void setd(dba_varcode code, double val, int conf, int ltype1, int l1, int ltype2, int l2, int pind, int p1, int p2) 00032 { 00033 checked(dba_msg_setd(m_msg, code, val, conf, ltype1, l1, ltype2, l2, pind, p1, p2)); 00034 } 00035 00037 const dba_msg msg() const 00038 { 00039 return m_msg; 00040 } 00042 dba_msg msg() 00043 { 00044 return m_msg; 00045 } 00046 00047 std::string encodeBUFR(int type, int subtype, int localsubtype); 00048 }; 00049 00050 } 00051 00052 #endif