aqnwb 0.4.0
Loading...
Searching...
No Matches
RecordingObjects.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include <vector>
5
6#include "Channel.hpp"
7#include "Types.hpp"
9
14namespace AQNWB::NWB
15{
16// Forward declaration
17class RegisteredType;
18} // namespace AQNWB::NWB
19
20namespace AQNWB::IO
21{
22
28
30{
31public:
36
41
46
51
58 const std::shared_ptr<AQNWB::NWB::RegisteredType>& object);
59
64 std::shared_ptr<AQNWB::NWB::RegisteredType> getRecordingObject(
65 const SizeType& objectInd);
66
74 std::shared_ptr<AQNWB::NWB::RegisteredType> getRecordingObject(
75 const std::string& path) const;
76
85 const std::shared_ptr<const AQNWB::NWB::RegisteredType>& object) const;
86
90 void clear()
91 {
92 m_recording_objects.clear();
93 m_path_to_index.clear();
94 }
95
102
106 inline SizeType size() const { return m_recording_objects.size(); }
107
113 std::string toString() const;
114
115private:
119 std::vector<std::shared_ptr<AQNWB::NWB::RegisteredType>> m_recording_objects;
120
124 std::map<std::string, SizeType> m_path_to_index;
125
129 std::string m_name;
130};
131
132} // namespace AQNWB::IO
AQNWB::Types::Status Status
Definition BaseIO.hpp:21
AQNWB::Types::SizeType SizeType
Definition Channel.hpp:8
SizeType addRecordingObject(const std::shared_ptr< AQNWB::NWB::RegisteredType > &object)
Adds a RegisteredType object to the recording objects collection.
Definition RecordingObjects.cpp:35
~RecordingObjects()
Destructor for RecordingObjects class.
Definition RecordingObjects.cpp:20
std::string toString() const
Create a string representation of the RecordingObjects contents.
Definition RecordingObjects.cpp:95
std::vector< std::shared_ptr< AQNWB::NWB::RegisteredType > > m_recording_objects
The RegisteredType objects used for recording.
Definition RecordingObjects.hpp:119
std::shared_ptr< AQNWB::NWB::RegisteredType > getRecordingObject(const SizeType &objectInd)
Gets the RegisteredType object from the recording objects collection.
Definition RecordingObjects.cpp:62
void clear()
Clear the recording objects collection.
Definition RecordingObjects.hpp:90
SizeType getRecordingIndex(const std::shared_ptr< const AQNWB::NWB::RegisteredType > &object) const
Finds the index of a RegisteredType object in the recording objects collection.
Definition RecordingObjects.cpp:22
RecordingObjects()
Constructor for RecordingObjects class.
Definition RecordingObjects.cpp:18
Status finalize()
Finalize all RegisteredType objects managed by this RecordingObjects instance. This method calls fina...
Definition RecordingObjects.cpp:81
RecordingObjects(const RecordingObjects &)=delete
Deleted copy constructor to prevent construction-copying.
std::string m_name
The name of the collection of recording objects.
Definition RecordingObjects.hpp:129
std::map< std::string, SizeType > m_path_to_index
Map from object path to its index in m_recording_objects.
Definition RecordingObjects.hpp:124
RecordingObjects & operator=(const RecordingObjects &)=delete
Deleted copy assignment operator to prevent copying.
SizeType size() const
Get the number of recording objects.
Definition RecordingObjects.hpp:106
Base class for types defined in the NWB schema.
Definition RegisteredType.hpp:48
The namespace for IO components of AqNWB.
Namespace for all classes related to the NWB data standard.