Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
ObjectsMultimap.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <alib/multimap>
9#include <core/xmlApi.hpp>
11
12namespace core {
13
14template < typename T, typename R >
15struct xmlApi < ext::multimap < T, R > > {
17 static bool first ( const ext::deque < sax::Token >::const_iterator & input );
18 static std::string xmlTagName ( );
19 static void compose ( ext::deque < sax::Token > & output, const ext::multimap < T, R > & input );
20};
21
22template < typename T, typename R >
25
27
29 multimap.insert ( core::xmlApi < ext::pair < T, R > >::parse ( input ) );
30
32 return multimap;
33}
34
35template < typename T, typename R >
38}
39
40template < typename T, typename R >
41std::string xmlApi < ext::multimap < T, R > >::xmlTagName ( ) {
42 return "Multimap";
43}
44
45template < typename T, typename R >
47 output.emplace_back ( xmlTagName ( ), sax::Token::TokenType::START_ELEMENT );
48
49 for ( const std::pair < const T, R > & item : input )
50 core::xmlApi < std::pair < const T, R > >::compose ( output, item );
51
52 output.emplace_back ( xmlTagName ( ), sax::Token::TokenType::END_ELEMENT );
53}
54
55} /* namespace core */
56
Class extending the deque class from the standard library. Original reason is to allow printing of th...
Definition: deque.hpp:44
Class extending the multimap class from the standard library. Original reason is to allow printing of...
Definition: multimap.hpp:48
iterator insert(const T &key, const R &value)
Insert variant with explicit key and value parameters.
Definition: multimap.hpp:118
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
static void popToken(ext::deque< Token >::iterator &input, Token::TokenType type, const std::string &data)
Definition: FromXMLParserHelper.cpp:39
static bool isToken(ext::deque< Token >::const_iterator input, Token::TokenType type, const std::string &data)
Definition: FromXMLParserHelper.cpp:29
static bool isTokenType(ext::deque< Token >::const_iterator input, Token::TokenType type)
Definition: FromXMLParserHelper.cpp:34
Definition: normalize.hpp:10
Definition: sigHandler.cpp:20
Definition: xmlApi.hpp:27