MIRA
Public Types | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Friends | List of all members
JSONDefaultPrecision Class Reference

JSONDefaultPrecision is a singleton that provides a mechanism to control the default precision for output of floating-point JSON values. More...

#include <json/JSON.h>

Inheritance diagram for JSONDefaultPrecision:
Inheritance graph
[legend]

Public Types

typedef Base::Type Type
 

Static Public Member Functions

static void set (unsigned int precision)
 Set default precision for json::write(). More...
 
static void reset ()
 Reset default precision for json::write() to initial default value (MIRA_JSON_DEFAULT_PRECISION). More...
 
static unsigned int get ()
 Query current default precision for json::write(). More...
 
static Type & instance ()
 Returns a reference to the singleton instance. More...
 
static bool isDestroyed ()
 Returns true, if the singleton was already destroyed. More...
 

Protected Member Functions

 JSONDefaultPrecision ()
 

Static Protected Member Functions

static Type * makeInstance ()
 
static void destroyInstance (void)
 

Static Protected Attributes

static const unsigned int MIRA_JSON_DEFAULT_PRECISION = 3
 Default value if not changed using set(). More...
 

Friends

class singleton::CreateUsingNew< JSONDefaultPrecision >
 

Detailed Description

JSONDefaultPrecision is a singleton that provides a mechanism to control the default precision for output of floating-point JSON values.

Member Typedef Documentation

◆ Type

typedef Base::Type Type
inherited

Constructor & Destructor Documentation

◆ JSONDefaultPrecision()

JSONDefaultPrecision ( )
inlineprotected

Member Function Documentation

◆ set()

static void set ( unsigned int  precision)
inlinestatic

Set default precision for json::write().

◆ reset()

static void reset ( )
inlinestatic

Reset default precision for json::write() to initial default value (MIRA_JSON_DEFAULT_PRECISION).

◆ get()

static unsigned int get ( )
inlinestatic

Query current default precision for json::write().

◆ instance()

static Type& instance ( )
inlinestaticinherited

Returns a reference to the singleton instance.

Exceptions
XSingletonIf the singleton was already destroyed (dead reference) or not yet created (when using ExplicitInstantiation).

◆ isDestroyed()

static bool isDestroyed ( )
inlinestaticinherited

Returns true, if the singleton was already destroyed.

Trying to access it will result in an exception.

◆ makeInstance()

static Type* makeInstance ( )
inlinestaticprotectedinherited

◆ destroyInstance()

static void destroyInstance ( void  )
inlinestaticprotectedinherited

Friends And Related Function Documentation

◆ singleton::CreateUsingNew< JSONDefaultPrecision >

Member Data Documentation

◆ MIRA_JSON_DEFAULT_PRECISION

const unsigned int MIRA_JSON_DEFAULT_PRECISION = 3
staticprotected

Default value if not changed using set().


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