Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Public Member Functions | Static Public Member Functions | Private Attributes
JSON::Leaf< Type > Class Template Reference

Template class inherited from Object that stores a parameter of a .json file. This class does not have any child or structure, simply contains final values (double, int, string, ...). More...

#include <jsonObject.h>

Inheritance diagram for JSON::Leaf< Type >:
[legend]

Public Member Functions

 Leaf (std::string const &specifier, Type t_argument)
 Constructor with two paramters. The specifier and the argument of the Leaf. More...
 
std::string getArgument () const
 Returns a std::string representing the argument of the Leaf. More...
 
Type getTypedArgument () const
 Returns the bare argument with its own type, not a string (like the function getArgument() does). More...
 
 Leaf (std::string const &specifier, Type t_argument)
 Constructor with two paramters. The specifier and the argument of the Leaf. More...
 
std::string getArgument () const
 Returns a std::string representing the argument of the Leaf. More...
 
Type getTypedArgument () const
 Returns the bare argument with its own type, not a string (like the function getArgument() does). More...
 
- Public Member Functions inherited from JSON::AbstractLeaf
 AbstractLeaf (std::string const &specifier)
 Construtor with one paramter that initializes specifier. More...
 
 AbstractLeaf (std::string const &specifier)
 Construtor with one paramter that initializes 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
 
virtual bool isNode () const
 Tells if the Object is a Node or not. This function is reimplemented in Node. More...
 
 Object (std::string const &t_specifier)
 Construtor with one paramter that initializes specifier. More...
 
virtual ~Object ()
 Destructor.
 
std::string getSpecifier () const
 
virtual bool isNode () const
 Tells if the Object is a Node or not. This function is reimplemented in Node. More...
 

Static Public Member Functions

static Child make (std::string const &specifier, Type t_argument)
 
static Child make (std::string const &specifier, Type t_argument)
 

Private Attributes

Type argument
 Argument of the Leaf. Final position on JSON tree, contains the int, double, string, ..., needed further in the program.
 

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

template<typename Type>
class JSON::Leaf< Type >

Template class inherited from Object that stores a parameter of a .json file. This class does not have any child or structure, simply contains final values (double, int, string, ...).

Template Parameters
TypeType of the parameter read in the .json file.

Constructor & Destructor Documentation

◆ Leaf() [1/2]

template<typename Type >
JSON::Leaf< Type >::Leaf ( std::string const &  specifier,
Type  t_argument 
)
inline

Constructor with two paramters. The specifier and the argument of the Leaf.

Parameters
specifierName of the Leaf's specifier.
t_argumentArgument of the Leaf (can be an int, a double, a string...).

◆ Leaf() [2/2]

template<typename Type >
JSON::Leaf< Type >::Leaf ( std::string const &  specifier,
Type  t_argument 
)
inline

Constructor with two paramters. The specifier and the argument of the Leaf.

Parameters
specifierName of the Leaf's specifier.
t_argumentArgument of the Leaf (can be an int, a double, a string...).

Member Function Documentation

◆ getArgument() [1/2]

template<typename Type >
std::string JSON::Leaf< Type >::getArgument ( ) const
inlinevirtual

Returns a std::string representing the argument of the Leaf.

Returns
The std::string corresponding to the argument.

Implements JSON::AbstractLeaf.

◆ getArgument() [2/2]

template<typename Type >
std::string JSON::Leaf< Type >::getArgument ( ) const
inlinevirtual

Returns a std::string representing the argument of the Leaf.

Returns
The std::string corresponding to the argument.

Implements JSON::AbstractLeaf.

◆ getTypedArgument() [1/2]

template<typename Type >
Type JSON::Leaf< Type >::getTypedArgument ( ) const
inline

Returns the bare argument with its own type, not a string (like the function getArgument() does).

Returns
argument.

◆ getTypedArgument() [2/2]

template<typename Type >
Type JSON::Leaf< Type >::getTypedArgument ( ) const
inline

Returns the bare argument with its own type, not a string (like the function getArgument() does).

Returns
argument.

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