+ optional<int> get_layer_id(int surface_id);
+ optional<int> get_layer_id(std::string const &role);
+ optional<struct LayoutState*> get_layout_state(int surface_id) {
+ int layer_id = *this->get_layer_id(surface_id);
+ auto i = this->mapping.find(layer_id);
+ return i == this->mapping.end()
+ ? nullopt
+ : optional<struct LayoutState *>(&i->second.state);
+ }
+ optional<struct layer> get_layer(int layer_id) {
+ auto i = this->mapping.find(layer_id);
+ return i == this->mapping.end() ? nullopt
+ : optional<struct layer>(i->second);
+ }
+
+ layers_type::size_type get_layers_count() const {
+ return this->layers.size();
+ }
+
+ void add_surface(int surface_id, int layer_id) {
+ this->surfaces[surface_id] = layer_id;
+ }
+
+ void remove_surface(int surface_id) {
+ this->surfaces.erase(surface_id);
+ }