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
17
namespace
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
*/
29
class
non_moveable
30
{
31
protected
:
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
*/
51
non_moveable
(
non_moveable
&&) =
delete
;
52
53
/*!
54
* \brief Move assignment operator
55
*
56
* Move assignment operator marked as deleted.
57
*/
58
non_moveable
&
operator=
(
non_moveable
&&) =
delete
;
59
};
60
61
}
tc::sdk::non_moveable
Utility class expected to be used as a base class to define non-moveable classes.
Definition
non_moveable.hpp:30
tc::sdk::non_moveable::non_moveable
non_moveable(non_moveable &&)=delete
Move constructor.
tc::sdk::non_moveable::operator=
non_moveable & operator=(non_moveable &&)=delete
Move assignment operator.
tc::sdk::non_moveable::non_moveable
non_moveable()=default
Constructor.
tc::sdk::non_moveable::~non_moveable
~non_moveable()=default
Destructor.
TeiaCareSDK v0.1.0