nds2-client - ClientDeveloper  0.16.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
NDS::detail::conn_p_type Struct Reference

#include <nds_connection_ptype.hh>

Inheritance diagram for NDS::detail::conn_p_type:
Inheritance graph
[legend]
Collaboration diagram for NDS::detail::conn_p_type:
Collaboration graph
[legend]

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 &params)
 
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
 

Member Typedef Documentation

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

Member Enumeration Documentation

Enumerator
FINISHED 
ABORTED 

Constructor & Destructor Documentation

NDS::detail::conn_p_type::conn_p_type ( const NDS::parameters &  params)
explicit
NDS::detail::conn_p_type::~conn_p_type ( )

Member Function Documentation

channel NDS::detail::conn_p_type::_parse_nds2_get_channel_line ( char *  buffer)
protected
bool NDS::detail::conn_p_type::_read_buffer ( socket_t  fd,
void *  dest,
size_t  size 
)
protected
bool NDS::detail::conn_p_type::_read_uint4 ( socket_t  fd,
uint4_type dest 
)
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

Parameters
gps_startStart time inclusive
gps_stopStop time exclusive
selected_channelsList of channels
Returns
A stride that takes into account the presence of trends channels and likely frame file lengths
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.

Parameters
[in]channel_type_maskThe type mask
[out]queryTypesThe 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 ( )
size_t NDS::detail::conn_p_type::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 
)
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 ( )
Returns
The current time of the connected nds1 server
Note
raises an exception if not connected to an nds1 server
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 
)
std::vector< buffers_type > NDS::detail::conn_p_type::fetch_available ( buffer::gps_second_type  gps_start,
buffer::gps_second_type  gps_stop,
const connection::channel_names_type &  channel_names 
)
protected

internal implementation of the fetch command. This should only be called by the fetch method.

void NDS::detail::conn_p_type::fetch_fragment ( request_fragment fragment,
const buffer_initializer initializer,
bool  buffers_initialized 
)
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 
)
std::shared_ptr< detail::iterate_handler > NDS::detail::conn_p_type::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 
)
protected
std::shared_ptr< detail::iterate_handler > NDS::detail::conn_p_type::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 
)
protected
std::shared_ptr< detail::iterate_handler > NDS::detail::conn_p_type::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
std::shared_ptr< detail::iterate_handler > NDS::detail::conn_p_type::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 
)
protected
void NDS::detail::conn_p_type::load_epochs_to_cache ( )
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 
)
void NDS::detail::conn_p_type::process_check_data_result ( int  result,
bool  gaps_ok 
)
protected
time_type NDS::detail::conn_p_type::request_end_time ( ) const
inline
void NDS::detail::conn_p_type::request_end_time ( time_type  Value)
inline
bool NDS::detail::conn_p_type::request_in_progress ( ) const
inline
void NDS::detail::conn_p_type::request_in_progress ( bool  Value)
inline
time_type NDS::detail::conn_p_type::request_start_time ( ) const
inline
void NDS::detail::conn_p_type::request_start_time ( time_type  Value)
inline
epoch NDS::detail::conn_p_type::resolve_epoch ( const std::string &  epoch_name)
protected
template<typename Filter , typename Function >
void NDS::detail::conn_p_type::retreive_channels_from_nds2 ( const std::vector< std::string > &  types,
const std::string &  channel_glob,
Filter &  filt,
Function &  fn 
)
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)
void NDS::detail::conn_p_type::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 
)
protected
void NDS::detail::conn_p_type::shutdown ( )
void NDS::detail::conn_p_type::sync_parameters ( )
inline
void NDS::detail::conn_p_type::termination_block ( )
inline
void NDS::detail::conn_p_type::validate ( ) const
inline
void NDS::detail::conn_p_type::validate_daq ( int  RetCode) const
inline

Member Data Documentation

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
epoch NDS::detail::conn_p_type::current_epoch_
protected
epochs_type NDS::detail::conn_p_type::epoch_cache_
protected
daq_t NDS::detail::conn_p_type::handle
channel::hash_type NDS::detail::conn_p_type::hash_
protected
connection::host_type NDS::detail::conn_p_type::host
bool NDS::detail::conn_p_type::initialized = false
staticprivate
std::weak_ptr< detail::iterate_handler > NDS::detail::conn_p_type::iterate_handler_
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_

The documentation for this struct was generated from the following files: