PointFromTokensReader module

Module contents

template<typename PointT, typename SourceIterT>
class PointFromTokensReader : public tracktable::GenericReader<PointT>

Read points from lists of tokens.

PointFromTokensReader expects as its input an iterator that will yield iterator ranges. That is, each value of the iterator is a (begin, end) pair of iterators that will produce a set of tokens for one point.

Think of it with this common use case. Somewhere upstream you are reading lines from a text file. Your reader takes lines from the file and separates each line into a list of tokens using some delimiter. PointFromTokensReader takes each of those lists of tokens, one list at a time, and turns it into a point of some user-requested type.

Public Types

typedef PointT point_type
typedef SourceIterT source_iterator_type
typedef boost::shared_ptr<point_type> point_shared_ptr_type

Public Functions

PointFromTokensReader()
PointFromTokensReader(const PointFromTokensReader &other)
PointFromTokensReader(source_iterator_type const &start, source_iterator_type const &finish)
virtual ~PointFromTokensReader()
PointFromTokensReader &operator=(PointFromTokensReader const &other)
bool operator==(PointFromTokensReader const &other) const
bool operator!=(PointFromTokensReader const &other) const
void set_object_id_column(int column)
void set_timestamp_column(int column)
int object_id_column() const
int timestamp_column() const
void set_coordinate_column(int coordinate, int column)
void set_real_field_column(std::string const &field, int column)
void set_time_field_column(std::string const &field, int column)
void set_string_field_column(std::string const &field, int column)
int coordinate_column(int coordinate) const
int real_field_column(std::string const &field) const
int string_field_column(std::string const &field) const
int time_field_column(std::string const &field) const
bool has_coordinate_column(int coordinate) const
bool has_real_field_column(std::string const &field) const
bool has_string_field_column(std::string const &field) const
bool has_time_field_column(std::string const &field) const
void clear_coordinate_assignments()
void set_warnings_enabled(bool onoff)
bool warnings_enabled() const
bool ignore_header() const
void set_ignore_header(bool onoff)
void set_input_range(source_iterator_type my_begin, source_iterator_type my_end)
void set_timestamp_format(string_type const &format)
string_type timestamp_format() const
void set_null_value(string_type const &value)
string_type null_value() const
tracktable::IntIntMap &__coordinate_assignments()
void __set_coordinate_assignments(tracktable::IntIntMap const &cmap)

Protected Types

typedef io::detail::PropertyAssignmentMap PropertyAssignmentMap
typedef std::vector<settings::string_type> string_vector_type

Protected Functions

point_shared_ptr_type next_item()
void configure_reader_from_header(string_vector_type const &tokens)
void configure_coordinate_assignments(bool object_id_present, bool timestamp_present, std::size_t expected_dimension)
void configure_field_assignments(io::detail::PointHeader const &header, std::size_t first_property_column)
void get_tokens_from_input(string_vector_type &tokens)
void populate_coordinates_from_tokens(string_vector_type const &tokens, point_shared_ptr_type point)
void populate_properties_from_tokens(string_vector_type const &tokens, point_shared_ptr_type point)

Protected Attributes

IntIntMap CoordinateMap
PropertyAssignmentMap FieldMap
source_iterator_type SourceBegin
source_iterator_type SourceEnd
int ObjectIdColumn
int TimestampColumn
bool IgnoreHeader
bool WarningsEnabled
PropertyConverter PropertyReadWrite
int NumPoints
int NumParseErrors