Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
ObjectsBitset.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <alib/bitset>
9#include <core/xmlApi.hpp>
10
11#include <primitive/xml/Bool.h>
12
13namespace core {
14
15template < size_t N >
16struct xmlApi < ext::bitset < N > > {
18 static bool first ( const ext::deque < sax::Token >::const_iterator & input );
19 static std::string xmlTagName ( );
20 static void compose ( ext::deque < sax::Token > & output, const ext::bitset < N > & input );
21};
22
23template < size_t N >
26
28
29 for ( size_t i = 0; i < N; ++i )
30 res [ i ] = core::xmlApi < bool >::parse ( input );
31
33
34 return res;
35}
36
37template < size_t N >
40}
41
42template < size_t N >
43std::string xmlApi < ext::bitset < N > >::xmlTagName ( ) {
44 return "Bitset";
45}
46
47template < size_t N >
48void xmlApi < ext::bitset < N > >::compose ( ext::deque < sax::Token > & output, const ext::bitset < N > & input ) {
49 output.emplace_back ( xmlTagName(), sax::Token::TokenType::START_ELEMENT );
50
51 for ( size_t i = 0; i < N; ++i )
52 core::xmlApi < bool >::compose ( output, input [ i ] );
53
54 output.emplace_back ( xmlTagName(), sax::Token::TokenType::END_ELEMENT );
55}
56
57} /* namespace core */
58
Class extending the bitset class from the standard library. Original reason is to allow printing of t...
Definition: bitset.hpp:42
Class extending the deque class from the standard library. Original reason is to allow printing of th...
Definition: deque.hpp:44
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
int i
Definition: AllEpsilonClosure.h:118
return res
Definition: MinimizeByPartitioning.h:145
Definition: normalize.hpp:10
Definition: sigHandler.cpp:20
Definition: xmlApi.hpp:27