From 768d9762c9d861221a90cd1220d72f57588e0db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 18 Feb 2014 10:10:18 +0000 Subject: [PATCH] Add private copy constructor to avoid accidental copying git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18210 383ad7c9-94d9-4d36-a494-682f7c89f535 --- scene/elementInOut.cc | 13 +++++++++++++ scene/elementInOut.hh | 10 +++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/scene/elementInOut.cc b/scene/elementInOut.cc index 3dd1a79..9a08923 100644 --- a/scene/elementInOut.cc +++ b/scene/elementInOut.cc @@ -52,6 +52,8 @@ #include "../parser/element.hh" #include "../parser/context.hh" +#include + //== NAMESPACES =============================================================== namespace VSI { @@ -88,6 +90,17 @@ ElementInOut::ElementInOut (InOut *_io, SceneElement *_parent): descText_->setHorizontalStretch (true); } + +ElementInOut::ElementInOut(const ElementInOut& _orig) : + io_(NULL), + element_(NULL), + conn_(NULL), + typeText_(NULL), + descText_(NULL) +{ + std::cerr << "Illegal use of copy constructor in class ElementInOut, which is not implemented yet!" << std::endl; +}; + //------------------------------------------------------------------------------ /// Destructor diff --git a/scene/elementInOut.hh b/scene/elementInOut.hh index 9386e1e..253f331 100644 --- a/scene/elementInOut.hh +++ b/scene/elementInOut.hh @@ -106,12 +106,16 @@ class ElementInOut { bool validConnection (ElementInOut *_e); /// InOut context object - InOut *inOut () const { return io_; }; + InOut* inOut () const { return io_; }; /// Scene element - SceneElement *element () { return element_; }; + SceneElement* element() { return element_; }; private: + + /// Private copy constructor to avoid accidental copy + ElementInOut( const ElementInOut& _orig ); + InOut *io_; SceneElement *element_; @@ -126,4 +130,4 @@ class ElementInOut { } //============================================================================= -#endif \ No newline at end of file +#endif -- GitLab