TeiaCareSDK  v0.1.0
TeiaCareSDK is a collection of reusable C++ components
Loading...
Searching...
No Matches
non_copyable.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_copyable
21 * \brief Utility class expected to be used as a base class to define non-copyable classes.
22 * \note It is not necessary to publicly derive from this class.
23 * It is sufficient to derive privately to prevent copy operations on the derived class.
24 * \code
25 class my_class : private non_copyable
26 { ... };
27 \endcode
28 */
30{
31protected:
32 /*!
33 * \brief Constructor
34 *
35 * Default constructor for tc::sdk::non_copyable
36 */
37 inline non_copyable() = default;
38
39 /*!
40 * \brief Destructor
41 *
42 * Default constructor for tc::sdk::non_copyable
43 */
44 inline ~non_copyable() = default;
45
46 /*!
47 * \brief Copy constructor
48 *
49 * Copy constructor marked as deleted.
50 */
51 non_copyable(const non_copyable&) = delete;
52
53 /*!
54 * \brief Copy assignment operator
55 *
56 * Copy assignment operator marked as deleted.
57 */
59
60 /*!
61 * \brief Move constructor
62 *
63 * Move constructor marked as defaulted.
64 */
66
67 /*!
68 * \brief Move assignment operator
69 *
70 * Move assignment operator marked as defaulted.
71 */
73};
74
75}
Thread safe, blocking queue.
Utility class expected to be used as a base class to define non-copyable classes.
non_copyable(non_copyable &&) noexcept=default
Move constructor.
non_copyable & operator=(const non_copyable &)=delete
Copy assignment operator.
non_copyable()=default
Constructor.
non_copyable(const non_copyable &)=delete
Copy constructor.
~non_copyable()=default
Destructor.