fixup copyable
Ensure type with vtable (excluding exceptions) are not copyable.
This commit is contained in:
+3
-3
@@ -26,8 +26,8 @@ struct Entry {
|
||||
Value val;
|
||||
std::exception_ptr exc;
|
||||
Entry() = default;
|
||||
Entry(Value&& v) :val(std::move(v)) {}
|
||||
Entry(const std::exception_ptr& e) :exc(e) {}
|
||||
explicit Entry(Value&& v) :val(std::move(v)) {}
|
||||
explicit Entry(const std::exception_ptr& e) :exc(e) {}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ struct SubscriptionImpl final : public OperationBase, public Subscription
|
||||
|
||||
INST_COUNTER(SubscriptionImpl);
|
||||
|
||||
SubscriptionImpl(const evbase& loop)
|
||||
explicit SubscriptionImpl(const evbase& loop)
|
||||
:OperationBase (Operation::Monitor, loop)
|
||||
,ackTick(__FILE__, __LINE__,
|
||||
event_new(loop.base, -1, EV_TIMEOUT, &tickAckS, this))
|
||||
|
||||
@@ -118,6 +118,9 @@ struct FieldStorage {
|
||||
|
||||
void init(StoreType code);
|
||||
void deinit();
|
||||
FieldStorage() = default;
|
||||
FieldStorage(const FieldStorage&) = delete;
|
||||
FieldStorage& operator=(const FieldStorage&) = delete;
|
||||
~FieldStorage();
|
||||
|
||||
size_t index() const;
|
||||
|
||||
+4
-2
@@ -88,14 +88,16 @@ struct owned_ptr : public std::unique_ptr<T>
|
||||
*/
|
||||
namespace mdetail {
|
||||
struct PVXS_API VFunctor0 {
|
||||
VFunctor0() = default;
|
||||
VFunctor0(VFunctor0&) = delete;
|
||||
VFunctor0(const VFunctor0&) = delete;
|
||||
VFunctor0& operator=(const VFunctor0&) = delete;
|
||||
virtual ~VFunctor0() =0;
|
||||
virtual void invoke() =0;
|
||||
};
|
||||
template<typename Fn>
|
||||
struct Functor0 : public VFunctor0 {
|
||||
Functor0() = default;
|
||||
Functor0(const Functor0&) = delete;
|
||||
Functor0(Functor0&&) = default;
|
||||
Functor0(Fn&& fn) : fn(std::move(fn)) {}
|
||||
virtual ~Functor0() {}
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ protected:
|
||||
constexpr Buffer(bool be, uint8_t* buf, size_t n) :pos(buf), limit(buf+n), be(be) {}
|
||||
virtual ~Buffer() {}
|
||||
public:
|
||||
Buffer(const Buffer&) = delete;
|
||||
Buffer& operator=(const Buffer&) = delete;
|
||||
bool be;
|
||||
|
||||
// all sub-classes define
|
||||
|
||||
@@ -174,6 +174,9 @@ struct SubscriptionStat {
|
||||
|
||||
//! Handle for monitor subscription
|
||||
struct PVXS_API Subscription {
|
||||
Subscription() = default;
|
||||
Subscription(const Subscription&) = delete;
|
||||
Subscription& operator=(const Subscription&) = delete;
|
||||
virtual ~Subscription() =0;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -63,6 +63,9 @@ struct Report {
|
||||
};
|
||||
|
||||
struct PVXS_API ReportInfo {
|
||||
ReportInfo() = default;
|
||||
ReportInfo(const ReportInfo&) = delete;
|
||||
ReportInfo& operator=(const ReportInfo&) = delete;
|
||||
virtual ~ReportInfo();
|
||||
};
|
||||
|
||||
|
||||
@@ -82,6 +82,8 @@ public:
|
||||
,_cred(cred)
|
||||
,_op(op)
|
||||
{}
|
||||
OpBase(const OpBase&) = delete;
|
||||
OpBase& operator=(const OpBase&) = delete;
|
||||
virtual ~OpBase() =0;
|
||||
};
|
||||
|
||||
@@ -110,6 +112,8 @@ public:
|
||||
:OpBase(name, cred, op)
|
||||
,_pvRequest(pvRequest)
|
||||
{}
|
||||
ExecOp(const ExecOp&) = delete;
|
||||
ExecOp& operator=(const ExecOp&) = delete;
|
||||
virtual ~ExecOp();
|
||||
|
||||
#ifdef PVXS_EXPERT_API_ENABLED
|
||||
|
||||
@@ -66,6 +66,9 @@ struct PVXS_API UDPManager
|
||||
decltype (names)::const_iterator end() const { return names.end(); }
|
||||
|
||||
virtual bool reply(const void *msg, size_t msglen) const =0;
|
||||
Search() = default;
|
||||
Search(const Search&) = delete;
|
||||
Search& operator=(const Search&) = delete;
|
||||
virtual ~Search();
|
||||
};
|
||||
//! Create subscription for Search messages.
|
||||
|
||||
@@ -269,6 +269,8 @@ struct SocketPair {
|
||||
SocketPair() {
|
||||
compat_socketpair(s);
|
||||
}
|
||||
SocketPair(const SocketPair&) = delete;
|
||||
SocketPair& operator=(const SocketPair&) = delete;
|
||||
~SocketPair() {
|
||||
epicsSocketDestroy(s[0]);
|
||||
epicsSocketDestroy(s[1]);
|
||||
|
||||
@@ -260,6 +260,8 @@ struct Restore {
|
||||
,pfill(strm.fill())
|
||||
,pwidth(strm.width())
|
||||
{}
|
||||
Restore(const Restore&) = delete;
|
||||
Restore& operator=(const Restore&) = delete;
|
||||
~Restore() {
|
||||
strm.flags(pflags);
|
||||
strm.fill(pfill);
|
||||
@@ -278,6 +280,8 @@ struct InstCounter {
|
||||
registerICount(Name, Cnt);
|
||||
}
|
||||
}
|
||||
InstCounter(const InstCounter&) = delete;
|
||||
InstCounter& operator=(const InstCounter&) = delete;
|
||||
~InstCounter() {
|
||||
Cnt.fetch_sub(1u, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user