src/Configuration.h
author František Kučera <franta-hg@frantovo.cz>
Fri, 29 Jul 2022 18:03:49 +0200
branchv_0
changeset 4 8d036e5e5fcc
parent 0 924e354948df
child 5 e57e2a2798b2
permissions -rw-r--r--
configuration: --connection-string --connection-option (role, mode)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * Relational pipes
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2022 František Kučera (Frantovo.cz, GlobalCode.info)
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
 * the Free Software Foundation, version 3 of the License.
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
#pragma once
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
#include <vector>
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
#include <iostream>
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
#include <relpipe/common/type/typedefs.h>
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
namespace relpipe {
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
namespace out {
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
namespace socket {
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
class Configuration {
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
public:
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
4
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    32
	class SocketOption {
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    33
	public:
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    34
		const relpipe::common::type::StringX name;
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    35
		const relpipe::common::type::StringX value;
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    36
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    37
		SocketOption(const relpipe::common::type::StringX name, const relpipe::common::type::StringX value) : name(name), value(value) {
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    38
		}
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    39
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    40
		virtual ~SocketOption() = default;
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    41
	};
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    42
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    43
0
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
	relpipe::common::type::StringX relation = L"socket";
4
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    45
	relpipe::common::type::StringX connectionString = L"udp://127.0.0.1:64000";
8d036e5e5fcc configuration: --connection-string --connection-option (role, mode)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    46
	std::vector<SocketOption> options;
0
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
	virtual ~Configuration() {
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
	}
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
};
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    52
}
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    53
}
924e354948df establish project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    54
}