25 #define DBG_NW LOG_STREAM(debug, log_network)
26 #define LOG_NW LOG_STREAM(info, log_network)
27 #define ERR_NW LOG_STREAM(err, log_network)
31 assert(!
data_.empty());
33 this->
data_.emplace_back();
35 bool has_data =
false;
44 this->
data_.pop_back();
47 if((!has_data) || back.
empty())
49 this->
data_.pop_back();
52 assert(!
data_.back().empty());
56 ERR_NW <<
"found unexpected attribute:" <<back.
debug();
57 this->
data_.pop_back();
60 assert(!
data_.back().empty());
66 assert(!
data_.empty());
67 if (
data_.size() > 1)
return false;
68 return this->
next_ ==
data_.back().ordered_end();
103 if(
next_->key ==
"turn")
109 config& childchild_old = itor->cfg;
111 childchild.
swap(childchild_old);
123 child.
swap(child_old);
130 : network_reader_(std::move(source))
133 , next_(data_.front().ordered_end())
134 , next_command_num_(0)
144 LOG_NW <<
"Destroying playturn_network_adapter with an non empty buffer, this means loss of network data";
A config object defines a single node in a WML file, with access to child nodes.
const_all_children_iterator ordered_begin() const
const_attr_itors attribute_range() const
std::string debug() const
config & add_child(config_key_type key)
std::list< config > data_front_
std::list< config > data_
std::function< bool(config &)> source_type
config::all_children_iterator next_
playturn_network_adapter(source_type source)
source_type network_reader_
~playturn_network_adapter()
void push_front(config &&cfg)
unsigned int next_command_num_
Standard logging facilities (interface).
std::string get_unknown_exception_type()
Utility function for finding the type of thing caught with catch(...).
static lg::log_domain log_network("network")
rect dst
Location on the final composed sheet.
bool empty() const
False if both w and h are > 0, true otherwise.