3#ifndef SWIG__COMMON__NDS_PARAMS_HH
4#define SWIG__COMMON__NDS_PARAMS_HH
8#include <unordered_map>
11#include "nds_gap_handler.hh"
12#include "nds_connection.hh"
23 bool str_to_bool(
const std::string& input,
bool& dest );
25 struct param_gap_handler
28 std::unique_ptr< gap_handler > handler;
31 : name(
"ABORT_HANDLER" ),
33 NDS::detail::make_unique< detail::abort_gap_handler >( ) )
36 param_gap_handler( std::string handler_name,
37 std::unique_ptr< gap_handler > handler_ptr )
38 : name( std::move( handler_name ) ),
39 handler( std::move( handler_ptr ) )
42 param_gap_handler(
const param_gap_handler& other )
43 : name( other.name ), handler( other.handler->clone( ) )
46 param_gap_handler( param_gap_handler&& other ) =
default;
48 operator=(
const param_gap_handler& other )
52 std::unique_ptr< gap_handler > tmp(
53 other.handler->clone( ) );
55 handler = std::move( tmp );
59 param_gap_handler& operator=( param_gap_handler&& other ) =
default;
60 ~param_gap_handler( ) =
default;
63 struct param_net_conn_info
69 param_net_conn_info( )
70 : hostname(
"localhost" ),
71 port(
NDS::connection::DEFAULT_PORT ),
72 protocol(
NDS::connection::PROTOCOL_TRY )
75 param_net_conn_info( NDS::connection::host_type Hostname,
76 NDS::connection::port_type Port,
77 NDS::connection::protocol_type Protocol )
78 : hostname( std::move( Hostname ) ), port( Port ),
82 param_net_conn_info(
const param_net_conn_info& other ) =
default;
83 param_net_conn_info( param_net_conn_info&& other )
noexcept =
87 operator=(
const param_net_conn_info& other ) =
default;
89 operator=( param_net_conn_info&& other ) =
delete;
101 explicit parameter_block(
const param_net_conn_info& conn_info );
103 parameter_block(
const parameter_block& other ) =
default;
104 parameter_block( parameter_block&& other ) =
default;
107 operator=(
const parameter_block& other ) =
default;
109 operator=( parameter_block&& other )
noexcept =
delete;
113 std::string get(
const std::string& parameter )
const;
119 bool set(
const std::string& parameter,
const std::string& value );
125 std::vector< std::string > parameters( )
const;
129 std::string env_prefix( )
const;
133 max_nds1_command_count( )
const
135 return _max_nds1_command_count;
140 allow_data_on_tape( )
const
142 return _allow_data_on_tape;
146 std::unique_ptr< NDS::detail::gap_handler >
149 return _gap_handler.handler->clone( );
154 iterate_uses_gap_handler( )
const
156 return _iterate_uses_gap_handler;
159 param_net_conn_info& conn_info( );
161 const param_net_conn_info& conn_info( )
const;
164 int _max_nds1_command_count;
165 bool _allow_data_on_tape;
166 bool _iterate_uses_gap_handler;
167 param_gap_handler _gap_handler;
168 param_net_conn_info _net_conn_info;
170 bool set_gap_handler(
const std::string& handler_str );
177 class parameter_accessor
184 parameter_accessor(
const parameter_accessor& other ) =
default;
185 parameter_accessor( parameter_accessor&& other ) =
delete;
190 return *( params_.p_ );
protocol_type
Connection constants.
Definition nds_connection.hh:605
int port_type
Host port number type.
Definition nds_connection.hh:613
std::string host_type
Host name type.
Definition nds_connection.hh:612
The parameters class holds the configuration for a connection. This includes gap handling strategy an...
Definition nds_connection.hh:930
The NDS client namespace.
Definition debug_stream.cc:18