From c24398de7c92271f64bb9d949e0ebb6e64dcd921 Mon Sep 17 00:00:00 2001 From: Oliver Ruebel Date: Mon, 27 Jan 2025 14:57:26 -0800 Subject: [PATCH] Improve develeoper docs for REGISTER_SUBCLASS_WITH_TYPENAME --- docs/pages/devdocs/registered_types.dox | 72 ++++++++++++++++++++----- src/nwb/misc/AnnotationSeries.hpp | 1 + 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/docs/pages/devdocs/registered_types.dox b/docs/pages/devdocs/registered_types.dox index 1f01bc6d..89260a20 100644 --- a/docs/pages/devdocs/registered_types.dox +++ b/docs/pages/devdocs/registered_types.dox @@ -71,22 +71,12 @@ * the name of the namespace in the schema (e.g., "core", "hdmf-common"). In this way * we can look up the corresponding class for an object in a file based on the * ``neurodata_type`` and ``namespace`` attributes stored in the file. - * - * \note * A special version of the ``REGISTER_SUBCLASS`` macro, called ``REGISTER_SUBCLASS_WITH_TYPENAME``, * allows setting the typename explicitly as a third argument. This is for the **special case** - * where we want to implement a class for a modified type that does not have its - * own `neurodata_type` in the NWB schema. An example is `ElectrodesTable` in NWB ` will be used on read. To support reading using the + * more specific types, we can use the \ref DEFINE_REGISTERED_FIELD macro to define + * read methods that will return the approbriate type, e.g.: + * + * \code + * DEFINE_REGISTERED_FIELD(readElectrodeTable, + * ElectrodeTable, + * ElectrodeTable::electrodeTablePath, + * "table with the extracellular electrodes") + * \endcode + * + * in \ref AQNWB::NWB::NWBFile "NWBFile" to read the \ref AQNWB::NWB::ElectrodeTable "ElectrodeTable", + * or + * + * \code + * DEFINE_REGISTERED_FIELD( + * readGroupNameColumn, + * VectorData, + * "group_name", + * "the name of the ElectrodeGroup this electrode is a part of") + * \endcode + * + * in the \ref AQNWB::NWB::ElectrodeTable "ElectrodeTable" to read the `group_name` column + * as `VectorData` with the data type already specified as `std::string` at compile time. + * * */ \ No newline at end of file diff --git a/src/nwb/misc/AnnotationSeries.hpp b/src/nwb/misc/AnnotationSeries.hpp index a9ac2ac1..54fa28b1 100644 --- a/src/nwb/misc/AnnotationSeries.hpp +++ b/src/nwb/misc/AnnotationSeries.hpp @@ -34,6 +34,7 @@ class AnnotationSeries : public TimeSeries /** * @brief Initializes the AnnotationSeries * @param description The description of the AnnotationSeries. + * @param comments Comments about the AnnotationSeries. * @param dsetSize Initial size of the main dataset. This must be a vector * with one element specifying the length in time. * @param chunkSize Chunk size to use.