gr-baz Package
gr::baz::file_source Class Referenceabstract

Read stream from file. More...

#include <baz_file_source.h>

Inheritance diagram for gr::baz::file_source:

Public Types

typedef boost::shared_ptr< file_sourcesptr
 

Public Member Functions

virtual bool seek (long seek_point)=0
 seek file to seek_point relative to whence
 
virtual bool seek (long seek_point, int whence)=0
 
virtual void open (const char *filename, bool repeat=false, long offset=0, const char *timing_filename=NULL, bool pad=false, double rate=0.0, bool auto_load=true, const std::vector< std::string > &files=std::vector< std::string >())=0
 Opens a new file.
 
virtual void close ()=0
 Close the file handle.
 
virtual size_t offset ()=0
 
virtual size_t file_offset ()=0
 
virtual double time (bool relative=false, bool raw=false)=0
 
virtual double sample_rate ()=0
 
virtual double sample_count (bool raw=false)=0
 
virtual double duration ()=0
 
virtual size_t file_index ()=0
 
virtual std::string file_path ()=0
 
virtual std::vector< std::string > files ()=0
 

Static Public Member Functions

static sptr make (size_t itemsize, const char *filename, bool repeat=false, long offset=0, const char *timing_filename=NULL, bool pad=false, double rate=0.0, bool auto_load=true, const std::vector< std::string > &files=std::vector< std::string >())
 Create a file source.
 

Detailed Description

Read stream from file.

Member Typedef Documentation

◆ sptr

typedef boost::shared_ptr<file_source> gr::baz::file_source::sptr

Member Function Documentation

◆ close()

virtual void gr::baz::file_source::close ( )
pure virtual

Close the file handle.

◆ duration()

virtual double gr::baz::file_source::duration ( )
pure virtual

◆ file_index()

virtual size_t gr::baz::file_source::file_index ( )
pure virtual

◆ file_offset()

virtual size_t gr::baz::file_source::file_offset ( )
pure virtual

◆ file_path()

virtual std::string gr::baz::file_source::file_path ( )
pure virtual

◆ files()

virtual std::vector< std::string > gr::baz::file_source::files ( )
pure virtual

◆ make()

static sptr gr::baz::file_source::make ( size_t  itemsize,
const char *  filename,
bool  repeat = false,
long  offset = 0,
const char *  timing_filename = NULL,
bool  pad = false,
double  rate = 0.0,
bool  auto_load = true,
const std::vector< std::string > &  files = std::vector< std::string >() 
)
static

Create a file source.

Opens filename as a source of items into a flowgraph. The data is expected to be in binary format, item after item. The itemsize of the block determines the conversion from bits to items.

If repeat is turned on, the file will repeat the file after it's reached the end.

Parameters
itemsizethe size of each item in the file, in bytes
filenamename of the file to source from
repeatrepeat file from start

◆ offset()

virtual size_t gr::baz::file_source::offset ( )
pure virtual

◆ open()

virtual void gr::baz::file_source::open ( const char *  filename,
bool  repeat = false,
long  offset = 0,
const char *  timing_filename = NULL,
bool  pad = false,
double  rate = 0.0,
bool  auto_load = true,
const std::vector< std::string > &  files = std::vector< std::string >() 
)
pure virtual

Opens a new file.

Parameters
filenamename of the file to source from
repeatrepeat file from start

◆ sample_count()

virtual double gr::baz::file_source::sample_count ( bool  raw = false)
pure virtual

◆ sample_rate()

virtual double gr::baz::file_source::sample_rate ( )
pure virtual

◆ seek() [1/2]

virtual bool gr::baz::file_source::seek ( long  seek_point)
pure virtual

seek file to seek_point relative to whence

Parameters
seek_pointsample offset in file
whenceone of SEEK_SET, SEEK_CUR, SEEK_END (man fseek)

◆ seek() [2/2]

virtual bool gr::baz::file_source::seek ( long  seek_point,
int  whence 
)
pure virtual

◆ time()

virtual double gr::baz::file_source::time ( bool  relative = false,
bool  raw = false 
)
pure virtual

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