Disallow copy constructors/assignments.

For classes containing pointers/state that should not be copied.
This commit is contained in:
Jared Boone 2016-11-26 16:52:57 -08:00
parent 4eb0facacb
commit 46b3d9d087
8 changed files with 39 additions and 0 deletions

View File

@ -44,6 +44,11 @@ public:
); );
~CaptureThread(); ~CaptureThread();
CaptureThread(const CaptureThread&) = delete;
CaptureThread(CaptureThread&&) = delete;
CaptureThread& operator=(const CaptureThread&) = delete;
CaptureThread& operator=(CaptureThread&&) = delete;
const CaptureConfig& state() const { const CaptureConfig& state() const {
return config; return config;
} }

View File

@ -49,6 +49,11 @@ public:
ui::Context& context ui::Context& context
); );
EventDispatcher(const EventDispatcher&) = delete;
EventDispatcher(EventDispatcher&&) = delete;
EventDispatcher& operator=(const EventDispatcher&) = delete;
EventDispatcher& operator=(EventDispatcher&&) = delete;
void run(); void run();
static void request_stop(); static void request_stop();

View File

@ -92,6 +92,8 @@ public:
NavigationView(const NavigationView&) = delete; NavigationView(const NavigationView&) = delete;
NavigationView(NavigationView&&) = delete; NavigationView(NavigationView&&) = delete;
NavigationView& operator=(const NavigationView&) = delete;
NavigationView& operator=(NavigationView&&) = delete;
bool is_top() const; bool is_top() const;

View File

@ -76,6 +76,11 @@ class WaterfallWidget : public View {
public: public:
WaterfallWidget(); WaterfallWidget();
WaterfallWidget(const WaterfallWidget&) = delete;
WaterfallWidget(WaterfallWidget&&) = delete;
WaterfallWidget& operator=(const WaterfallWidget&) = delete;
WaterfallWidget& operator=(WaterfallWidget&&) = delete;
void on_show() override; void on_show() override;
void on_hide() override; void on_hide() override;

View File

@ -37,6 +37,11 @@ public:
const baseband::Direction direction = baseband::Direction::Receive const baseband::Direction direction = baseband::Direction::Receive
); );
~BasebandThread(); ~BasebandThread();
BasebandThread(const BasebandThread&) = delete;
BasebandThread(BasebandThread&&) = delete;
BasebandThread& operator=(const BasebandThread&) = delete;
BasebandThread& operator=(BasebandThread&&) = delete;
// This getter should die, it's just here to leak information to code that // This getter should die, it's just here to leak information to code that
// isn't in the right place to begin with. // isn't in the right place to begin with.

View File

@ -34,6 +34,11 @@ class StreamInput {
public: public:
StreamInput(CaptureConfig* const config); StreamInput(CaptureConfig* const config);
StreamInput(const StreamInput&) = delete;
StreamInput(StreamInput&&) = delete;
StreamInput& operator=(const StreamInput&) = delete;
StreamInput& operator=(StreamInput&&) = delete;
size_t write(const void* const data, const size_t length); size_t write(const void* const data, const size_t length);
private: private:

View File

@ -32,6 +32,11 @@ public:
BufferExchange(CaptureConfig* const config); BufferExchange(CaptureConfig* const config);
~BufferExchange(); ~BufferExchange();
BufferExchange(const BufferExchange&) = delete;
BufferExchange(BufferExchange&&) = delete;
BufferExchange& operator=(const BufferExchange&) = delete;
BufferExchange& operator=(BufferExchange&&) = delete;
#if defined(LPC43XX_M0) #if defined(LPC43XX_M0)
bool empty() const { bool empty() const {
return fifo_buffers_for_application->is_empty(); return fifo_buffers_for_application->is_empty();

View File

@ -64,6 +64,8 @@ public:
Widget(const Widget&) = delete; Widget(const Widget&) = delete;
Widget(Widget&&) = delete; Widget(Widget&&) = delete;
Widget& operator=(const Widget&) = delete;
Widget& operator=(Widget&&) = delete;
virtual ~Widget() = default; virtual ~Widget() = default;
@ -229,6 +231,11 @@ public:
const Color background const Color background
); );
Image(const Image&) = delete;
Image(Image&&) = delete;
Image& operator=(const Image&) = delete;
Image& operator=(Image&&) = delete;
void set_bitmap(const Bitmap* bitmap); void set_bitmap(const Bitmap* bitmap);
void set_foreground(const Color color); void set_foreground(const Color color);
void set_background(const Color color); void set_background(const Color color);