Fix copy constructor & assignment operator warning in FairMQChannel

Fix Weffc++ warnings

  - Add missing copy constructors and assignment operators .
  - Hide the warning from FairMQStateMachine.h where it is produced by boost and/or is intended.
  - Some code cleanup.
This commit is contained in:
Alexey Rybalchenko
2016-01-06 13:52:24 +01:00
committed by Florian Uhlig
parent 9a0a8c7516
commit e4fed2fa1b
21 changed files with 133 additions and 104 deletions

View File

@@ -57,6 +57,15 @@ struct internal_IDLE { std::string name() const { return "internal_IDLE"
struct END { std::string name() const { return "END"; } };
struct ERROR_FOUND { std::string name() const { return "ERROR_FOUND"; } };
// deactivate the warning for non-virtual destructor thrown in the boost library
#if defined(__clang__)
_Pragma("clang diagnostic push")
_Pragma("clang diagnostic ignored \"-Wnon-virtual-dtor\"")
#elif defined(__GNUC__) || defined(__GNUG__)
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"")
#endif
// defining the boost MSM state machine
struct FairMQFSM_ : public msm::front::state_machine_def<FairMQFSM_>
{
@@ -459,6 +468,13 @@ struct FairMQFSM_ : public msm::front::state_machine_def<FairMQFSM_>
std::atomic<State> fState;
};
// reactivate the warning for non-virtual destructor
#if defined(__clang__)
_Pragma("clang diagnostic pop")
#elif defined(__GNUC__) || defined(__GNUG__)
_Pragma("GCC diagnostic pop")
#endif
typedef msm::back::state_machine<FairMQFSM_> FairMQFSM;
} // namespace FairMQFSM