LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
UncopiableAndUnmovableClass.h
Go to the documentation of this file.
1 
10 #ifndef LARCORE_COREUTILS_UNCOPIABLEANDUNMOVEABLECLASS_H
11 #define LARCORE_COREUTILS_UNCOPIABLEANDUNMOVEABLECLASS_H
12 
13 namespace lar {
14 
15  // --- BEGIN -- Non-polymorphic classes --------------------------------------
41 
71  struct UncopiableClass {
72 
74  UncopiableClass() = default;
75 
76  // @{
78  UncopiableClass(UncopiableClass const&) = delete;
79  UncopiableClass(UncopiableClass&&) = default;
80 
81  UncopiableClass& operator=(UncopiableClass const&) = delete;
83  // @}
84 
86  ~UncopiableClass() = default;
87 
88  }; // UncopiableClass
89 
118  struct UnmovableClass {
119 
121  UnmovableClass() = default;
122 
124  UnmovableClass(UnmovableClass const&) = default;
126  UnmovableClass& operator=(UnmovableClass const&) = default;
128 
130  UnmovableClass(UnmovableClass&&) = delete;
134 
136  ~UnmovableClass() = default;
137 
138  }; // UnmovableClass
139 
148 
150  // --- END -- Non-polymorphic classes ----------------------------------------
151 
152  // --- BEGIN -- Run-time-polymorphic classes ---------------------------------
185 
193 
194  PolymorphicClass() = default;
195 
196  virtual ~PolymorphicClass() = default;
197 
198  }; // PolymorphicClass
199 
230 
231  PolymorphicUncopiableClass() = default;
232 
235 
238 
239  }; // PolymorphicUncopiableClass
240 
271 
272  PolymorphicUnmovableClass() = default;
273 
276 
279 
280  }; // PolymorphicUnmovableClass
281 
293 
295  // --- END -- Run-time-polymorphic classes -----------------------------------
296 
297 } // namespace lar
298 
299 #endif // LARCORE_COREUTILS_UNCOPIABLEANDUNMOVEABLECLASS_H
An empty class that can't be copied nor moved.
~UncopiableClass()=default
Default destructor.
UncopiableClass & operator=(UncopiableClass const &)=delete
Deleted copy and move constructors and assignments.
A polymorphic empty class that can't be copied (moving is allowed).
UncopiableClass()=default
Default constructor.
A simple polymorphic class, providing a virtual table.
An empty class that can't be copied nor moved.
An empty polymorphic class that can't be moved (copy is allowed).
An empty class that can't be copied (moving is allowed).
LArSoft-specific namespace.
An empty class that can't be moved (copy is allowed).