inlib
1.2.0
|
00001 // Copyright (C) 2010, Guy Barrand. All rights reserved. 00002 // See the file inlib.license for terms. 00003 00004 #ifndef inlib_wall_send_sg 00005 #define inlib_wall_send_sg 00006 00007 #include "data_client" 00008 #include "../sg/write_exsg" 00009 00010 namespace inlib { 00011 namespace wall { 00012 00013 inline bool send_sg(inlib::wall::data_client& a_dc, 00014 inlib::sg::node& a_node, 00015 const std::string& a_options) { 00016 //a_options are treated in ioda/open_file. 00017 if(!a_dc.socket().is_connected()) return false; 00018 00019 inlib::sg::write_exsg action(a_dc.out()); 00020 00021 if(!action.open_buffer()) return false; 00022 if(!a_node.write(action)) return false; 00023 if(!action.close_buffer()) return false; 00024 00025 if(!a_dc.send_buffer_doc 00026 (action.buffer().length(),action.buffer().buf(), 00027 a_options)) return false; 00028 00029 return true; 00030 } 00031 00032 }} 00033 00034 #endif