8#include <ext/functional>
10#include <ext/algorithm>
12#include <ext/typeinfo>
25template <
typename T >
39 static ext::list < std::pair < std::function < bool (
ext::istream & ) >, std::unique_ptr < GroupReader > > > & parseFunctions ( );
41 template <
class Type >
42 class ReaderRegister :
public GroupReader {
44 ~ReaderRegister ( )
override =
default;
62 template <
class Type >
63 class WriterRegister :
public GroupWriter {
65 ~WriterRegister ( )
override =
default;
73 static void unregisterStringReader (
ext::list < std::pair < std::function <
bool (
ext::istream & ) >, std::unique_ptr < GroupReader > > >::const_iterator iter );
75 static ext::list < std::pair < std::function < bool (
ext::istream & ) >, std::unique_ptr < GroupReader > > >::const_iterator registerStringReader ( std::function <
bool (
ext::istream & ) > first, std::unique_ptr < GroupReader > entry );
77 template <
class Type >
79 return registerStringReader (
stringApi < Type >::first, std::unique_ptr < GroupReader > (
new ReaderRegister < Type > ( ) ) );
82 static void unregisterStringWriter (
const std::string & type,
const std::string & typeName );
84 template <
class Type >
89 static void registerStringWriter ( std::string type,
const std::string & typeName, std::unique_ptr < GroupWriter > entry );
91 template <
class Type >
virtual object::Object parse(ext::istream &input)=0
virtual ~GroupReader()=default
virtual ~GroupWriter()=default
virtual void compose(ext::ostream &output, const object::Object &group)=0
Class extending the list class from the standard library. Original reason is to allow printing of the...
Definition: list.hpp:44
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
Represents an adaptor of any type to a class in type hierarchy of objects in the algorithms library.
Definition: AnyObject.h:37
const AnyObjectBase & getData() const
Definition: Object.h:142
Definition: normalize.hpp:10
std::string to_string(const T &value)
To string method designated for objects that can be casted to string.
Definition: string.hpp:131
Definition: AnyObject.h:28
static ext::list< std::pair< std::function< bool(ext::istream &)>, std::unique_ptr< GroupReader > > >::const_iterator registerStringReader()
Definition: stringApi.hpp:78
static void unregisterStringWriter()
Definition: stringApi.hpp:85
static void registerStringWriter()
Definition: stringApi.hpp:92
Definition: stringApi.hpp:26