Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Public Member Functions | Static Public Member Functions
JSON::List Class Reference

A List is a particular Node of which all children are of the same type and have the same specifier. More...

#include <jsonObject.h>

Inheritance diagram for JSON::List:
[legend]

Public Member Functions

 List (std::string const &specifier)
 Construtor with one paramter that initializes specifier. More...
 
void addChild (Child &child) override
 Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same). More...
 
template<class T >
void addChild (std::unique_ptr< T > &child)
 Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same). More...
 
void addChild (Child &&child) override
 Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same). More...
 
template<class T >
void addChild (std::unique_ptr< T > &&child)
 Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same). More...
 
 List (std::string const &specifier)
 Construtor with one paramter that initializes specifier. More...
 
void addChild (Child &child) override
 Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same). More...
 
template<class T >
void addChild (std::unique_ptr< T > &child)
 Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same). More...
 
void addChild (Child &&child) override
 Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same). More...
 
template<class T >
void addChild (std::unique_ptr< T > &&child)
 Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same). More...
 
- Public Member Functions inherited from JSON::Node
 Node (std::string const &specifier)
 Construtor with one paramter that initializes specifier. More...
 
bool isNode () const override
 Tells if the Object is a Node or not. More...
 
template<class T >
void addChild (std::unique_ptr< T > &child)
 Adds a child in the Node. More...
 
template<class T >
void addChild (std::unique_ptr< T > &&child)
 Adds a child in the Node. More...
 
size_t size () const
 
bool empty () const
 Tells if the Node is empty. More...
 
std::vector< Child >::const_iterator begin () const
 
std::vector< Child >::const_iterator end () const
 
std::vector< Child >::iterator begin ()
 
std::vector< Child >::iterator end ()
 
ObjectgetChild (std::string const &spec) const
 Returns the first child that has a given specifier. More...
 
 Node (std::string const &specifier)
 Construtor with one paramter that initializes specifier. More...
 
bool isNode () const override
 Tells if the Object is a Node or not. More...
 
template<class T >
void addChild (std::unique_ptr< T > &child)
 Adds a child in the Node. More...
 
template<class T >
void addChild (std::unique_ptr< T > &&child)
 Adds a child in the Node. More...
 
size_t size () const
 
bool empty () const
 Tells if the Node is empty. More...
 
std::vector< Child >::const_iterator begin () const
 
std::vector< Child >::const_iterator end () const
 
std::vector< Child >::iterator begin ()
 
std::vector< Child >::iterator end ()
 
ObjectgetChild (std::string const &spec) const
 Returns the first child that has a given specifier. More...
 
- Public Member Functions inherited from JSON::Object
 Object (std::string const &t_specifier)
 Construtor with one paramter that initializes specifier. More...
 
virtual ~Object ()
 Destructor.
 
std::string getSpecifier () const
 
 Object (std::string const &t_specifier)
 Construtor with one paramter that initializes specifier. More...
 
virtual ~Object ()
 Destructor.
 
std::string getSpecifier () const
 

Static Public Member Functions

static std::unique_ptr< Listmake (std::string const &specifier)
 
static std::unique_ptr< Listmake (std::string const &specifier)
 
- Static Public Member Functions inherited from JSON::Node
static std::unique_ptr< Nodemake (std::string const &specifier)
 
static std::unique_ptr< Nodemake (std::string const &specifier)
 

Additional Inherited Members

- Protected Attributes inherited from JSON::Object
std::string specifier
 String that represents the specifier of the object. For example: "name": "electron" is an object of which the specifier is the string "name".
 

Detailed Description

A List is a particular Node of which all children are of the same type and have the same specifier.

Constructor & Destructor Documentation

◆ List() [1/2]

JSON::List::List ( std::string const &  specifier)
inlineexplicit

Construtor with one paramter that initializes specifier.

Parameters
t_specifierName of the List's specifier.

◆ List() [2/2]

JSON::List::List ( std::string const &  specifier)
inlineexplicit

Construtor with one paramter that initializes specifier.

Parameters
t_specifierName of the List's specifier.

Member Function Documentation

◆ addChild() [1/8]

void JSON::List::addChild ( Child child)
inlineoverridevirtual

Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same).

Parameters
childNew child added in children.

Reimplemented from JSON::Node.

◆ addChild() [2/8]

void JSON::List::addChild ( Child child)
inlineoverridevirtual

Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same).

Parameters
childNew child added in children.

Reimplemented from JSON::Node.

◆ addChild() [3/8]

template<class T >
void JSON::List::addChild ( std::unique_ptr< T > &  child)
inline

Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same).

Parameters
childNew child added in children.

◆ addChild() [4/8]

template<class T >
void JSON::List::addChild ( std::unique_ptr< T > &  child)
inline

Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same).

Parameters
childNew child added in children.

◆ addChild() [5/8]

void JSON::List::addChild ( Child &&  child)
inlineoverridevirtual

Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same).

Parameters
childNew child added in children.

Reimplemented from JSON::Node.

◆ addChild() [6/8]

void JSON::List::addChild ( Child &&  child)
inlineoverridevirtual

Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same).

Parameters
childNew child added in children.

Reimplemented from JSON::Node.

◆ addChild() [7/8]

template<class T >
void JSON::List::addChild ( std::unique_ptr< T > &&  child)
inline

Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same).

Parameters
childNew child added in children.

◆ addChild() [8/8]

template<class T >
void JSON::List::addChild ( std::unique_ptr< T > &&  child)
inline

Adds a child in the List. Checks if the specifier is the same as the one of the List (each element must have the same).

Parameters
childNew child added in children.

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