5 #include <boost/assign.hpp>
7 #include <boost/ref.hpp>
13 #define LOG_NW LOG_STREAM(info, log_network)
14 #define ERR_NW LOG_STREAM(err, log_network)
18 assert(!
data_.empty());
22 bool has_data =
false;
30 this->
data_.pop_back();
35 if((!has_data) || back.
empty())
37 this->
data_.pop_back();
40 assert(!
data_.back().empty());
45 child[
"side_num"] = back[
"side_drop"];
46 child[
"controller"] = back[
"controller"];
53 ERR_NW <<
"found unexpected attribute:" <<back.
debug() << std::endl;
54 this->
data_.pop_back();
57 assert(!
data_.back().empty());
63 assert(!
data_.empty());
64 return this->
next_ ==
data_.back().ordered_end();
89 if(
next_->key ==
"turn")
98 childchild.
swap(childchild_old);
110 child.
swap(child_old);
118 next_(data_.front().ordered_end()),
119 next_command_num_(0),
120 network_reader_(source)
131 LOG_NW <<
"Destroying playturn_network_adapter with an non empty buffer, this means loss of network data" << std::endl;
void remove_attribute(const std::string &key)
source_type network_reader_
unsigned int next_command_num_
~playturn_network_adapter()
std::string debug() const
void set_source(source_type source)
static lg::log_domain log_network("network")
config & add_child(const std::string &key)
config::all_children_iterator next_
std::map< std::string, tfilter >::iterator itor
std::function< bool(config &)> source_type
const_attr_itors attribute_range() const
static source_type get_source_from_config(config &src)
bool has_attribute(const std::string &key) const
std::list< config > data_
Standard logging facilities (interface).
static bool read_config(config &src, config &dst)
A config object defines a single node in a WML file, with access to child nodes.
GLsizei GLsizei GLchar * source
all_children_iterator ordered_begin() const
playturn_network_adapter(source_type source)