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();
49 if((!has_data) || back.
empty())
51 this->
data_.pop_back();
54 assert(!
data_.back().empty());
58 ERR_NW <<
"found unexpected attribute:" <<back.
debug();
59 this->
data_.pop_back();
62 assert(!
data_.back().empty());
68 assert(!
data_.empty());
69 if (
data_.size() > 1)
return false;
70 return this->
next_ ==
data_.back().ordered_end();
105 if(
next_->key ==
"turn")
111 config& childchild_old = itor->cfg;
113 childchild.
swap(childchild_old);
125 child.
swap(child_old);
132 : network_reader_(std::move(source))
135 , next_(data_.front().ordered_end())
136 , next_command_num_(0)
148 LOG_NW <<
"Destroying playturn_network_adapter with an non empty buffer, this means loss of network data";
175 return std::bind(
read_config, std::ref(cfg), std::placeholders::_1);
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
void remove_attribute(config_key_type key)
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)
void set_source(source_type source)
unsigned int next_command_num_
static source_type get_source_from_config(config &src)
Standard logging facilities (interface).
std::string get_unknown_exception_type()
Utility function for finding the type of thing caught with catch(...).
static bool read_config(config &src, config &dst)
static lg::log_domain log_network("network")
rect dst
Location on the final composed sheet.
rect src
Non-transparent portion of the surface to compose.
bool empty() const
False if both w and h are > 0, true otherwise.