Capsule API Example

Loading...
Searching...
No Matches
Classification.hpp
Go to the documentation of this file.
1// Copyright. 2019 - 2024 PSBD. All rights reserved.
2
3#pragma once
4
5#include <memory>
6
7 namespace capsule::client {
8 class Session;
9 class SessionPrivate;
10 class ClassificationPrivate;
11 class DevicePrivate;
12
16 class Classification {
17 friend Session;
18 friend SessionPrivate;
19 friend ClassificationPrivate;
20 friend DevicePrivate;
21
22 public:
23 enum class ClassifierType : uint8_t {
24 Cardio = 0,
25 Emotions = 1,
26 NFB = 1 << 1,
27 MEMS = 1 << 2,
28 Physiological = 1 << 4,
29 Productivity = 1 << 5
30 };
31 bool IsValid() const noexcept;
32 Classification(const Classification&) = delete;
33 Classification& operator=(const Classification&) = delete;
34 Classification(Classification&& rhs) noexcept;
35 Classification& operator=(Classification&& rhs) noexcept;
36
37 protected:
38 explicit Classification(std::unique_ptr<ClassificationPrivate>&& pimpl);
39 virtual ~Classification();
40 void CheckValid() const;
41 template <typename T>
42 T* castImpl() {
43 return static_cast<T*>(m_pimpl);
44 }
45 template <typename T>
46 const T* castImpl() const {
47 return static_cast<const T*>(m_pimpl);
48 }
49
50 ClassificationPrivate* m_pimpl;
51};
52
53} // namespace capsule::client
capsule::client::Classification
is the base class for to NFB or productivity classification process.
Definition Classification.hpp:16
capsule::client::Classification::CheckValid
void CheckValid() const
capsule::client::Classification::ClassifierType
ClassifierType
Definition Classification.hpp:23
capsule::client::Classification::ClassifierType::MEMS
@ MEMS
capsule::client::Classification::ClassifierType::Physiological
@ Physiological
capsule::client::Classification::ClassifierType::Productivity
@ Productivity
capsule::client::Classification::ClassifierType::NFB
@ NFB
capsule::client::Classification::ClassifierType::Cardio
@ Cardio
capsule::client::Classification::ClassifierType::Emotions
@ Emotions
capsule::client::Classification::castImpl
const T * castImpl() const
Definition Classification.hpp:46
capsule::client::Classification::IsValid
bool IsValid() const noexcept
capsule::client::Classification::castImpl
T * castImpl()
Definition Classification.hpp:42
capsule::client::Classification::m_pimpl
ClassificationPrivate * m_pimpl
Definition Classification.hpp:50
capsule::client
Definition Classification.hpp:7