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

#include <section_base.h>

Public Member Functions

 SectionBase (const SectionBase &section)
 
SectionBaseoperator= (const SectionBase &other)
 
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
 

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
 
SectionRange _range
 
std::shared_ptr< Property::Properties_properties
 

Detailed Description

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

This CRTP (https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern) 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 ( ) const

Return a list of children sections

◆ id()

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

Return the ID of this section.

◆ isRoot()

template<typename T>
bool morphio::SectionBase< T >::isRoot ( ) const

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

◆ parent()

template<typename T>
T morphio::SectionBase< T >::parent ( ) const

Return the parent section of this section

Exceptions
MissingParentErroris the section doesn't have a parent.