Public Member Functions | Protected Member Functions | Protected Attributes
morphio::SectionBase< T > Class Template Reference

#include <section_base.h>

Public Member Functions

bool operator== (const SectionBase &other) const noexcept
bool operator!= (const SectionBase &other) const noexcept
bool isRoot () const
parent () const
std::vector< T > children () const
uint32_t id () const noexcept
template<typename TProperty >
range< const typename TProperty::Type > get () const

Protected Member Functions

 SectionBase (uint32_t id, const std::shared_ptr< Property::Properties > &properties)
template<typename Property >
range< const typename Property::Type > get () const

Protected Attributes

uint32_t id_ = 0
SectionRange range_
std::shared_ptr< Property::Propertiesproperties_

Detailed Description

template<typename T>
class morphio::SectionBase< T >

This CRTP ( defines basic methods that every kind of sections (should them be neuronal or mithochondrial) must define.

The CRTP is used here so that the methods of the base class can return object of the derived class. Examples: T SectionBase::parent() std::vector<T> SectionBase::children()

Member Function Documentation

◆ children()

template<typename T >
std::vector< T > morphio::SectionBase< T >::children

Return a list of children sections

◆ id()

template<typename T >
uint32_t morphio::SectionBase< T >::id ( ) const

Return the ID of this section.

◆ isRoot()

template<typename T >
bool morphio::SectionBase< T >::isRoot

Return true if this section is a root section (parent ID == -1)

◆ parent()

template<typename T >
T morphio::SectionBase< T >::parent

Return the parent section of this section

MissingParentErroris the section doesn't have a parent.