include/relpipe/reader/RelationalReader.h
author František Kučera <franta-hg@frantovo.cz>
Sat, 30 Mar 2019 16:14:40 +0100
branchv_0
changeset 38 7ae5c79af5d0
parent 30 ef99f5a6c9f6
child 42 3442e0d6caec
permissions -rw-r--r--
fix typo: Hadler → Handler
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
     1
/**
30
ef99f5a6c9f6 license of protocol, reader and writer: GNU LGPLv3+ or GNU GPLv2+
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
     2
 * Relational pipes (library)
29
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
     3
 * Copyright © 2018 František Kučera (Frantovo.cz, GlobalCode.info)
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
     4
 *
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
30
ef99f5a6c9f6 license of protocol, reader and writer: GNU LGPLv3+ or GNU GPLv2+
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
     6
 * it under the terms of the:
ef99f5a6c9f6 license of protocol, reader and writer: GNU LGPLv3+ or GNU GPLv2+
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
     7
 *  - GNU Lesser General Public License as published by the Free Software Foundation;
ef99f5a6c9f6 license of protocol, reader and writer: GNU LGPLv3+ or GNU GPLv2+
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
     8
 *    either version 3 of the License, or (at your option) any later version;
ef99f5a6c9f6 license of protocol, reader and writer: GNU LGPLv3+ or GNU GPLv2+
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
     9
 *    or (at your option)
ef99f5a6c9f6 license of protocol, reader and writer: GNU LGPLv3+ or GNU GPLv2+
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    10
 *  - GNU General Public License as published by the Free Software Foundation;
ef99f5a6c9f6 license of protocol, reader and writer: GNU LGPLv3+ or GNU GPLv2+
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    11
 *    either version 2 of the License, or (at your option) any later version.
29
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    12
 *
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    13
 * This program is distributed in the hope that it will be useful,
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    16
 * GNU General Public License for more details.
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    17
 *
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    18
 * You should have received a copy of the GNU General Public License
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    19
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
755978b0935c license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    20
 */
14
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
#pragma once
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
#include <iostream>
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
#include "typedefs.h"
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
#include "TypeId.h"
17
ec750c536705 interface + dummy implementation
František Kučera <franta-hg@frantovo.cz>
parents: 14
diff changeset
    27
#include "handlers/RelationalReaderBaseHandler.h"
ec750c536705 interface + dummy implementation
František Kučera <franta-hg@frantovo.cz>
parents: 14
diff changeset
    28
#include "handlers/RelationalReaderStringHandler.h"
ec750c536705 interface + dummy implementation
František Kučera <franta-hg@frantovo.cz>
parents: 14
diff changeset
    29
#include "handlers/RelationalReaderValueHandler.h"
14
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
namespace relpipe {
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
namespace reader {
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
class RelationalReader {
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
public:
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
	virtual ~RelationalReader() = default;
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
	/**
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
	 * @param typeId numeric type id as defined in Specification
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
	 * @return string code of given type
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
	 * @throws RelpipeReaderException on unsupported typeId
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
	 */
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
	virtual string_t toTypeCode(const TypeId typeId) = 0;
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
38
7ae5c79af5d0 fix typo: Hadler → Handler
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    46
	virtual void addHandler(handlers::RelationalReaderStringHandler* handler) = 0;
17
ec750c536705 interface + dummy implementation
František Kučera <franta-hg@frantovo.cz>
parents: 14
diff changeset
    47
38
7ae5c79af5d0 fix typo: Hadler → Handler
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    48
	virtual void addHandler(handlers::RelationalReaderValueHandler* handler) = 0;
17
ec750c536705 interface + dummy implementation
František Kučera <franta-hg@frantovo.cz>
parents: 14
diff changeset
    49
	
ec750c536705 interface + dummy implementation
František Kučera <franta-hg@frantovo.cz>
parents: 14
diff changeset
    50
	virtual void process() = 0;
ec750c536705 interface + dummy implementation
František Kučera <franta-hg@frantovo.cz>
parents: 14
diff changeset
    51
14
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    52
};
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    53
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    54
}
e8de089f95dd refactoring, move files, use TypeId instead of integer_t
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    55
}