24 #define DBG_NW LOG_STREAM(debug, log_network)
25 #define LOG_NW LOG_STREAM(info, log_network)
26 #define ERR_NW LOG_STREAM(err, log_network)
30 assert(!
data_.empty());
32 this->
data_.emplace_back();
34 bool has_data =
false;
43 this->
data_.pop_back();
48 if((!has_data) || back.
empty())
50 this->
data_.pop_back();
53 assert(!
data_.back().empty());
57 ERR_NW <<
"found unexpected attribute:" <<back.
debug();
58 this->
data_.pop_back();
61 assert(!
data_.back().empty());
67 assert(!
data_.empty());
68 if (
data_.size() > 1)
return false;
69 return this->
next_ ==
data_.back().ordered_end();
104 if(
next_->key ==
"turn")
110 config& childchild_old = itor->cfg;
112 childchild.
swap(childchild_old);
124 child.
swap(child_old);
131 : network_reader_(source)
134 , next_(data_.front().ordered_end())
135 , next_command_num_(0)
147 LOG_NW <<
"Destroying playturn_network_adapter with an non empty buffer, this means loss of network data";
174 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.