Skip to content

Commit

Permalink
remove const from arg declaration in move-constructors/move-assignments
Browse files Browse the repository at this point in the history
Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Nov 14, 2019
1 parent b7857b9 commit 9a5c8d4
Show file tree
Hide file tree
Showing 50 changed files with 159 additions and 133 deletions.
28 changes: 22 additions & 6 deletions IlmBase/Iex/IexBaseExc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,34 @@ BaseExc::BaseExc (std::stringstream &s) throw () :
// empty
}

BaseExc::BaseExc (const BaseExc &be) throw()
: _message (be._message),
_stackTrace (be._stackTrace)
{
}

BaseExc::BaseExc (const BaseExc &be) throw () :
_message (be._message),
_stackTrace (be._stackTrace)
BaseExc::~BaseExc () throw ()
{
// empty
}

BaseExc &
BaseExc::operator = (const BaseExc& be) throw ()
{
if (this != &be)
{
_message = be._message;
_stackTrace = be._stackTrace;
}
}

BaseExc::~BaseExc () throw ()
BaseExc &
BaseExc::operator = (BaseExc&& be) throw ()
{
// empty
if (this != &be)
{
_message = std::move (be._message);
_stackTrace = std::move (be._stackTrace);
}
}

const char *
Expand Down
20 changes: 15 additions & 5 deletions IlmBase/Iex/IexBaseExc.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ class BaseExc: public std::exception
// Constructors and destructor
//----------------------------

IEX_EXPORT BaseExc (const char *s = 0) throw(); // std::string (s)
IEX_EXPORT BaseExc (const std::string &s) throw(); // std::string (s)
IEX_EXPORT BaseExc (std::stringstream &s) throw(); // std::string (s.str())
IEX_EXPORT BaseExc (const char *s = nullptr) throw(); // std::string (s)
IEX_EXPORT BaseExc (const std::string &s) throw(); // std::string (s)
IEX_EXPORT BaseExc (std::stringstream &s) throw(); // std::string (s.str())

IEX_EXPORT BaseExc (const BaseExc &be) throw();
IEX_EXPORT BaseExc (BaseExc &&be) throw();
IEX_EXPORT virtual ~BaseExc () throw ();

IEX_EXPORT BaseExc & operator = (const BaseExc& be) throw () = delete;
IEX_EXPORT BaseExc & operator = (const BaseExc&& be) throw () = delete;
IEX_EXPORT BaseExc & operator = (const BaseExc& be) throw ();
IEX_EXPORT BaseExc & operator = (BaseExc&& be) throw ();

//---------------------------------------------------
// what() method -- e.what() returns _message.c_str()
Expand Down Expand Up @@ -139,13 +140,22 @@ class BaseExc: public std::exception
exp name (const char* text) throw(); \
exp name (const std::string &text) throw(); \
exp name (std::stringstream &text) throw(); \
exp name (const name &other) throw(); \
exp name (name &&other) throw(); \
exp name& operator = (name &other) throw(); \
exp name& operator = (name &&other) throw(); \
exp ~name() throw(); \
};

#define DEFINE_EXC_EXP_IMPL(exp, name, base) \
exp name::name () throw () : base () {} \
exp name::name (const char* text) throw () : base (text) {} \
exp name::name (const std::string& text) throw () : base (text) {} \
exp name::name (std::stringstream& text) throw () : base (text) {} \
exp name::name (const name &other) throw() : base (other) {} \
exp name::name (name &&other) throw() : base (other) {} \
exp name& name::operator = (name &other) throw() { base::operator=(other); return *this; } \
exp name& name::operator = (name &&other) throw() { base::operator=(other); return *this; } \
exp name::~name () throw () {}

// For backward compatibility.
Expand Down
4 changes: 2 additions & 2 deletions IlmBase/IlmThread/IlmThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ class Thread
std::thread _thread;

Thread &operator= (const Thread& t) = delete;
Thread &operator= (const Thread&& t) = delete;
Thread &operator= (Thread&& t) = delete;
Thread (const Thread& t) = delete;
Thread (const Thread&& t) = delete;
Thread (Thread&& t) = delete;
#endif
};

Expand Down
4 changes: 2 additions & 2 deletions IlmBase/IlmThread/IlmThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ struct ThreadPool::Data
~Data();
Data (const Data&) = delete;
Data &operator= (const Data&) = delete;
Data (const Data&&) = delete;
Data &operator= (const Data&&) = delete;
Data (Data&&) = delete;
Data &operator= (Data&&) = delete;

struct SafeProvider
{
Expand Down
4 changes: 2 additions & 2 deletions IlmBase/IlmThread/IlmThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ class ILMTHREAD_EXPORT TaskGroup

TaskGroup (const TaskGroup& other) = delete;
TaskGroup& operator = (const TaskGroup& other) = delete;
TaskGroup (const TaskGroup&& other) = delete;
TaskGroup& operator = (const TaskGroup&& other) = delete;
TaskGroup (TaskGroup&& other) = delete;
TaskGroup& operator = (TaskGroup&& other) = delete;

// marks one task as finished
// should be used by the thread pool provider to notify
Expand Down
8 changes: 4 additions & 4 deletions OpenEXR/IlmImf/ImfAcesFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class AcesOutputFile::Data

Data (const Data& other) = delete;
Data& operator = (const Data& other) = delete;
Data (const Data&& other) = delete;
Data& operator = (const Data&& other) = delete;
Data (Data&& other) = delete;
Data& operator = (Data&& other) = delete;

RgbaOutputFile * rgbaFile;
};
Expand Down Expand Up @@ -345,8 +345,8 @@ class AcesInputFile::Data

Data (const Data& other) = delete;
Data& operator = (const Data& other) = delete;
Data (const Data&& other) = delete;
Data& operator = (const Data&& other) = delete;
Data (Data&& other) = delete;
Data& operator = (Data&& other) = delete;

void initColorConversion ();

Expand Down
8 changes: 4 additions & 4 deletions OpenEXR/IlmImf/ImfAcesFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ class AcesOutputFile

AcesOutputFile (const AcesOutputFile &) = delete;
AcesOutputFile & operator = (const AcesOutputFile &) = delete;
AcesOutputFile (const AcesOutputFile &&) = delete;
AcesOutputFile & operator = (const AcesOutputFile &&) = delete;
AcesOutputFile (AcesOutputFile &&) = delete;
AcesOutputFile & operator = (AcesOutputFile &&) = delete;

class Data;

Expand Down Expand Up @@ -347,8 +347,8 @@ class AcesInputFile

AcesInputFile (const AcesInputFile &) = delete;
AcesInputFile & operator = (const AcesInputFile &) = delete;
AcesInputFile (const AcesInputFile &&) = delete;
AcesInputFile & operator = (const AcesInputFile &&) = delete;
AcesInputFile (AcesInputFile &&) = delete;
AcesInputFile & operator = (AcesInputFile &&) = delete;

class Data;

Expand Down
8 changes: 4 additions & 4 deletions OpenEXR/IlmImf/ImfArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ class Array

Array (const Array &) = delete;
Array & operator = (const Array &) = delete;
Array (const Array &&) = delete;
Array & operator = (const Array &&) = delete;
Array (Array &&) = delete;
Array & operator = (Array &&) = delete;

long _size;
T * _data;
Expand Down Expand Up @@ -180,8 +180,8 @@ class Array2D

Array2D (const Array2D &) = delete;
Array2D & operator = (const Array2D &) = delete;
Array2D (const Array2D &&) = delete;
Array2D & operator = (const Array2D &&) = delete;
Array2D (Array2D &&) = delete;
Array2D & operator = (Array2D &&) = delete;

long _sizeX;
long _sizeY;
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfAutoArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER

AutoArray (const AutoArray& other) = delete;
AutoArray& operator = (const AutoArray& other) = delete;
AutoArray (const AutoArray&& other) = delete;
AutoArray& operator = (const AutoArray&& other) = delete;
AutoArray (AutoArray&& other) = delete;
AutoArray& operator = (AutoArray&& other) = delete;

operator T * () {return _data;}
operator const T * () const {return _data;}
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfB44Compressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class B44Compressor: public Compressor

B44Compressor (const B44Compressor& other) = delete;
B44Compressor& operator = (const B44Compressor& other) = delete;
B44Compressor (const B44Compressor&& other) = delete;
B44Compressor& operator = (const B44Compressor&& other) = delete;
B44Compressor (B44Compressor&& other) = delete;
B44Compressor& operator = (B44Compressor&& other) = delete;

IMF_EXPORT
virtual int numScanLines () const;
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfCompositeDeepScanLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ class CompositeDeepScanLine

CompositeDeepScanLine(const CompositeDeepScanLine &) = delete;
CompositeDeepScanLine & operator=(const CompositeDeepScanLine &) = delete;
CompositeDeepScanLine(const CompositeDeepScanLine &&) = delete;
CompositeDeepScanLine & operator=(const CompositeDeepScanLine &&) = delete;
CompositeDeepScanLine(CompositeDeepScanLine &&) = delete;
CompositeDeepScanLine & operator=(CompositeDeepScanLine &&) = delete;
};

OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfDeepScanLineInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ struct DeepScanLineInputFile::Data: public Mutex

Data (const Data& data) = delete;
Data& operator = (const Data& data) = delete;
Data (const Data&& data) = delete;
Data& operator = (const Data&& data) = delete;
Data (Data&& data) = delete;
Data& operator = (Data&& data) = delete;

inline LineBuffer * getLineBuffer (int number); // hash function from line
// buffer indices into our
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfDeepScanLineInputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class DeepScanLineInputFile : public GenericInputFile

DeepScanLineInputFile (const DeepScanLineInputFile& other) = delete;
DeepScanLineInputFile& operator = (const DeepScanLineInputFile& other) = delete;
DeepScanLineInputFile (const DeepScanLineInputFile&& other) = delete;
DeepScanLineInputFile& operator = (const DeepScanLineInputFile&& other) = delete;
DeepScanLineInputFile (DeepScanLineInputFile&& other) = delete;
DeepScanLineInputFile& operator = (DeepScanLineInputFile&& other) = delete;

//-----------------------------------------
// Destructor -- deallocates internal data
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfDeepScanLineOutputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ struct DeepScanLineOutputFile::Data

Data (const Data& other) = delete;
Data& operator = (const Data& other) = delete;
Data (const Data&& other) = delete;
Data& operator = (const Data&& other) = delete;
Data (Data&& other) = delete;
Data& operator = (Data&& other) = delete;

inline LineBuffer * getLineBuffer (int number);// hash function from line
// buffer indices into our
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfDeepScanLineOutputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ class DeepScanLineOutputFile : public GenericOutputFile

DeepScanLineOutputFile (const DeepScanLineOutputFile &) = delete;
DeepScanLineOutputFile & operator = (const DeepScanLineOutputFile &) = delete;
DeepScanLineOutputFile (const DeepScanLineOutputFile &&) = delete;
DeepScanLineOutputFile & operator = (const DeepScanLineOutputFile &&) = delete;
DeepScanLineOutputFile (DeepScanLineOutputFile &&) = delete;
DeepScanLineOutputFile & operator = (DeepScanLineOutputFile &&) = delete;

void initialize (const Header &header);
void initializeLineBuffer();
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ struct DeepTiledInputFile::Data: public Mutex

Data (const Data& other) = delete;
Data& operator = (const Data& other) = delete;
Data (const Data&& other) = delete;
Data& operator = (const Data&& other) = delete;
Data (Data&& other) = delete;
Data& operator = (Data&& other) = delete;

inline TileBuffer * getTileBuffer (int number);
// hash function from tile indices
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfDeepTiledInputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ class DeepTiledInputFile : public GenericInputFile

DeepTiledInputFile (const DeepTiledInputFile &) = delete;
DeepTiledInputFile & operator = (const DeepTiledInputFile &) = delete;
DeepTiledInputFile (const DeepTiledInputFile &&) = delete;
DeepTiledInputFile & operator = (const DeepTiledInputFile &&) = delete;
DeepTiledInputFile (DeepTiledInputFile &&) = delete;
DeepTiledInputFile & operator = (DeepTiledInputFile &&) = delete;

DeepTiledInputFile (const Header &header, OPENEXR_IMF_INTERNAL_NAMESPACE::IStream *is, int version,
int numThreads);
Expand Down
8 changes: 4 additions & 4 deletions OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ struct BufferedTile

BufferedTile (const BufferedTile& other) = delete;
BufferedTile& operator = (const BufferedTile& other) = delete;
BufferedTile (const BufferedTile&& other) = delete;
BufferedTile& operator = (const BufferedTile&& other) = delete;
BufferedTile (BufferedTile&& other) = delete;
BufferedTile& operator = (BufferedTile&& other) = delete;
};


Expand Down Expand Up @@ -318,8 +318,8 @@ struct DeepTiledOutputFile::Data

Data (const Data& other) = delete;
Data& operator = (const Data& other) = delete;
Data (const Data&& other) = delete;
Data& operator = (const Data&& other) = delete;
Data (Data&& other) = delete;
Data& operator = (Data&& other) = delete;

inline TileBuffer * getTileBuffer (int number);
// hash function from tile
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfDeepTiledOutputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ class DeepTiledOutputFile : public GenericOutputFile

DeepTiledOutputFile (const DeepTiledOutputFile &) = delete;
DeepTiledOutputFile & operator = (const DeepTiledOutputFile &) = delete;
DeepTiledOutputFile (const DeepTiledOutputFile &&) = delete;
DeepTiledOutputFile & operator = (const DeepTiledOutputFile &&) = delete;
DeepTiledOutputFile (DeepTiledOutputFile &&) = delete;
DeepTiledOutputFile & operator = (DeepTiledOutputFile &&) = delete;

void initialize (const Header &header);

Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfDwaCompressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class DwaCompressor: public Compressor

DwaCompressor (const DwaCompressor& other) = delete;
DwaCompressor& operator = (const DwaCompressor& other) = delete;
DwaCompressor (const DwaCompressor&& other) = delete;
DwaCompressor& operator = (const DwaCompressor&& other) = delete;
DwaCompressor (DwaCompressor&& other) = delete;
DwaCompressor& operator = (DwaCompressor&& other) = delete;

IMF_EXPORT
virtual int numScanLines () const;
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfFastHuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class FastHufDecoder

FastHufDecoder (const FastHufDecoder& other) = delete;
FastHufDecoder& operator = (const FastHufDecoder& other) = delete;
FastHufDecoder (const FastHufDecoder&& other) = delete;
FastHufDecoder& operator = (const FastHufDecoder&& other) = delete;
FastHufDecoder (FastHufDecoder&& other) = delete;
FastHufDecoder& operator = (FastHufDecoder&& other) = delete;

IMF_EXPORT
static bool enabled ();
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ struct InputFile::Data : public Mutex

Data (const Data& other) = delete;
Data& operator = (const Data& other) = delete;
Data (const Data&& other) = delete;
Data& operator = (const Data&& other) = delete;
Data (Data&& other) = delete;
Data& operator = (Data&& other) = delete;

void deleteCachedBuffer();
};
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfInputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ class InputFile : public GenericInputFile

InputFile (const InputFile &) = delete;
InputFile & operator = (const InputFile &) = delete;
InputFile (const InputFile &&) = delete;
InputFile & operator = (const InputFile &&) = delete;
InputFile (InputFile &&) = delete;
InputFile & operator = (InputFile &&) = delete;

void initialize ();
void multiPartInitialize(InputPartData* part);
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfMultiPartInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ struct MultiPartInputFile::Data: public InputStreamMutex

Data (const Data& other) = delete;
Data& operator = (const Data& other) = delete;
Data (const Data&& other) = delete;
Data& operator = (const Data&& other) = delete;
Data (Data&& other) = delete;
Data& operator = (Data&& other) = delete;

template <class T>
T* createInputPartT(int partNumber)
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfMultiPartInputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class MultiPartInputFile : public GenericInputFile

MultiPartInputFile(const MultiPartInputFile &) = delete;
MultiPartInputFile& operator = (const MultiPartInputFile &) = delete;
MultiPartInputFile(const MultiPartInputFile &&) = delete;
MultiPartInputFile& operator = (const MultiPartInputFile &&) = delete;
MultiPartInputFile(MultiPartInputFile &&) = delete;
MultiPartInputFile& operator = (MultiPartInputFile &&) = delete;


//
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ struct MultiPartOutputFile::Data: public OutputStreamMutex

Data (const Data& other) = delete;
Data& operator = (const Data& other) = delete;
Data (const Data&& other) = delete;
Data& operator = (const Data&& other) = delete;
Data (Data&& other) = delete;
Data& operator = (Data&& other) = delete;

};

Expand Down
Loading

0 comments on commit 9a5c8d4

Please sign in to comment.