Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update member variable names to avoid shadowing #102

Merged
merged 29 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2071445
Update Channel.hpp/cpp to avoid shadowing
oruebel Sep 19, 2024
43313cb
Fix formatting
oruebel Sep 19, 2024
5c69181
Update names in RecordingContainers
oruebel Sep 19, 2024
0685e57
Update members in NWBFile
oruebel Sep 19, 2024
f4583b3
Update members in Container
oruebel Sep 19, 2024
615b03c
Fix formatting
oruebel Sep 19, 2024
476d7c7
Update members in Data.hpp
oruebel Sep 19, 2024
131a914
Update member in HDF5RecordingData
oruebel Sep 19, 2024
e10535f
Update members in BaseIO and HDF5IO
oruebel Sep 19, 2024
42a43a8
Update members in VectorData
oruebel Sep 19, 2024
fcea059
Fix formatting
oruebel Sep 19, 2024
341739e
Fix ubuntu build error
oruebel Sep 19, 2024
669fa95
Fix Doxygen built errors
oruebel Sep 19, 2024
ad7aea4
Replace this->m_ with just m_
oruebel Sep 20, 2024
be49619
Update src/nwb/ecephys/SpikeEventSeries.hpp
oruebel Sep 20, 2024
430600a
Remove setters from channel
stephprince Sep 20, 2024
3a685f6
Make simple getters in BaseIO in the header and remove redundant over…
oruebel Sep 20, 2024
6d3c520
Merge branch 'resolve_shadowing' of https://github.com/lbl-cbg/aq-nwb…
oruebel Sep 20, 2024
57c8520
Fix formatting
oruebel Sep 20, 2024
b7a8792
Make simple getter for HDF5RecordingData inline
oruebel Sep 20, 2024
f1122d0
Make simple getter for RecordingContainers inline
oruebel Sep 20, 2024
940bf06
replace this->m_ with just m_
stephprince Sep 20, 2024
d73d7a2
Move simple setters for DynamicTable and remove redundant definitions…
oruebel Sep 20, 2024
4ba163f
Merge branch 'resolve_shadowing' of https://github.com/lbl-cbg/aq-nwb…
oruebel Sep 20, 2024
f2816c2
fix formatting
stephprince Sep 20, 2024
7bc8d3c
Fix formatting
oruebel Sep 20, 2024
6bca260
Merge branch 'resolve_shadowing' of https://github.com/lbl-cbg/aq-nwb…
oruebel Sep 20, 2024
45a1238
Move VectorData getters
oruebel Sep 20, 2024
f00b03c
Fix hidden ElectrodeTable.colNames member and bad init
oruebel Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions docs/pages/userdocs/workflow.dox
Original file line number Diff line number Diff line change
Expand Up @@ -8,94 +8,94 @@
* For users wanting to integrate NWB with a particular data acquisition software, here
* we outline the steps for a single recording from file creation to saving.
*
* 1. Create the I/O object (e.g,. \ref AQNWB::HDF5::HDF5IO "HDF5IO") used for
* 1. Create the I/O object (e.g,. \ref AQNWB::HDF5::HDF5IO "HDF5IO") used for
* writing data to the file on disk.
* 2. Create the \ref AQNWB::NWB::RecordingContainers "RecordingContainers" object
* 2. Create the \ref AQNWB::NWB::RecordingContainers "RecordingContainers" object
* used for managing \ref AQNWB::NWB::Container "Container" objects for storing recordings.
* 3. Create the \ref AQNWB::NWB::NWBFile "NWBFile" object used for managing and creating NWB
* 3. Create the \ref AQNWB::NWB::NWBFile "NWBFile" object used for managing and creating NWB
* file contents.
* 4. Create the \ref AQNWB::NWB::Container "Container" objects (e.g.,
* \ref AQNWB::NWB::ElectricalSeries "ElectricalSeries") used for recording and add them
* 4. Create the \ref AQNWB::NWB::Container "Container" objects (e.g.,
* \ref AQNWB::NWB::ElectricalSeries "ElectricalSeries") used for recording and add them
* to the \ref AQNWB::NWB::RecordingContainers "RecordingContainers".
* 5. Start the recording.
* 6. Write data.
* 7. Stop the recording and close the \ref AQNWB::NWB::NWBFile "NWBFile".
*
*
* Below, we walk through these steps in more detail.
*
*
*
*
* \subsection create_io 1. Create the I/O object.
*
* First, create an I/O object (e.g., \ref AQNWB::HDF5::HDF5IO "HDF5IO") used for writing
*
* First, create an I/O object (e.g., \ref AQNWB::HDF5::HDF5IO "HDF5IO") used for writing
* data to the file. AqNWB provides the convenience method, \ref AQNWB::createIO "createIO"
* to create this object using one of the supported backends. For more fine-grained
* control of different backend parameters, you can create your own `std::shared_ptr`
* control of different backend parameters, you can create your own `std::shared_ptr`
* using any of the derived \ref AQNWB::BaseIO "BaseIO" classes.
*
*
* \snippet tests/examples/testWorkflowExamples.cpp example_workflow_io_snippet
*
*
* \subsection create_recording_container 2. Create the RecordingContainer object.
*
* Next, create a \ref AQNWB::NWB::RecordingContainers "RecordingContainers" object to manage the
* different \ref AQNWB::NWB::Container "Container" objects with the datasets that you would
*
* Next, create a \ref AQNWB::NWB::RecordingContainers "RecordingContainers" object to manage the
* different \ref AQNWB::NWB::Container "Container" objects with the datasets that you would
* like to write data to.
*
*
* \snippet tests/examples/testWorkflowExamples.cpp example_workflow_recording_containers_snippet
*
*
*
* \subsection create_nwbfile 3. Create the NWBFile
*
* Next, constructs the \ref AQNWB::NWB::NWBFile "NWBFile" object, using the I/O object as an input.
*
* Next, constructs the \ref AQNWB::NWB::NWBFile "NWBFile" object, using the I/O object as an input.
* Then, initialize the object to create the basic file structure of the NWBFile.
*
* \snippet tests/examples/testWorkflowExamples.cpp example_workflow_nwbfile_snippet
*
*
*
* \subsection create_datasets 4. Create datasets and add to RecordingContainers.
*
* Next, create the different data types (e.g. \ref AQNWB::NWB::ElectricalSeries "ElectricalSeries"
* or other AQNWB::NWB::TimeSeries "TimeSeries") that you would like to write data into. After
* creation, these objects are added to the \ref AQNWB::NWB::RecordingContainers "RecordingContainers"
* object so that it can mana ge access and data writing during the recording process.
* When adding containers, ownership of the \ref AQNWB::NWB::Container "Container" is transferred to the
* \ref AQNWB::NWB::RecordingContainers "RecordingContainers" object, so that we can access it again via
* its index. New containers will always be appended to the end of the
* \ref AQNWB::NWB::RecordingContainers::containers "containers" object and their index can be tracked
* using the size of the input `recordingArrays`.
*
* Next, create the different data types (e.g. \ref AQNWB::NWB::ElectricalSeries "ElectricalSeries"
* or other AQNWB::NWB::TimeSeries "TimeSeries") that you would like to write data into. After
* creation, these objects are added to the \ref AQNWB::NWB::RecordingContainers "RecordingContainers"
* object so that it can mana ge access and data writing during the recording process.
* When adding containers, ownership of the \ref AQNWB::NWB::Container "Container" is transferred to the
* \ref AQNWB::NWB::RecordingContainers "RecordingContainers" object, so that we can access it again via
* its index. New containers will always be appended to the end of the private member
* ``RecordingContainers.m_containers` object and their index can be tracked
* using the \ref AQNWB::NWB::RecordingContainers::size "RecordingContainers.size" of the input `recordingArrays`.
*
* \snippet tests/examples/testWorkflowExamples.cpp example_workflow_datasets_snippet
*
*
* \subsection start_recording 5. Start the recording.
*
* Then, start the recording process with a call to the ``startRecording`` function of the I/O object.
* Then, start the recording process with a call to the ``startRecording`` function of the I/O object.
*
* \note
* When using \ref AQNWB::HDF5::HDF5IO "HDF5IO" for writing to HDF5, calling
* \note
* When using \ref AQNWB::HDF5::HDF5IO "HDF5IO" for writing to HDF5, calling
* \ref AQNWB::HDF5::HDF5IO::startRecording "startRecording" will by default enable
* \ref hdf5io_swmr "SWMR mode" to ensure file integrity and support concurrent read.
* \ref hdf5io_swmr "SWMR mode" to ensure file integrity and support concurrent read.
* As a result, no additional datasets or groups can be added to the file once a recording
* has been started unless the file is is closed and reopened.
*
* \snippet tests/examples/testWorkflowExamples.cpp example_workflow_start_snippet
*
*
*
* \subsection write_data 6. Write data.
*
* During the recording process, use the \ref AQNWB::NWB::RecordingContainers "RecordingContainers"
* as an interface to access the various \ref AQNWB::NWB::Container "Container" object and corresponding
* datasets and write blocks of data to the file. Calling `flush()` on the I/O object at any time will
* During the recording process, use the \ref AQNWB::NWB::RecordingContainers "RecordingContainers"
* as an interface to access the various \ref AQNWB::NWB::Container "Container" object and corresponding
* datasets and write blocks of data to the file. Calling `flush()` on the I/O object at any time will
* ensure the data is moved to disk.
*
*
* \snippet tests/examples/testWorkflowExamples.cpp example_workflow_write_snippet
*
*
*
* \subsection stop_recording 7. Stop the recording and finalize the file.
*
* When the recording process is finished, call `stopRecording` from the I/O object
* to flush any data and close the file.
*
*
* \snippet tests/examples/testWorkflowExamples.cpp example_workflow_stop_snippet
*
*
Expand Down
22 changes: 4 additions & 18 deletions src/BaseIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,15 @@ const BaseDataType BaseDataType::DSTR = BaseDataType(T_STR, DEFAULT_STR_SIZE);

// BaseIO

BaseIO::BaseIO()
: readyToOpen(true)
, opened(false)
BaseIO::BaseIO(const std::string& filename)
: m_filename(filename)
, m_readyToOpen(true)
, m_opened(false)
{
}

BaseIO::~BaseIO() {}

bool BaseIO::isOpen() const
{
return opened;
}

bool BaseIO::isReadyToOpen() const
{
return readyToOpen;
}

bool BaseIO::canModifyObjects()
{
return true;
}

Status BaseIO::createCommonNWBAttributes(const std::string& path,
const std::string& objectNamespace,
const std::string& neurodataType,
Expand Down
18 changes: 9 additions & 9 deletions src/BaseIO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class BaseIO
/**
* @brief Constructor for the BaseIO class.
*/
BaseIO();
BaseIO(const std::string& filename);

/**
* @brief Copy constructor is deleted to prevent construction-copying.
Expand All @@ -115,7 +115,7 @@ class BaseIO
* @brief Returns the full path to the file.
* @return The full path to the file.
*/
virtual std::string getFileName() = 0;
virtual std::string getFileName() const { return m_filename; }

/**
* @brief Opens the file for writing.
Expand Down Expand Up @@ -267,7 +267,7 @@ class BaseIO
* override this function to check if objects can be modified.
* @return True if the file is in a modification mode, false otherwise.
*/
virtual bool canModifyObjects();
virtual bool canModifyObjects() { return true; }

/**
* @brief Creates an extendable dataset with a given base data type, size,
Expand Down Expand Up @@ -338,20 +338,20 @@ class BaseIO
* @brief Returns true if the file is open.
* @return True if the file is open, false otherwise.
*/
bool isOpen() const;
inline bool isOpen() const { return m_opened; }

/**
* @brief Returns true if the file is able to be opened.
* @return True if the file is able to be opened, false otherwise.
*/
bool isReadyToOpen() const;
inline bool isReadyToOpen() const { return m_readyToOpen; }

protected:
/**
* @brief The name of the file.
*/
const std::string filename;
const std::string m_filename;

protected:
/**
* @brief Creates a new group if it does not already exist.
* @param path The location of the group in the file.
Expand All @@ -362,12 +362,12 @@ class BaseIO
/**
* @brief Whether the file is ready to be opened.
*/
bool readyToOpen;
bool m_readyToOpen;

/**
* @brief Whether the file is currently open.
*/
bool opened;
bool m_opened;
};

/**
Expand Down
35 changes: 10 additions & 25 deletions src/Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,17 @@ Channel::Channel(const std::string name,
const float bitVolts,
const std::array<float, 3> position,
const std::string comments)
: name(name)
, groupName(groupName)
, groupIndex(groupIndex)
, localIndex(localIndex)
, globalIndex(globalIndex)
, position(position)
, conversion(conversion)
, samplingRate(samplingRate)
, bitVolts(bitVolts)
, comments(comments)
: m_name(name)
, m_groupName(groupName)
, m_groupIndex(groupIndex)
, m_localIndex(localIndex)
, m_globalIndex(globalIndex)
, m_position(position)
, m_conversion(conversion)
, m_samplingRate(samplingRate)
, m_bitVolts(bitVolts)
, m_comments(comments)
{
}

Channel::~Channel() {}

float Channel::getConversion() const
{
return bitVolts / conversion;
}

float Channel::getSamplingRate() const
{
return samplingRate;
}

float Channel::getBitVolts() const
{
return bitVolts;
}
Loading
Loading