Skip to content
Snippets Groups Projects
Commit 13814591 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

prepare stringApi for unregistration

parent 26fd045d
No related branches found
No related tags found
No related merge requests found
......@@ -75,8 +75,19 @@ private:
 
public:
template < class Type >
static void registerStringReader ( ) {
parseFunctions ( ).push_back ( std::make_pair ( stringApi < Type >::first, std::unique_ptr < GroupReader > ( new ReaderRegister < Type > ( ) ) ) );
static void unregisterStringReader ( ext::list < std::pair < std::function < bool ( std::istream & ) >, std::unique_ptr < GroupReader > > >::const_iterator iter ) {
parseFunctions ( ).erase ( iter );
}
template < class Type >
static ext::list < std::pair < std::function < bool ( std::istream & ) >, std::unique_ptr < GroupReader > > >::const_iterator registerStringReader ( ) {
auto & entries = parseFunctions ( );
return entries.insert ( entries.end ( ), std::make_pair ( stringApi < Type >::first, std::unique_ptr < GroupReader > ( new ReaderRegister < Type > ( ) ) ) );
}
template < class Type >
static void unregisterStringWriter ( ) {
composeFunctions ( ).erase ( ext::to_string < object::AnyObject < Type > > ( ) );
}
 
template < class Type >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment