24 #define LOG_NW LOG_STREAM(info, log_network) 25 #define ERR_NW LOG_STREAM(err, log_network) 29 assert(!
data_.empty());
31 this->
data_.emplace_back();
33 bool has_data =
false;
41 this->
data_.pop_back();
46 if((!has_data) || back.
empty())
48 this->
data_.pop_back();
51 assert(!
data_.back().empty());
55 ERR_NW <<
"found unexpected attribute:" <<back.
debug() << std::endl;
56 this->
data_.pop_back();
59 assert(!
data_.back().empty());
65 assert(!
data_.empty());
66 if (
data_.size() > 1)
return false;
67 return this->
next_ ==
data_.back().ordered_end();
102 if(
next_->key ==
"turn")
108 config& childchild_old = itor->cfg;
110 childchild.
swap(childchild_old);
122 child.
swap(child_old);
145 LOG_NW <<
"Destroying playturn_network_adapter with an non empty buffer, this means loss of network data" << std::endl;
172 return std::bind(
read_config, std::ref(cfg), std::placeholders::_1);
source_type network_reader_
unsigned int next_command_num_
~playturn_network_adapter()
void remove_attribute(config_key_type key)
void set_source(source_type source)
const_attr_itors attribute_range() const
static lg::log_domain log_network("network")
std::list< config > data_front_
config::all_children_iterator next_
std::function< bool(config &)> source_type
void push_front(config &&cfg)
static source_type get_source_from_config(config &src)
config & add_child(config_key_type key)
const_all_children_iterator ordered_begin() 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.
std::string debug() const
playturn_network_adapter(source_type source)