ECSTASY
All in the name
Loading...
Searching...
No Matches
util::serialization::IArrayNode Class Referenceabstract

Array node. More...

#include <IArrayNode.hpp>

Inheritance diagram for util::serialization::IArrayNode:

Public Types

using Index = size_t
 Array index type.
 
using iterator = ArrayIterator< false >
 Array iterator type.
 
using const_iterator = ArrayIterator< true >
 Array const iterator type.
 

Public Member Functions

virtual ~IArrayNode ()=default
 Default destructor.
 
virtual NodeCView get (Index index) const =0
 Get the node at index if existing.
 
virtual NodeView get (Index index)=0
 Get the node at index if existing.
 
virtual NodeCView tryGet (Index index) const noexcept=0
 Get the node at index.
 
virtual NodeView tryGet (Index index) noexcept=0
 Get the node at index.
 
virtual void pushBack (const INode &node)=0
 Push a new node at the end of the array.
 
virtual void insert (Index index, const INode &node)=0
 Insert a node at the given index.
 
virtual void replace (Index index, const INode &node)=0
 Replace a node at the given index.
 
virtual void popBack ()=0
 Delete the last array node.
 
virtual void erase (Index index)=0
 Delete the node at index.
 
virtual void clear ()=0
 Remove all the internal nodes.
 
virtual bool empty () const noexcept=0
 Check if the object is empty.
 
virtual size_t size () const noexcept=0
 Get the number of node in this.
 
virtual const_iterator cbegin () const noexcept=0
 Get the start iterator of the internal nodes.
 
virtual const_iterator begin () const noexcept=0
 Get the start iterator of the internal nodes.
 
virtual iterator begin () noexcept=0
 Get the start iterator of the internal nodes.
 
virtual const_iterator cend () const noexcept=0
 Get the end iterator of the internal nodes.
 
virtual const_iterator end () const noexcept=0
 Get the end iterator of the internal nodes.
 
virtual iterator end () noexcept=0
 Get the end iterator of the internal nodes.
 

Protected Types

template<bool isConst>
using ArrayIterator = PolymorphicIterator< std::conditional_t< isConst, NodeCView, NodeView > >
 Array Iterator.
 

Detailed Description

Array node.

Contains nodes in an array.

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Definition at line 27 of file IArrayNode.hpp.

Member Typedef Documentation

◆ ArrayIterator

Array Iterator.

Template Parameters
isConstWhether the iterator is a const iterator or not.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Definition at line 38 of file IArrayNode.hpp.

◆ const_iterator

Array const iterator type.

Definition at line 46 of file IArrayNode.hpp.

◆ Index

Array index type.

Definition at line 42 of file IArrayNode.hpp.

◆ iterator

Array iterator type.

Definition at line 44 of file IArrayNode.hpp.

Constructor & Destructor Documentation

◆ ~IArrayNode()

virtual util::serialization::IArrayNode::~IArrayNode ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ begin() [1/2]

virtual const_iterator util::serialization::IArrayNode::begin ( ) const
pure virtualnoexcept

Get the start iterator of the internal nodes.

Returns
const_iterator Iterator to the first node.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ begin() [2/2]

virtual iterator util::serialization::IArrayNode::begin ( )
pure virtualnoexcept

Get the start iterator of the internal nodes.

Returns
iterator Iterator to the first node.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ cbegin()

virtual const_iterator util::serialization::IArrayNode::cbegin ( ) const
pure virtualnoexcept

Get the start iterator of the internal nodes.

Returns
const_iterator Iterator to the first node.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ cend()

virtual const_iterator util::serialization::IArrayNode::cend ( ) const
pure virtualnoexcept

Get the end iterator of the internal nodes.

Warning
This iterator is never valid.
Returns
const_iterator Iterator to the last node + 1.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ clear()

virtual void util::serialization::IArrayNode::clear ( )
pure virtual

Remove all the internal nodes.

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ empty()

virtual bool util::serialization::IArrayNode::empty ( ) const
pure virtualnoexcept

Check if the object is empty.

Returns
bool True if this doesn't contains any node.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ end() [1/2]

virtual const_iterator util::serialization::IArrayNode::end ( ) const
pure virtualnoexcept

Get the end iterator of the internal nodes.

Warning
This iterator is never valid.
Returns
const_iterator Iterator to the last node + 1.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ end() [2/2]

virtual iterator util::serialization::IArrayNode::end ( )
pure virtualnoexcept

Get the end iterator of the internal nodes.

Warning
This iterator is never valid.
Returns
iterator Iterator to the last node + 1.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ erase()

virtual void util::serialization::IArrayNode::erase ( Index  index)
pure virtual

Delete the node at index.

Parameters
[in]indexIndex of the node to erase.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ get() [1/2]

virtual NodeCView util::serialization::IArrayNode::get ( Index  index) const
pure virtual

Get the node at index if existing.

Parameters
[in]indexThe node's index.
Returns
NodeCView A weak pointer to the requested node.
Exceptions
std::out_of_rangeIf the index is out of bounds.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ get() [2/2]

virtual NodeView util::serialization::IArrayNode::get ( Index  index)
pure virtual

Get the node at index if existing.

Parameters
[in]indexThe node's index.
Returns
NodeView A weak pointer to the requested node.
Exceptions
std::out_of_rangeIf the index is out of bounds.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ insert()

virtual void util::serialization::IArrayNode::insert ( Index  index,
const INode node 
)
pure virtual

Insert a node at the given index.

Note
All elements after (greater index) index will be moved one index further.
Parameters
[in]indexIndex of the new node.
[in]nodeNode to insert.
Exceptions
std::out_of_rangeIf index is greater than the current size().
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ popBack()

virtual void util::serialization::IArrayNode::popBack ( )
pure virtual

Delete the last array node.

Note
Does nothing if the array is empty().
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ pushBack()

virtual void util::serialization::IArrayNode::pushBack ( const INode node)
pure virtual

Push a new node at the end of the array.

Parameters
[in]nodeNode to push.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ replace()

virtual void util::serialization::IArrayNode::replace ( Index  index,
const INode node 
)
pure virtual

Replace a node at the given index.

Note
Other indexes are not changed.
Parameters
[in]indexIndex of the node.
[in]nodeNew node value.
Exceptions
std::out_of_rangeIf index is greater than or equal the current size().
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ size()

virtual size_t util::serialization::IArrayNode::size ( ) const
pure virtualnoexcept

Get the number of node in this.

Returns
size_t Number of node contained in this.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ tryGet() [1/2]

virtual NodeCView util::serialization::IArrayNode::tryGet ( Index  index) const
pure virtualnoexcept

Get the node at index.

Parameters
[in]indexThe node's index.
Returns
NodeCView A weak pointer to the requested node if it exists.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.

◆ tryGet() [2/2]

virtual NodeView util::serialization::IArrayNode::tryGet ( Index  index)
pure virtualnoexcept

Get the node at index.

Parameters
[in]indexThe node's index.
Returns
NodeCView A weak pointer to the requested node if it exists.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-12-08)

Implemented in util::serialization::TomlArrayNode.


The documentation for this class was generated from the following file: