jsonserial2  2.0
 All Classes Functions Typedefs Enumerations
Public Member Functions | List of all members
jsonserial::JSonClasses Class Reference

Set of declared classes. More...

Public Member Functions

 JSonClasses (JSonError::Handler handler={})
 Constructor.
 
template<class T >
JSonUserClass< T > & addClass (JKString &classname)
 Declares a C++ class having a public no-argument constructor. More...
 
template<class T >
JSonUserClass< T > & addClass (JKString &classname, std::function< T *()> creator)
 Declares a C++ class that is abstract or does not have a public no-argument constructor. More...
 
void error (JSonError::Type type, JKString &arg, JKString &name)
 Displays an error.
 
const JSonClassgetClass (JKString &classname) const
 Searches class from name.
 
const JSonClassgetClass (const std::type_info &tinfo) const
 Searches class from typeinfo.
 

Detailed Description

Set of declared classes.

Member Function Documentation

template<class T >
JSonUserClass<T>& jsonserial::JSonClasses::addClass ( JKString &  classname)
inline

Declares a C++ class having a public no-argument constructor.

The template argument is the c++ class, classname its UTF8 name. The no-argument constructor will be used when a pointee needs to be created.

template<class T >
JSonUserClass< T > & jsonserial::JSonClasses::addClass ( JKString &  classname,
std::function< T *()>  creator 
)

Declares a C++ class that is abstract or does not have a public no-argument constructor.

The template argument is the c++ class, classname its UTF8 name, creator the creator function that will be used when a pointee needs to be created. creator can be null if the class is an abstract class. Otherwise creator must return the newly created pointee as a pointer. creator can be a lambda, a static method, a non-member function.


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