Delete copy and move constructors instead of inheriting from boost::noncopyable

This commit is contained in:
Charles Dang 2016-11-30 09:20:02 +11:00
parent ab66dcd06d
commit f11fa0652a
28 changed files with 263 additions and 217 deletions

View file

@ -188,10 +188,13 @@ bool get_village(const map_location& loc, int side, bool *action_timebonus, bool
namespace { // Private helpers for move_unit()
/// Helper class for move_unit().
class unit_mover : public boost::noncopyable {
class unit_mover {
typedef std::vector<map_location>::const_iterator route_iterator;
public:
unit_mover(const unit_mover&) = delete;
unit_mover& operator=(const unit_mover&) = delete;
unit_mover(const std::vector<map_location> & route,
move_unit_spectator *move_spectator,
bool skip_sightings, bool skip_ally_sightings);

View file

@ -25,7 +25,6 @@
#include "units/ptr.hpp"
#include "undo_action.hpp"
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
@ -34,14 +33,18 @@ namespace actions {
/// Class to store the actions that a player can undo and redo.
class undo_list : boost::noncopyable {
class undo_list {
typedef boost::ptr_vector<undo_action_base> action_list;
typedef boost::ptr_vector<undo_action> redos_list;
public:
undo_list(const undo_list&) = delete;
undo_list& operator=(const undo_list&) = delete;
explicit undo_list(const config & cfg);
~undo_list();
/// Creates an undo_action based on a config.
/// Throws bad_lexical_cast or config::error if it cannot parse the config properly.
static undo_action_base * create_action(const config & cfg);

View file

@ -7,8 +7,6 @@
#include "game_events/pump.hpp" // for queued_event
#include "config.hpp"
#include <boost/noncopyable.hpp>
namespace actions {
class undo_list;
@ -24,8 +22,11 @@ namespace actions {
/// Records information to be able to undo an action.
/// Each type of action gets its own derived type.
/// Base class for all entries in the undo stack, also contains non undoable actions like update_shroud or auto_shroud.
struct undo_action_base : boost::noncopyable
struct undo_action_base
{
undo_action_base(const undo_action_base&) = delete;
undo_action_base& operator=(const undo_action_base&) = delete;
/// Default constructor.
/// This is the only way to get nullptr view_info.
undo_action_base()

View file

@ -1,158 +1,159 @@
/*
Copyright (C) 2003 - 2016 by David White <dave@whitevine.net>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
/**
* @file
* Various functions implementing vision (through fog of war and shroud).
*/
#ifndef ACTIONS_VISION_H_INCLUDED
#define ACTIONS_VISION_H_INCLUDED
#include "movetype.hpp"
struct map_location;
class team;
class unit;
#include <boost/noncopyable.hpp>
#include <cstring>
#include <map>
#include <set>
#include <vector>
namespace actions {
class move_unit_spectator;
/// Class that stores the part of a unit's data that is needed for fog clearing.
/// (Used by the undo stack as that cannot rely on a unit sticking around, and
/// we do not really need to copy the entire unit.)
struct clearer_info {
size_t underlying_id;
int sight_range;
bool slowed;
movetype::terrain_costs costs;
clearer_info(const unit & viewer);
clearer_info(const config & cfg);
void write(config & cfg) const;
};
/// Class to encapsulate fog/shroud clearing and the resultant sighted events.
/// Note: This class uses teams as parameters (instead of sides) since a
/// function using this should first check to see if fog/shroud is in use (to
/// save processing when it is not), which implies the team is readily available.
class shroud_clearer : public boost::noncopyable {
public:
shroud_clearer();
~shroud_clearer();
/// Function to be called if units have moved or otherwise changed.
/// It can also be called if it is desirable to calculate the cache
/// in advance of fog clearing.
/// @param[in] new_team The team whose vision will be used. If left as
/// nullptr, the cache will be just be cleared (to be
/// recalculated later as needed).
void cache_units(const team * new_team=nullptr) { calculate_jamming(new_team); }
// cache_units() is currently a near-synonym for calculate_jamming(). The
// reason for the two names is so the private function says what it does,
// while the public one says why it might be invoked.
/// Clears shroud (and fog) around the provided location for @a view_team
/// based on @a sight_range, @a costs, and @a slowed.
bool clear_unit(const map_location &view_loc, team &view_team,
size_t viewer_id, int sight_range, bool slowed,
const movetype::terrain_costs & costs,
const map_location & real_loc,
const std::set<map_location>* known_units = nullptr,
size_t * enemy_count = nullptr, size_t * friend_count = nullptr,
move_unit_spectator * spectator = nullptr, bool instant = true);
/// Clears shroud (and fog) around the provided location for @a view_team
/// as if @a viewer was standing there.
bool clear_unit(const map_location &view_loc,
const unit &viewer, team &view_team,
const std::set<map_location>* known_units = nullptr,
size_t * enemy_count = nullptr, size_t * friend_count = nullptr,
move_unit_spectator * spectator = nullptr, bool instant = true);
/// Clears shroud (and fog) around the provided location for @a view_team
/// as if @a viewer was standing there. Setting @a instant to false
/// allows some drawing delays that are used to make movement look better.
bool clear_unit(const map_location &view_loc, const unit &viewer,
team &view_team, bool instant)
{ return clear_unit(view_loc, viewer, view_team, nullptr, nullptr, nullptr, nullptr, instant); }
/// Clears shroud (and fog) around the provided location for @a view_team
/// as if @a viewer was standing there.
bool clear_unit(const map_location &view_loc, team &view_team,
const clearer_info &viewer, bool instant);
/// Clears shroud (and fog) around the provided location as if @a viewer
/// was standing there.
bool clear_unit(const map_location &view_loc, const unit &viewer,
bool can_delay = false, bool invalidate = true,
bool instant = true);
/// Clears shroud (and fog) at the provided location and its immediate neighbors.
bool clear_dest(const map_location &dest, const unit &viewer);
/// Erases the record of sighted events from earlier fog/shroud clearing.
void drop_events();
/// Fires the sighted events that were earlier recorded by fog/shroud clearing.
bool fire_events();
/// The invalidations that should occur after invoking clear_unit().
void invalidate_after_clear();
private:
/// A record of a sighting event.
struct sight_data;
/// Causes this object's "jamming" map to be recalculated.
void calculate_jamming(const team * new_team);
/// Clears shroud from a single location.
bool clear_loc(team &tm, const map_location &loc, const map_location &view_loc,
const map_location &event_non_loc, size_t viewer_id,
bool check_units, size_t &enemy_count, size_t &friend_count,
move_unit_spectator * spectator = nullptr);
/// Convenience wrapper for adding sighting data to the sightings_ vector.
inline void record_sighting(const unit & seen, const map_location & seen_loc,
size_t sighter_id, const map_location & sighter_loc);
private: // data
std::map<map_location, int> jamming_;
std::vector<sight_data> sightings_;
/// Keeps track of the team associated with jamming_.
const team * view_team_;
};
/// Returns the sides that cannot currently see @a target.
std::vector<int> get_sides_not_seeing(const unit & target);
/// Fires sighted events for the sides that can see @a target.
bool actor_sighted(const unit & target, const std::vector<int> * cache = nullptr);
/// Function that recalculates the fog of war.
void recalculate_fog(int side);
/// Function that will clear shroud (and fog) based on current unit positions.
bool clear_shroud(int side, bool reset_fog = false, bool fire_events = true);
}//namespace actions
#endif
/*
Copyright (C) 2003 - 2016 by David White <dave@whitevine.net>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
/**
* @file
* Various functions implementing vision (through fog of war and shroud).
*/
#ifndef ACTIONS_VISION_H_INCLUDED
#define ACTIONS_VISION_H_INCLUDED
#include "movetype.hpp"
struct map_location;
class team;
class unit;
#include <cstring>
#include <map>
#include <set>
#include <vector>
namespace actions {
class move_unit_spectator;
/// Class that stores the part of a unit's data that is needed for fog clearing.
/// (Used by the undo stack as that cannot rely on a unit sticking around, and
/// we do not really need to copy the entire unit.)
struct clearer_info {
size_t underlying_id;
int sight_range;
bool slowed;
movetype::terrain_costs costs;
clearer_info(const unit & viewer);
clearer_info(const config & cfg);
void write(config & cfg) const;
};
/// Class to encapsulate fog/shroud clearing and the resultant sighted events.
/// Note: This class uses teams as parameters (instead of sides) since a
/// function using this should first check to see if fog/shroud is in use (to
/// save processing when it is not), which implies the team is readily available.
class shroud_clearer {
public:
shroud_clearer(const shroud_clearer&) = delete;
shroud_clearer& operator=(const shroud_clearer&) = delete;
shroud_clearer();
~shroud_clearer();
/// Function to be called if units have moved or otherwise changed.
/// It can also be called if it is desirable to calculate the cache
/// in advance of fog clearing.
/// @param[in] new_team The team whose vision will be used. If left as
/// nullptr, the cache will be just be cleared (to be
/// recalculated later as needed).
void cache_units(const team * new_team=nullptr) { calculate_jamming(new_team); }
// cache_units() is currently a near-synonym for calculate_jamming(). The
// reason for the two names is so the private function says what it does,
// while the public one says why it might be invoked.
/// Clears shroud (and fog) around the provided location for @a view_team
/// based on @a sight_range, @a costs, and @a slowed.
bool clear_unit(const map_location &view_loc, team &view_team,
size_t viewer_id, int sight_range, bool slowed,
const movetype::terrain_costs & costs,
const map_location & real_loc,
const std::set<map_location>* known_units = nullptr,
size_t * enemy_count = nullptr, size_t * friend_count = nullptr,
move_unit_spectator * spectator = nullptr, bool instant = true);
/// Clears shroud (and fog) around the provided location for @a view_team
/// as if @a viewer was standing there.
bool clear_unit(const map_location &view_loc,
const unit &viewer, team &view_team,
const std::set<map_location>* known_units = nullptr,
size_t * enemy_count = nullptr, size_t * friend_count = nullptr,
move_unit_spectator * spectator = nullptr, bool instant = true);
/// Clears shroud (and fog) around the provided location for @a view_team
/// as if @a viewer was standing there. Setting @a instant to false
/// allows some drawing delays that are used to make movement look better.
bool clear_unit(const map_location &view_loc, const unit &viewer,
team &view_team, bool instant)
{ return clear_unit(view_loc, viewer, view_team, nullptr, nullptr, nullptr, nullptr, instant); }
/// Clears shroud (and fog) around the provided location for @a view_team
/// as if @a viewer was standing there.
bool clear_unit(const map_location &view_loc, team &view_team,
const clearer_info &viewer, bool instant);
/// Clears shroud (and fog) around the provided location as if @a viewer
/// was standing there.
bool clear_unit(const map_location &view_loc, const unit &viewer,
bool can_delay = false, bool invalidate = true,
bool instant = true);
/// Clears shroud (and fog) at the provided location and its immediate neighbors.
bool clear_dest(const map_location &dest, const unit &viewer);
/// Erases the record of sighted events from earlier fog/shroud clearing.
void drop_events();
/// Fires the sighted events that were earlier recorded by fog/shroud clearing.
bool fire_events();
/// The invalidations that should occur after invoking clear_unit().
void invalidate_after_clear();
private:
/// A record of a sighting event.
struct sight_data;
/// Causes this object's "jamming" map to be recalculated.
void calculate_jamming(const team * new_team);
/// Clears shroud from a single location.
bool clear_loc(team &tm, const map_location &loc, const map_location &view_loc,
const map_location &event_non_loc, size_t viewer_id,
bool check_units, size_t &enemy_count, size_t &friend_count,
move_unit_spectator * spectator = nullptr);
/// Convenience wrapper for adding sighting data to the sightings_ vector.
inline void record_sighting(const unit & seen, const map_location & seen_loc,
size_t sighter_id, const map_location & sighter_loc);
private: // data
std::map<map_location, int> jamming_;
std::vector<sight_data> sightings_;
/// Keeps track of the team associated with jamming_.
const team * view_team_;
};
/// Returns the sides that cannot currently see @a target.
std::vector<int> get_sides_not_seeing(const unit & target);
/// Fires sighted events for the sides that can see @a target.
bool actor_sighted(const unit & target, const std::vector<int> * cache = nullptr);
/// Function that recalculates the fog of war.
void recalculate_fog(int side);
/// Function that will clear shroud (and fog) based on current unit positions.
bool clear_shroud(int side, bool reset_fog = false, bool fire_events = true);
}//namespace actions
#endif

View file

@ -17,7 +17,6 @@
#define ADDON_CLIENT_HPP_INCLUDED
#include "gui/dialogs/network_transmission.hpp"
#include <boost/noncopyable.hpp>
#include "network_asio.hpp"
struct addon_info;
@ -29,13 +28,16 @@ struct addon_info;
* add-ons server interaction for the client-side. Most networking
* operations with it are implemented here.
*/
class addons_client : private boost::noncopyable
class addons_client
{
public:
struct invalid_server_address {};
struct not_connected_to_server {};
struct user_exit {};
addons_client(const addons_client&) = delete;
addons_client& operator=(const addons_client&) = delete;
/**
* Constructor.
*

View file

@ -31,7 +31,6 @@
#include "generic_event.hpp" // for observer
#include "pathfind/teleport.hpp" // for teleport_map
#include "units/map.hpp"
#include <boost/noncopyable.hpp> // for noncopyable
#include <set> // for multiset
#include <string> // for string
#include <utility> // for pair
@ -74,10 +73,14 @@ struct plain_route;
namespace ai {
class formula_ai : public readonly_context_proxy, public game_logic::formula_callable, public boost::noncopyable {
class formula_ai : public readonly_context_proxy, public game_logic::formula_callable {
public:
formula_ai(const formula_ai&) = delete;
formula_ai& operator=(const formula_ai&) = delete;
explicit formula_ai(readonly_context &context, const config &cfg);
virtual ~formula_ai() {}
virtual config to_config() const;
std::string evaluate(const std::string& formula_str);

View file

@ -27,10 +27,13 @@ typedef std::vector<map_location> arrow_path_t;
/**
* Arrows destined to be drawn on the map. Created for the whiteboard system.
*/
class arrow : private boost::noncopyable {
class arrow {
public:
arrow(const arrow&) = delete;
arrow& operator=(const arrow&) = delete;
arrow(bool hidden = false);
virtual ~arrow();

View file

@ -17,8 +17,6 @@
#include "config.hpp"
#include <boost/noncopyable.hpp>
namespace campaignd
{
@ -41,11 +39,14 @@ namespace campaignd
* author = (add-on author patterns)
* description = (add-on description patterns)
*/
class blacklist : private boost::noncopyable
class blacklist
{
public:
typedef std::vector<std::string> globlist;
blacklist(const blacklist&) = delete;
blacklist& operator=(const blacklist&) = delete;
blacklist();
explicit blacklist(const config& cfg);

View file

@ -38,9 +38,12 @@ namespace game_config
* This is preferred form to set defines that aren't global
**/
template<typename T>
class scoped_preproc_define_internal : private boost::noncopyable
class scoped_preproc_define_internal
{
public:
scoped_preproc_define_internal(const scoped_preproc_define_internal&) = delete;
scoped_preproc_define_internal& operator=(const scoped_preproc_define_internal&) = delete;
/**
* Adds normal preproc define.
*
@ -87,7 +90,7 @@ typedef scoped_preproc_define_internal<config_cache> scoped_preproc_define;
* @todo Make cache system easily allow validation of in memory cache objects
* using hash checksum of preproc_map.
**/
class config_cache : private boost::noncopyable
class config_cache
{
public:
/**
@ -95,6 +98,9 @@ public:
*/
static config_cache& instance();
config_cache(const config_cache&) = delete;
config_cache& operator=(const config_cache&) = delete;
const preproc_map& get_preproc_map() const;
/**

View file

@ -68,10 +68,12 @@ enum menu_type {
class editor_controller : public controller_base,
public hotkey::command_executor_default,
public events::mouse_handler_base,
private boost::noncopyable,
quit_confirmation
{
public:
editor_controller(const editor_controller&) = delete;
editor_controller& operator=(const editor_controller&) = delete;
/**
* The constructor. A initial map context can be specified here, the controller
* will assume ownership and delete the pointer during destruction, but changes

View file

@ -26,8 +26,6 @@
#include "overlay.hpp"
#include "display_context.hpp"
#include <boost/noncopyable.hpp>
namespace editor {
struct editor_team_info {
@ -55,9 +53,12 @@ struct editor_team_info {
* as e.g. the undo stack is part of the map, not the editor as a whole. This might allow many
* maps to be open at the same time.
*/
class map_context : public display_context, private boost::noncopyable
class map_context : public display_context
{
public:
map_context(const map_context&) = delete;
map_context& operator=(const map_context&) = delete;
/**
* Create a map context from an existing map. The filename is set to be
* empty, indicating a new map.

View file

@ -18,7 +18,6 @@
#include "game_events/handlers.hpp"
#include "game_events/wmi_container.hpp"
#include <boost/noncopyable.hpp>
#include <set>
#include <string>
@ -42,7 +41,7 @@ namespace game_events {
/// and destroyed at the end of the scenario.
/// If a second manager object is created before destroying the previous
/// one, the game will crash with an assertion failure.
class manager : boost::noncopyable {
class manager {
public:
/// This class is similar to an input iterator through event handlers,
/// except each instance knows its own end (determined when constructed).
@ -101,6 +100,9 @@ namespace game_events {
game_events::wmi_container wml_menu_items_;
public:
manager(const manager&) = delete;
manager& operator=(const manager&) = delete;
explicit manager();
void read_scenario(const config& scenario_cfg);
~manager();

View file

@ -36,9 +36,12 @@ namespace iteration
* See @ref gui2_iterator_iterator for more information.
*/
template <class order>
class iterator : private order, private boost::noncopyable
class iterator : private order
{
public:
iterator(const iterator&) = delete;
iterator& operator=(const iterator&) = delete;
/**
* Constructor.
*

View file

@ -20,8 +20,6 @@
#include "gui/widgets/event_executor.hpp"
#include "sdl/color.hpp"
#include <boost/noncopyable.hpp>
#include <string>
class surface;
@ -47,9 +45,7 @@ class walker_base;
* info needed for a real widget and some pure abstract functions which need to
* be implemented by classes deriving from this class.
*/
class widget : private boost::noncopyable,
public event_executor,
public event::dispatcher
class widget : public event_executor, public event::dispatcher
{
friend class debug_layout_graph;
friend class window; // needed for modifying the layout_size.
@ -134,6 +130,9 @@ public:
/***** ***** ***** Constructor and destructor. ***** ***** *****/
public:
widget(const widget&) = delete;
widget& operator=(const widget&) = delete;
/** @deprecated use the second overload. */
widget();

View file

@ -22,7 +22,6 @@ class display;
#include "map/location.hpp"
#include <memory>
#include <boost/noncopyable.hpp>
namespace halo
{
@ -77,9 +76,12 @@ private:
/**
* RAII object which manages a halo. When it goes out of scope it removes the corresponding halo entry.
*/
class halo_record : public boost::noncopyable
class halo_record
{
public:
halo_record(const halo_record&) = delete;
halo_record& operator=(const halo_record&) = delete;
halo_record();
halo_record(int id, const std::shared_ptr<halo_impl> & my_manager);
~halo_record();

View file

@ -26,7 +26,6 @@
#include <ctime>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/noncopyable.hpp>
#ifndef UNICODE
#define UNICODE
@ -191,9 +190,12 @@ void log_init_panic(const libc_error& e,
/**
* Singleton class that deals with the intricacies of log file redirection.
*/
class log_file_manager : private boost::noncopyable
class log_file_manager
{
public:
log_file_manager(const log_file_manager&) = delete;
log_file_manager& operator=(const log_file_manager&) = delete;
log_file_manager(bool native_console = false);
~log_file_manager();

View file

@ -20,7 +20,6 @@
#include "scripting/plugins/context.hpp"
#include "scripting/plugins/manager.hpp"
#include <boost/noncopyable.hpp>
#include <string>
#include <vector>
@ -35,10 +34,13 @@ public:
typedef std::vector<std::function<bool(void)> > request_list;
class thread : private boost::noncopyable {
class thread {
lua_State * T_;
bool started_;
thread(const thread&) = delete;
thread& operator=(const thread&) = delete;
thread(lua_State *);
public :
bool is_running();

View file

@ -20,8 +20,6 @@
* Contains a wrapper class for the @ref SDL_Window class.
*/
#include <boost/noncopyable.hpp>
#include <SDL_video.h>
#include <string>
@ -44,9 +42,12 @@ namespace sdl
* For functions not wrapped the class offers an implicit conversion operator
* to a pointer to the @ref SDL_Window object it owns.
*/
class window : private boost::noncopyable
class window
{
public:
window(const window&) = delete;
window& operator=(const window&) = delete;
/***** ***** ***** Constructor and destructor. ***** ***** *****/
/**

View file

@ -15,7 +15,6 @@
#ifndef TESTS_UTILS_FAKE_EVENT_SOURCE_HPP_INCLUDED
#define TESTS_UTILS_FAKE_EVENT_SOURCE_HPP_INCLUDED
#include <boost/noncopyable.hpp>
#include <queue>
#include <SDL.h>

View file

@ -20,14 +20,11 @@
#ifndef TRACER_HPP_INCLUDED
#define TRACER_HPP_INCLUDED
#include <boost/noncopyable.hpp>
#include <map>
#include <string>
/** Helper structure for gathering the tracing statistics. */
struct tracer
: private boost::noncopyable
{
/**
* Helper structure to print the tracing statistics.
@ -38,8 +35,10 @@ struct tracer
* the scope is left. (This makes it easier to write the tracing macros.)
*/
struct printer
: private boost::noncopyable
{
printer(const printer&) = delete;
printer& operator=(const printer&) = delete;
explicit printer(const tracer* const tracer__);
~printer();
@ -48,6 +47,9 @@ struct tracer
const tracer* const tracer_;
};
tracer(const tracer&) = delete;
tracer& operator=(const tracer&) = delete;
explicit tracer(const char* const function__);
/** The total number of runs. */

View file

@ -18,8 +18,6 @@
#include <ctime>
//#include <boost/noncopyable.hpp>
namespace n_unit {
struct unit_id
@ -42,7 +40,7 @@ namespace n_unit {
friend bool operator >(unit_id a, unit_id b) { return a.value > b.value; }
};
class id_manager //: private boost::noncopyable
class id_manager
{
private:
size_t next_id_;

View file

@ -23,7 +23,6 @@
#include "util.hpp"
#include "game_errors.hpp"
#include <boost/noncopyable.hpp>
#include <map>
#include <set>
#include <string>
@ -311,9 +310,11 @@ private:
};
class unit_type_data
: private boost::noncopyable
{
public:
unit_type_data(const unit_type_data&) = delete;
unit_type_data& operator=(const unit_type_data&) = delete;
unit_type_data();
typedef std::map<std::string,unit_type> unit_type_map;

View file

@ -44,8 +44,11 @@ namespace unit_display
* If control over how far the unit moves is not needed, move_unit() may
* be a more convenient interface.
*/
class unit_mover : public boost::noncopyable {
class unit_mover {
public:
unit_mover(const unit_mover&) = delete;
unit_mover& operator=(const unit_mover&) = delete;
explicit unit_mover(const std::vector<map_location>& path, bool animate=true, bool force_scroll=false);
~unit_mover();

View file

@ -554,8 +554,10 @@ private:
* scope.
*/
struct unit_movement_resetter
: private boost::noncopyable
{
unit_movement_resetter(const unit_movement_resetter&) = delete;
unit_movement_resetter& operator=(const unit_movement_resetter&) = delete;
unit_movement_resetter(const unit& u, bool operate=true);
~unit_movement_resetter();

View file

@ -19,7 +19,6 @@
#include "lua_jailbreak_exception.hpp"
#include <memory>
#include <boost/noncopyable.hpp>
#include "sdl/window.hpp"
@ -42,8 +41,11 @@ SDL_Rect screen_area();
void update_rect(size_t x, size_t y, size_t w, size_t h);
void update_rect(const SDL_Rect& rect);
class CVideo : private boost::noncopyable {
class CVideo {
public:
CVideo(const CVideo&) = delete;
CVideo& operator=(const CVideo&) = delete;
enum FAKE_TYPES {
NO_FAKE
, FAKE
@ -59,13 +61,13 @@ public:
CVideo(FAKE_TYPES type = NO_FAKE);
~CVideo();
static CVideo& get_singleton() { return *singleton_; }
bool non_interactive();
const static int DefaultBpp = 32;
/**
* Initializes a new window, taking into account any preiously saved states.
*/
@ -73,7 +75,6 @@ public:
void setMode( int x, int y, const MODE_EVENT mode );
void set_fullscreen(bool ison);
/**

View file

@ -20,16 +20,15 @@
#ifndef WESMAGE_OPTIONS_HPP_INCLUDED
#define WESMAGE_OPTIONS_HPP_INCLUDED
#include <boost/noncopyable.hpp>
#include <string>
#include <vector>
/** A singleton class containing the parsed command line parameters. */
struct cmdline_options
: private boost::noncopyable
{
private:
cmdline_options(const cmdline_options&) = delete;
cmdline_options& operator=(const cmdline_options&) = delete;
cmdline_options();

View file

@ -37,11 +37,14 @@
class config;
/** A class that represents a TCP/IP connection to the wesnothd server. */
class wesnothd_connection : boost::noncopyable
class wesnothd_connection
{
public:
using error = wesnothd_connection_error;
wesnothd_connection(const wesnothd_connection&) = delete;
wesnothd_connection& operator=(const wesnothd_connection&) = delete;
/**
* Constructor.
*

View file

@ -23,7 +23,6 @@
#include "units/map.hpp"
#include <boost/noncopyable.hpp>
#include <boost/dynamic_bitset.hpp>
class CKey;
@ -41,13 +40,15 @@ class highlighter;
/**
* This class is the frontend of the whiteboard framework for the rest of the Wesnoth code.
*/
class manager : private boost::noncopyable
class manager
{
friend struct future_map;
friend struct future_map_if_active;
friend struct real_map;
public:
manager(const manager&) = delete;
manager& operator=(const manager&) = delete;
manager();
~manager();