TeiaCareSDK  v0.1.0
TeiaCareSDK is a collection of reusable C++ components
Loading...
Searching...
No Matches
non_moveable.hpp
1// Copyright 2024 TeiaCare
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17namespace tc::sdk
18{
19/*!
20 * \class non_moveable
21 * \brief Utility class expected to be used as a base class to define non-moveable classes.
22 * \note It is not necessary to publicly derive from this class.
23 * It is sufficient to derive privately to prevent move operations on the derived class.
24 * \code
25 class my_class : private non_moveable
26 { ... };
27 \endcode
28 */
30{
31protected:
32 /*!
33 * \brief Constructor
34 *
35 * Default constructor for tc::sdk::non_moveable
36 */
37 inline non_moveable() = default;
38
39 /*!
40 * \brief Destructor
41 *
42 * Default constructor for tc::sdk::non_moveable
43 */
44 inline ~non_moveable() = default;
45
46 /*!
47 * \brief Move constructor
48 *
49 * Move constructor marked as deleted.
50 */
52
53 /*!
54 * \brief Move assignment operator
55 *
56 * Move assignment operator marked as deleted.
57 */
59};
60
61}
Utility class expected to be used as a base class to define non-moveable classes.
non_moveable(non_moveable &&)=delete
Move constructor.
non_moveable & operator=(non_moveable &&)=delete
Move assignment operator.
non_moveable()=default
Constructor.
~non_moveable()=default
Destructor.