nds2-client - ClientDeveloper
0.16.8
|
#include <nds_connection_ptype.hh>
Public Types | |
enum | iterate_finalize_reason { iterate_finalize_reason::FINISHED, iterate_finalize_reason::ABORTED } |
typedef channel::channel_type | channel_type |
typedef channel::data_type | data_type |
typedef channel::sample_rate_type | sample_rate_type |
typedef std::map< std::string, daq_channel_t > | channel_mem_cache_type |
typedef NDS::detail::channel_cache_nds1 | channel_cache_type |
typedef long | time_type |
typedef nds_socket_type | socket_t |
Public Member Functions | |
DLL_EXPORT | conn_p_type (const NDS::parameters ¶ms) |
DLL_EXPORT | ~conn_p_type () |
void | connect () |
availability_list_type | get_availability (const epoch &time_span, const connection::channel_names_type &channel_names) |
availability_list_type | get_availability (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const connection::channel_names_type &channel_names) |
bool | check (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const connection::channel_names_type &channel_names) |
bool | has_gaps (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const connection::channel_names_type &channel_names) |
buffers_type | fetch (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const connection::channel_names_type &channel_names, channels_type *reference_channels=nullptr) |
size_t | count_channels_nds1 (std::string channel_glob, channel_type channel_type_mask=channel::DEFAULT_CHANNEL_MASK, data_type data_type_mask=channel::DEFAULT_DATA_MASK, sample_rate_type min_sample_rate=channel::MIN_SAMPLE_RATE, sample_rate_type max_sample_rate=channel::MAX_SAMPLE_RATE) |
size_t | count_channels_nds2 (std::string channel_glob, channel_type channel_type_mask=channel::DEFAULT_CHANNEL_MASK, data_type data_type_mask=channel::DEFAULT_DATA_MASK, sample_rate_type min_sample_rate=channel::MIN_SAMPLE_RATE, sample_rate_type max_sample_rate=channel::MAX_SAMPLE_RATE) |
size_t | count_channels (std::string channel_glob, channel_type channel_type_mask=channel::DEFAULT_CHANNEL_MASK, data_type data_type_mask=channel::DEFAULT_DATA_MASK, sample_rate_type min_sample_rate=channel::MIN_SAMPLE_RATE, sample_rate_type max_sample_rate=channel::MAX_SAMPLE_RATE) |
void | find_channels (channels_type &output, const NDS::channel_predicate_object &pred) |
void | find_channels_nds1 (channels_type &output, std::string channel_glob, channel_type channel_type_mask=channel::DEFAULT_CHANNEL_MASK, data_type data_type_mask=channel::DEFAULT_DATA_MASK, sample_rate_type min_sample_rate=channel::MIN_SAMPLE_RATE, sample_rate_type max_sample_rate=channel::MAX_SAMPLE_RATE) |
void | find_channels_nds2 (channels_type &output, std::string channel_glob, channel_type channel_type_mask=channel::DEFAULT_CHANNEL_MASK, data_type data_type_mask=channel::DEFAULT_DATA_MASK, sample_rate_type min_sample_rate=channel::MIN_SAMPLE_RATE, sample_rate_type max_sample_rate=channel::MAX_SAMPLE_RATE) |
epochs_type | get_epochs () |
bool | set_epoch_if_changed (const epoch &time_span) |
bool | set_epoch (const std::string &epoch_name) |
bool | set_epoch (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop) |
epoch | current_epoch () const |
const channel::hash_type & | hash () const |
std::shared_ptr < detail::iterate_handler > | dispatch_iterate (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, buffer::gps_second_type stride, const connection::channel_names_type &channel_names) |
void | issue_iterate (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, buffer::gps_second_type stride, const connection::channel_names_type &channel_names, std::vector< NDS::channel > *final_channel_list=nullptr) |
void | finalize_iterate (detail::iterate_handler *handler, iterate_finalize_reason reason) |
void | next_raw_buffer (buffers_type &output) |
void | shutdown () |
void | fill_gap (data_type DataType, channel::size_type DataSizeType, unsigned char *start, unsigned char *end) |
time_type | request_start_time () const |
void | request_start_time (time_type Value) |
time_type | request_end_time () const |
void | request_end_time (time_type Value) |
bool | request_in_progress () const |
void | request_in_progress (bool Value) |
NDS::buffer::gps_second_type | calculate_stride (NDS::buffer::gps_second_type gps_start, NDS::buffer::gps_second_type gps_stop, NDS::channels_type &selected_channels) const |
void | termination_block () |
NDS::buffer::gps_second_type | cur_nds1_gpstime () |
void | validate () const |
void | validate_daq (int RetCode) const |
void | infer_daq_channel_info (const std::string &channel_name, daq_channel_t &channel, time_type gps) |
void | channel_mask_to_query_type_strings (channel_type channel_type_mask, std::vector< std::string > &queryTypes) |
Given a channel_type mask convert it into a vector of nds2 type strings. More... | |
std::string | get_last_message () const throw ( ) |
std::string | err_msg_unexpected_no_data_found (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const channel::channel_names_type &names) |
void | plan_fetches (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const connection::channel_names_type &channel_names, buffers_type &dest_buffers, request_fragments_type &retval) |
void | sync_parameters () |
void | cycle_nds1_connection () |
Public Attributes | |
connection::host_type | host |
connection::port_type | port |
connection::protocol_type | protocol |
daq_t | handle |
daq_accessor | accesor_ |
bool | connected |
channel_cache_type | channel_cache_ |
channel_mem_cache_type | channel_mem_cache_ |
time_type | request_start_time_ |
time_type | request_end_time_ |
bool | request_in_progress_ |
NDS::parameters | parameters_ |
Protected Member Functions | |
epoch | resolve_epoch (const std::string &epoch_name) |
void | setup_daq_chanlist (buffer::gps_second_type gps_start, const connection::channel_names_type &channel_names, bool &have_minute_trends, double &bytes_per_sample, std::vector< NDS::channel > *final_channel_list=nullptr) |
void | process_check_data_result (int result, bool gaps_ok) |
void | fetch_fragment (request_fragment &fragment, const buffer_initializer &initializer, bool buffers_initialized) |
std::vector< buffers_type > | fetch_available (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const connection::channel_names_type &channel_names) |
void | load_epochs_to_cache () |
channel | _parse_nds2_get_channel_line (char *buffer) |
bool | _read_uint4 (socket_t fd, uint4_type *dest) |
bool | _read_buffer (socket_t fd, void *dest, size_t size) |
template<typename Filter , typename Function > | |
void | retreive_channels_from_nds2 (const std::vector< std::string > &types, const std::string &channel_glob, Filter &filt, Function &fn) |
std::shared_ptr < detail::iterate_handler > | iterate_simple_gaps (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, buffer::gps_second_type stride, const connection::channel_names_type &channel_names) |
std::shared_ptr < detail::iterate_handler > | iterate_fast (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, buffer::gps_second_type stride, const connection::channel_names_type &channel_names) |
std::shared_ptr < detail::iterate_handler > | iterate_available (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, buffer::gps_second_type stride, const connection::channel_names_type &channel_names) |
std::shared_ptr < detail::iterate_handler > | iterate_full (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, buffer::gps_second_type stride, const connection::channel_names_type &channel_names) |
Protected Attributes | |
std::weak_ptr < detail::iterate_handler > | iterate_handler_ |
epochs_type | epoch_cache_ |
epoch | current_epoch_ |
channel::hash_type | hash_ |
Static Private Attributes | |
static bool | initialized = false |
typedef std::map< std::string, daq_channel_t > NDS::detail::conn_p_type::channel_mem_cache_type |
typedef channel::channel_type NDS::detail::conn_p_type::channel_type |
typedef channel::data_type NDS::detail::conn_p_type::data_type |
typedef channel::sample_rate_type NDS::detail::conn_p_type::sample_rate_type |
typedef long NDS::detail::conn_p_type::time_type |
|
explicit |
NDS::detail::conn_p_type::~conn_p_type | ( | ) |
|
protected |
|
protected |
|
protected |
NDS::buffer::gps_second_type NDS::detail::conn_p_type::calculate_stride | ( | NDS::buffer::gps_second_type | gps_start, |
NDS::buffer::gps_second_type | gps_stop, | ||
NDS::channels_type & | selected_channels | ||
) | const |
Given a [start,stop) range and a channel list, determine a good stride value to use
gps_start | Start time inclusive |
gps_stop | Stop time exclusive |
selected_channels | List of channels |
void NDS::detail::conn_p_type::channel_mask_to_query_type_strings | ( | channel::channel_type | channel_type_mask, |
std::vector< std::string > & | queryTypes | ||
) |
Given a channel_type mask convert it into a vector of nds2 type strings.
[in] | channel_type_mask | The type mask |
[out] | queryTypes | The vector of strings to hold the list. On success its contents are replaced. |
bool NDS::detail::conn_p_type::check | ( | buffer::gps_second_type | gps_start, |
buffer::gps_second_type | gps_stop, | ||
const connection::channel_names_type & | channel_names | ||
) |
void NDS::detail::conn_p_type::connect | ( | ) |
|
inline |
connection::count_type NDS::detail::conn_p_type::count_channels_nds1 | ( | std::string | channel_glob, |
channel::channel_type | channel_type_mask = channel::DEFAULT_CHANNEL_MASK , |
||
channel::data_type | data_type_mask = channel::DEFAULT_DATA_MASK , |
||
channel::sample_rate_type | min_sample_rate = channel::MIN_SAMPLE_RATE , |
||
channel::sample_rate_type | max_sample_rate = channel::MAX_SAMPLE_RATE |
||
) |
connection::count_type NDS::detail::conn_p_type::count_channels_nds2 | ( | std::string | channel_glob, |
channel::channel_type | channel_type_mask = channel::DEFAULT_CHANNEL_MASK , |
||
channel::data_type | data_type_mask = channel::DEFAULT_DATA_MASK , |
||
channel::sample_rate_type | min_sample_rate = channel::MIN_SAMPLE_RATE , |
||
channel::sample_rate_type | max_sample_rate = channel::MAX_SAMPLE_RATE |
||
) |
NDS::buffer::gps_second_type NDS::detail::conn_p_type::cur_nds1_gpstime | ( | ) |
epoch NDS::detail::conn_p_type::current_epoch | ( | ) | const |
void NDS::detail::conn_p_type::cycle_nds1_connection | ( | ) |
std::shared_ptr< detail::iterate_handler > NDS::detail::conn_p_type::dispatch_iterate | ( | buffer::gps_second_type | gps_start, |
buffer::gps_second_type | gps_stop, | ||
buffer::gps_second_type | stride, | ||
const connection::channel_names_type & | channel_names | ||
) |
std::string NDS::detail::conn_p_type::err_msg_unexpected_no_data_found | ( | buffer::gps_second_type | gps_start, |
buffer::gps_second_type | gps_stop, | ||
const channel::channel_names_type & | names | ||
) |
buffers_type NDS::detail::conn_p_type::fetch | ( | buffer::gps_second_type | gps_start, |
buffer::gps_second_type | gps_stop, | ||
const connection::channel_names_type & | channel_names, | ||
channels_type * | reference_channels = nullptr |
||
) |
|
protected |
internal implementation of the fetch command. This should only be called by the fetch method.
|
protected |
void NDS::detail::conn_p_type::fill_gap | ( | channel::data_type | DataType, |
channel::size_type | DataSizeType, | ||
unsigned char * | start, | ||
unsigned char * | end | ||
) |
void NDS::detail::conn_p_type::finalize_iterate | ( | detail::iterate_handler * | handler, |
iterate_finalize_reason | reason | ||
) |
void NDS::detail::conn_p_type::find_channels | ( | channels_type & | output, |
const NDS::channel_predicate_object & | pred | ||
) |
void NDS::detail::conn_p_type::find_channels_nds1 | ( | channels_type & | output, |
std::string | channel_glob, | ||
channel::channel_type | channel_type_mask = channel::DEFAULT_CHANNEL_MASK , |
||
channel::data_type | data_type_mask = channel::DEFAULT_DATA_MASK , |
||
channel::sample_rate_type | min_sample_rate = channel::MIN_SAMPLE_RATE , |
||
channel::sample_rate_type | max_sample_rate = channel::MAX_SAMPLE_RATE |
||
) |
void NDS::detail::conn_p_type::find_channels_nds2 | ( | channels_type & | output, |
std::string | channel_glob, | ||
channel::channel_type | channel_type_mask = channel::DEFAULT_CHANNEL_MASK , |
||
channel::data_type | data_type_mask = channel::DEFAULT_DATA_MASK , |
||
channel::sample_rate_type | min_sample_rate = channel::MIN_SAMPLE_RATE , |
||
channel::sample_rate_type | max_sample_rate = channel::MAX_SAMPLE_RATE |
||
) |
availability_list_type NDS::detail::conn_p_type::get_availability | ( | const epoch & | time_span, |
const connection::channel_names_type & | channel_names | ||
) |
availability_list_type NDS::detail::conn_p_type::get_availability | ( | buffer::gps_second_type | gps_start, |
buffer::gps_second_type | gps_stop, | ||
const connection::channel_names_type & | channel_names | ||
) |
epochs_type NDS::detail::conn_p_type::get_epochs | ( | ) |
std::string NDS::detail::conn_p_type::get_last_message | ( | ) | const | |
throw | ( | |||
) |
bool NDS::detail::conn_p_type::has_gaps | ( | buffer::gps_second_type | gps_start, |
buffer::gps_second_type | gps_stop, | ||
const connection::channel_names_type & | channel_names | ||
) |
const channel::hash_type & NDS::detail::conn_p_type::hash | ( | ) | const |
void NDS::detail::conn_p_type::infer_daq_channel_info | ( | const std::string & | channel_name, |
daq_channel_t & | channel, | ||
time_type | gps | ||
) |
void NDS::detail::conn_p_type::issue_iterate | ( | buffer::gps_second_type | gps_start, |
buffer::gps_second_type | gps_stop, | ||
buffer::gps_second_type | stride, | ||
const connection::channel_names_type & | channel_names, | ||
std::vector< NDS::channel > * | final_channel_list = nullptr |
||
) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
void NDS::detail::conn_p_type::next_raw_buffer | ( | buffers_type & | output | ) |
void NDS::detail::conn_p_type::plan_fetches | ( | buffer::gps_second_type | gps_start, |
buffer::gps_second_type | gps_stop, | ||
const connection::channel_names_type & | channel_names, | ||
buffers_type & | dest_buffers, | ||
request_fragments_type & | retval | ||
) |
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
bool NDS::detail::conn_p_type::set_epoch | ( | const std::string & | epoch_name | ) |
bool NDS::detail::conn_p_type::set_epoch | ( | buffer::gps_second_type | gps_start, |
buffer::gps_second_type | gps_stop | ||
) |
bool NDS::detail::conn_p_type::set_epoch_if_changed | ( | const epoch & | time_span | ) |
|
protected |
void NDS::detail::conn_p_type::shutdown | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
daq_accessor NDS::detail::conn_p_type::accesor_ |
channel_cache_type NDS::detail::conn_p_type::channel_cache_ |
channel_mem_cache_type NDS::detail::conn_p_type::channel_mem_cache_ |
bool NDS::detail::conn_p_type::connected |
|
protected |
|
protected |
daq_t NDS::detail::conn_p_type::handle |
|
protected |
connection::host_type NDS::detail::conn_p_type::host |
|
staticprivate |
|
protected |
NDS::parameters NDS::detail::conn_p_type::parameters_ |
connection::port_type NDS::detail::conn_p_type::port |
connection::protocol_type NDS::detail::conn_p_type::protocol |
time_type NDS::detail::conn_p_type::request_end_time_ |
bool NDS::detail::conn_p_type::request_in_progress_ |
time_type NDS::detail::conn_p_type::request_start_time_ |