Loads multiple parallel BitSeries data from multiple files. More...

#include <ParallelInput.h>

Inheritance diagram for dsp::ParallelInput:
dsp::Operation OwnStream Reference::Able Reference::HeapTracked dsp::DualFile dsp::SingleFile

Public Types

typedef ParallelBitSeries OutputType
 
typedef Registry::List< ParallelInputRegister
 typedef used to simplify template syntax in ParallelInput_registry.C
 
- Public Types inherited from dsp::Operation
enum  Function { Producer, Procedural, Structural }
 The function of the operator. More...
 

Public Member Functions

 ParallelInput (const char *name)
 Constructor.
 
virtual ~ParallelInput ()
 Destructor.
 
const Inputat (unsigned index) const
 Return the Input corresponding to the specified index.
 
Inputat (unsigned index)
 Return the Input corresponding to the specified index.
 
virtual bool matches (const std::string &descriptor) const =0
 Return true if descriptor describes data in the recognized format. More...
 
virtual void open (const std::string &descriptor)=0
 Open the inputs.
 
void operation ()
 Load the current ParallelBitSeries. More...
 
 operator const Observation * () const
 Get the information about the data source.
 
virtual Observationget_info ()
 Get the information about the data source.
 
virtual const Observationget_info () const
 Get the information about the data source.
 
virtual void set_output (ParallelBitSeries *)
 Set the ParallelBitSeries to which data will be loaded.
 
ParallelBitSeriesget_output ()
 Get the ParallelBitSeries to which data will be loaded.
 
virtual void prepare ()
 Prepare the output with the attributes of the data source.
 
virtual void reserve ()
 Reserve the maximum amount of output space required.
 
virtual void reserve (ParallelBitSeries *)
 Reserve the maximum amount of space required in the given container.
 
virtual bool eod () const
 End of data.
 
void restart ()
 Return to the start of data, if possible.
 
virtual void load (ParallelBitSeries *)
 Load BitSeries data. More...
 
virtual void seek (int64_t offset, int whence=0)
 Seek to the specified time sample.
 
uint64_t tell () const
 Return the first time sample to be read on the next call to operate.
 
virtual void seek (const MJD &mjd)
 Seek to a sample close to the specified MJD.
 
double tell_seconds () const
 Convenience method used to report the offset in seconds.
 
void set_start_seconds (double seconds)
 Set the start of observation offset in units of seconds.
 
void set_total_seconds (double seconds)
 Convenience method used to set the number of seconds.
 
virtual uint64_t get_block_size () const =0
 Return the number of time samples to load on each load_block.
 
virtual void set_block_size (uint64_t _size)=0
 Set the number of time samples to load on each load_block.
 
virtual uint64_t get_overlap () const =0
 Return the number of time samples by which consecutive blocks overlap.
 
virtual void set_overlap (uint64_t _overlap)=0
 Set the number of time samples by which consecutive blocks overlap.
 
virtual unsigned get_resolution () const =0
 Get the time sample resolution of the data source.
 
uint64_t bytes_storage () const override
 The number of bytes of additional storage used by the operation.
 
uint64_t bytes_scratch () const override
 The number of bytes of scratch space used by the operation.
 
virtual void set_context (ThreadContext *_context)
 In multi-threaded programs, a mutual exclusion and a condition.
 
bool has_context () const
 
ThreadContextget_context ()
 
- Public Member Functions inherited from dsp::Operation
 Operation (const char *name)
 All sub-classes must specify a unique name. More...
 
 Operation (const Operation &)
 Copy constructor.
 
virtual ~Operation ()
 Virtual destructor.
 
virtual bool operate ()
 Call this method to operate on data Returns false on failure. More...
 
virtual void add_extensions (Extensions *)
 Add any extensions.
 
virtual void combine (const Operation *)
 Combine accumulated results with another operation. More...
 
virtual void report () const
 Report operation statistics.
 
virtual void reset ()
 Reset accumulated results to intial values. More...
 
std::string get_name () const
 Return the unique name of this operation.
 
double get_total_time () const
 Return the total time spent on this Operation in seconds.
 
double get_elapsed_time () const
 Get the time spent in the last invocation of operate()
 
virtual uint64_t get_total_weights () const
 Return the total number of timesample weights encountered. More...
 
virtual uint64_t get_discarded_weights () const
 Return the number of invalid timesample weights encountered.
 
int get_id ()
 Inquire the unique instantiation id.
 
virtual Function get_function () const
 Get the function classification of this operation.
 
virtual double get_delay_time () const
 Get the time delay of this operation, if any, in seconds.
 
virtual void set_scratch (Scratch *)
 Set the scratch space.
 
bool scratch_was_set () const
 
- Public Member Functions inherited from OwnStream
 OwnStream (const OwnStream &)
 
const OwnStreamoperator= (const OwnStream &)
 
virtual void set_cout (std::ostream &) const
 
virtual void set_cerr (std::ostream &) const
 
- Public Member Functions inherited from Reference::Able
 Able (const Able &)
 
Ableoperator= (const Able &)
 
unsigned get_reference_count () const
 
- Public Member Functions inherited from Reference::HeapTracked
 HeapTracked (const HeapTracked &)
 
HeapTrackedoperator= (const HeapTracked &)
 
bool __is_on_heap () const
 

Static Public Member Functions

static ParallelInputcreate (const std::string &descriptor)
 Return a pointer to a new instance of the appropriate sub-class. More...
 
static Registerget_register ()
 Return the list of registered sub-classes.
 
- Static Public Member Functions inherited from Reference::Able
static size_t get_instance_count ()
 
- Static Public Member Functions inherited from Reference::HeapTracked
static void * operator new (size_t size, void *ptr=0)
 
static void operator delete (void *location, void *ptr)
 
static void operator delete (void *location)
 
static size_t get_heap_queue_size ()
 

Protected Attributes

Reference::To< Observationinfo
 Information about the data source (passed on to ParallelBitSeries in load)

 
std::vector< Reference::To< Input > > inputs
 Array of parallel Input objects.
 
Reference::To< ParallelBitSeriesoutput
 The output array of parallel BitSeries.
 
ThreadContextcontext {NULL}
 Thread coordination used in Input::load method.
 
- Protected Attributes inherited from dsp::Operation
Scratchscratch
 Shared scratch space, if needed.
 
bool set_scratch_called
 
std::string name
 Operation name.
 
uint64_t discarded_weights
 Number of time sample weights encountered that are flagged invalid.
 
uint64_t total_weights
 Total number of time sample weights encountered.
 
RealTimer optime
 Stop watch records the amount of time spent performing this operation.
 
int id
 Unique instantiation id.
 
bool prepared
 Set true when preparation optimizations are completed.
 

Additional Inherited Members

- Static Public Attributes inherited from dsp::Operation
static bool record_time = false
 Global flag enables stopwatch to record the time spent operating. More...
 
static bool report_time = true
 Global flag enables report of time spent in operation on descruction. More...
 
static bool verbose = false
 Global verbosity flag.
 
static int operation_status = 0
 Operations can set this to non-zero in operation() if they fail.
 
static bool check_state = true
 Operations should perform internal consistency checks.
 
static int instantiation_count = 0
 Counts how many Operation instantiations there have been Used for setting the unique instantiation ID. More...
 
- Protected Member Functions inherited from dsp::Operation
virtual bool can_operate ()
 Return false if the operation doesn't have enough data to proceed.
 
virtual void set_name (const std::string &_name)
 Set the name!
 
int timers_index (const std::string &op_name)
 Returns the index in the 'timers' array of a particular timer.
 
- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 
void __dereference (bool auto_delete=true) const
 

Detailed Description

Loads multiple parallel BitSeries data from multiple files.

Member Function Documentation

◆ create()

dsp::ParallelInput * dsp::ParallelInput::create ( const std::string &  descriptor)
static

Return a pointer to a new instance of the appropriate sub-class.

This is the entry point for creating new instances of ParallelInput objects.

References Registry::List< class >::create(), Error::get_message(), open(), and Registry::List< class >::size().

◆ load()

void dsp::ParallelInput::load ( ParallelBitSeries bitseries)
virtual

Load BitSeries data.

Only this load method is guaranteed to be thread safe

Reimplemented in dsp::DualFile, and dsp::SingleFile.

References dsp::ParallelBitSeries::at(), and dsp::ParallelBitSeries::resize().

Referenced by dsp::SingleFile::load(), and dsp::DualFile::load().

◆ matches()

virtual bool dsp::ParallelInput::matches ( const std::string &  descriptor) const
pure virtual

Return true if descriptor describes data in the recognized format.

Derived classes must define the conditions under which they can be used to parse the given descriptor

Implemented in dsp::DualFile, and dsp::SingleFile.

◆ operation()

void dsp::ParallelInput::operation ( )
virtual

Load the current ParallelBitSeries.

Load data into the ParallelBitSeries specified by set_output.

Implements dsp::Operation.


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

Generated using doxygen 1.8.17