aqnwb 0.3.0
Loading...
Searching...
No Matches
Types.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <limits>
5#include <string>
6#include <type_traits>
7#include <vector>
8
9namespace AQNWB
10{
11
12// Forward declaration of Channel
13class Channel;
14
18class Types
19{
20public:
24 enum Status
25 {
28 };
29
36 friend Status operator&&(Status lhs, Status rhs)
37 {
38 return (lhs == Success && rhs == Success) ? Success : Failure;
39 }
40
47 friend Status operator||(Status lhs, Status rhs)
48 {
49 return (lhs == Success || rhs == Success) ? Success : Failure;
50 }
51
56 {
57 Group = 0,
61 };
62
69 {
70 switch (type) {
71 case Group:
72 return "Group";
73 case Dataset:
74 return "Dataset";
75 case Attribute:
76 return "Attribute";
77 case Undefined:
78 return "Undefined";
79 default:
80 return "Unknown";
81 }
82 }
83
91 template<StorageObjectType T>
93 : std::integral_constant<bool, (T == Dataset || T == Attribute)>
94 {
95 };
96
100 using SizeType = size_t;
101
105 static constexpr SizeType SizeTypeNotSet =
106 (std::numeric_limits<SizeType>::max)();
107
111 using SizeArray = std::vector<SizeType>;
112
116 using ChannelVector = std::vector<Channel>;
117
122 {
123 std::string name;
124 std::string version;
125
132 std::vector<std::pair<std::string_view, std::string_view>>
134 };
135};
136} // namespace AQNWB
Class for storing acquisition system channel information.
Definition Channel.hpp:16
Provides definitions for various types used in the project.
Definition Types.hpp:19
std::vector< Channel > ChannelVector
Alias for a vector of channels.
Definition Types.hpp:116
static constexpr SizeType SizeTypeNotSet
Value to use to indicate that a SizeType index is not set.
Definition Types.hpp:105
StorageObjectType
Types of object used in the NWB schema.
Definition Types.hpp:56
@ Attribute
Definition Types.hpp:59
@ Group
Definition Types.hpp:57
@ Dataset
Definition Types.hpp:58
@ Undefined
Definition Types.hpp:60
friend Status operator&&(Status lhs, Status rhs)
Overloaded && operator for Status enum.
Definition Types.hpp:36
friend Status operator||(Status lhs, Status rhs)
Overloaded || operator for Status enum.
Definition Types.hpp:47
Status
Represents the status of an operation.
Definition Types.hpp:25
@ Success
Definition Types.hpp:26
@ Failure
Definition Types.hpp:27
static std::string storageObjectTypeToString(StorageObjectType type)
Convert StorageObjectType enum value to string.
Definition Types.hpp:68
std::vector< SizeType > SizeArray
Alias for an array of size types used in the project.
Definition Types.hpp:111
size_t SizeType
Alias for the size type used in the project.
Definition Types.hpp:100
The main namespace for AqNWB.
Definition Channel.hpp:11
Helper struct to check if a value is a data field, i.e., Dataset or Attribute.
Definition Types.hpp:94
Struct to hold namespace information.
Definition Types.hpp:122
std::string name
The name of the namespace.
Definition Types.hpp:123
std::string version
The version of the namespace.
Definition Types.hpp:124
std::vector< std::pair< std::string_view, std::string_view > > specVariables
The specVariables of the namespace.
Definition Types.hpp:133