Skip to content
smehringer edited this page Nov 26, 2018 · 6 revisions

Goal: The project will transport the journaled sequence functionality, the Journaled String Tree (JST) and the functionality to traverse the JST with context based streaming operators from SeqAn2 to SeqAn3.

Naming convention

  • journaled_range (:x: too unspecific)

  • journaled_view (:x: no member functions, :x: journaled sequence is not copyable in O(1))

  • journaled_modifier (:x: journaled sequence does not modify the underlying sequence)

  • journaled_sequence (:x: does not fulfill the sequence concept because it is no container, doesn't own its sequence)

  • journaled_adaptor (:x: does not just transform from A to B, but provides a representation)

  • πŸ₯‡ journal_decorator πŸ₯‡

File structure

  • seqan3/include/journaled_decorator/

  • seqan3/include/journaled_decorator/journal_entry.hpp

  • seqan3/include/journaled_decorator/journal_decorator.hpp

  • seqan3/include/journaled_decorator/journal_decorator_iterator.hpp

  • seqan3/test/journaled_decorator/

  • seqan3/test/journaled_decorator/journal_decorator_test.cpp

  • seqan3/test/journaled_decorator/journal_decorator_iterator_test.cpp

Discussion Notes

  • journal_decorator cannot fulfill the container_concept because a container must own all it's members but the reference is not owned
  • private raw pointer to const underlying range (no reference because it wouldn't be default constructable)
  • insertion buffer as vector of sequences.. same type as the reference?
  • Cannot fulfill the random access concept because constant time access cannot be ensured..

WP 1 - Journaled Decorator struct

  • WP 1.1 Port the journalEntry to seqan3 (change name conventions)
  • WP 1.2 [ journaled_decorator.hpp ] Define journaled_decorator class
  • WP 1.3 Implement and test basic functionality (See WP 1.3)
  • WP 1.3.0 Implement a Proxy Iterator (Needed for the JS iterator)
  • WP 1.4 Implement a bidirectional iterator for the JS (See WP 1.4)
  • WP 1.5 Functionality features (See WP 1.5)

WP 1.3 - Basic Functionality

  • [ TEST/IMPL ] types: value_type, reference, const_reference, iterator, const_iterator, difference_type, size_type
  • [ TEST/IMPL ] Construction: default{} and with the reference as a parameter, copy/move{val}, assignment=, iterator+copy{val.begin(), val.end()},
  • [ TEST/IMPL ] Member function assign(val2) assign(val2.begin(), val2.end())
  • [ TEST/IMPL ] Member functions begin(), cbegin(), end(), cend()
  • [ TEST/IMPL ] Member function front() and back()
  • [ TEST/IMPL ] comparator operations '==' and '!='
  • [ TEST/IMPL ] Function swap(val1, val2) and member function swap(val)
  • [ TEST/IMPL ] Member functions size()
  • [ TEST/IMPL ] Member function empty()
  • [ TEST/IMPL ] Member function clear() Support initializer list?

WP 1.4 - bidirectional iterator

See old implementation of the JS iterator (https://github.com/seqan/seqan/blob/master/include/seqan/sequence_journaled/sequence_journaled_iterator.h) and adapt semantic to the new requirements

  • [ TEST - journaled_string_iterator_test.cpp ] Simply adapt the generic test for the journaled strings (https://github.com/seqan/seqan3/blob/master/test/range/detail/random_access_iterator_test.cpp)
  • [ IMPL - journaled_string_iterator.hpp ] Adapt typedefs
  • [ IMPL - journaled_string_iterator.hpp ] Implement constructors
  • [ IMPL - journaled_string_iterator.hpp ] Implement comparison operators
  • [ IMPL - journaled_string_iterator.hpp ] Implement dereferencing operators
  • [ IMPL - journaled_string_iterator.hpp ] Implement arithmetic operators (biodirectional means only -- and ++)

WP 1.5 - Functionality Features

  • [ TEST/IMPL ] subscript operator[]
  • [ TEST/IMPL ] Member function insert(pos, value_type/container<value_type>), insert(begin(), value_type/container<value_type>)
  • [ TEST/IMPL ] erase(pos), erase(pos, length), erase(begin), erase(begin, end)
  • [ TEST/IMPL ] Member function replace(pos, value_type/container<value_type>), replace(begin(), value_type/container<value_type>)
  • [ TEST/IMPL ] stream operator << ?
  • [ TEST/IMPL ] Member function flatten() or action::flatten - will apply all changes that are kept as journal entries to the reference.
Clone this wiki locally