mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Define copy/move ctors and assignment ops
Delete special member functions where they are not used. (as part of applying suggestions from cppcoreguidelines-special-member-functions) These classes don't need to be copyable/movable: # copy/move not used: zmq:: TransportFactory, Socket, Message, UnmanagedRegion, Poller, Context shm:: TransportFactory, Socket, Message, UnmanagedRegion, Poller ofi:: TransportFactory, Socket, Message, Context shm:: ZMsg, Region, Monitor, TerminalConfig, Manager plugins:: Config, Control, TerminalConfig fairmq::StateQueue, StateMachine, ProgOptions, PluginServices, PluginManager, Plugin, Device, StateSubscription TestData, BadDevice, TestDevice (test suite heplers) # used via ptr interface: fairmq::UnmanagedRegion, TransportFactory, Socket, Poller, Message These classes need to be movable/copyable: MyClass (test suite helper), fairmq::Channel, fairmq::Parts
This commit is contained in:
committed by
Dennis Klein
parent
597d88277b
commit
ad824b4de1
@@ -67,6 +67,11 @@ class TestDevice : public FairMQDevice
|
||||
ChangeState(fair::mq::Transition::Run);
|
||||
}
|
||||
|
||||
TestDevice(const TestDevice&) = delete;
|
||||
TestDevice(TestDevice&&) = delete;
|
||||
TestDevice& operator=(const TestDevice&) = delete;
|
||||
TestDevice& operator=(TestDevice&&) = delete;
|
||||
|
||||
~TestDevice()
|
||||
{
|
||||
WaitForState(fair::mq::State::Running);
|
||||
|
@@ -44,6 +44,11 @@ class BadDevice : public FairMQDevice
|
||||
parts.AddPart(NewMessage());
|
||||
}
|
||||
|
||||
BadDevice(const BadDevice&) = delete;
|
||||
BadDevice(BadDevice&&) = delete;
|
||||
BadDevice& operator=(const BadDevice&) = delete;
|
||||
BadDevice& operator=(BadDevice&&) = delete;
|
||||
|
||||
~BadDevice()
|
||||
{
|
||||
ChangeState(fair::mq::Transition::ResetDevice);
|
||||
|
@@ -39,6 +39,9 @@ struct TestData
|
||||
++nallocations;
|
||||
}
|
||||
|
||||
TestData& operator=(const TestData&) = delete;
|
||||
TestData& operator=(TestData&&) = delete;
|
||||
|
||||
TestData(const TestData& in)
|
||||
: i{in.i}
|
||||
{
|
||||
|
@@ -17,7 +17,10 @@ struct MyClass
|
||||
MyClass() = default;
|
||||
MyClass(std::string a) : msg(std::move(a)) {}
|
||||
MyClass(const MyClass&) = default;
|
||||
MyClass& operator=(const MyClass& b) = default;
|
||||
MyClass(MyClass&&) = default;
|
||||
MyClass& operator=(const MyClass&) = default;
|
||||
MyClass& operator=(MyClass&&) = default;
|
||||
~MyClass() = default;
|
||||
std::string msg;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user