Add NONCOPYABLE macro
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Thu, 21 Aug 2014 09:52:14 +0000 (11:52 +0200)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Fri, 12 Sep 2014 12:59:28 +0000 (14:59 +0200)
Declaring class noncopyable requires explicit deletion of a constructor and
operator. To simplify it, the NONCOPYABLE macro has been added.

Change-Id: Iee4e1824238033f4f5719b96c88f18b4400213fb

src/manager/common/noncopyable.h [new file with mode: 0644]

diff --git a/src/manager/common/noncopyable.h b/src/manager/common/noncopyable.h
new file mode 100644 (file)
index 0000000..32f443a
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ *  Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ */
+/*
+ * @file       noncopyable.h
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version    1.0
+ */
+
+#pragma once
+
+#define NONCOPYABLE(type)                  \
+    type(const type&) = delete;            \
+    type& operator=(const type&) = delete;