Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Cyclic string. More...
#include <CyclicString.h>
Public Member Functions | |
CyclicString () | |
Creates a new instance of the string with an empty content. More... | |
CyclicString (ext::set< SymbolType > alphabet, ext::vector< SymbolType > str) | |
Creates a new instance of the string with a concrete alphabet and content. More... | |
CyclicString (ext::vector< SymbolType > str) | |
Creates a new instance of the string based on content, the alphabet is implicitly created from the content. More... | |
CyclicString (const std::string &str) | |
Creates a new instance of the string from the standard string. The alphabet is deduced from the content. The constructor expects SymbolType of the string is constructible from char. More... | |
CyclicString (const char *str) | |
Creates a new instance of the string from c-string. The alphabet is deduced from the content. The constructor expects SymbolType of the string is constructible from char. More... | |
const ext::set< SymbolType > & | getAlphabet () const & |
ext::set< SymbolType > && | getAlphabet () && |
void | extendAlphabet (ext::set< SymbolType > symbols) |
const ext::vector< SymbolType > & | getContent () const & |
ext::vector< SymbolType > && | getContent () && |
void | setContent (ext::vector< SymbolType > str) |
bool | isEmpty () const |
auto | operator<=> (const CyclicString &other) const |
bool | operator== (const CyclicString &other) const |
![]() | |
void | accessComponent () |
Friends | |
ext::ostream & | operator<< (ext::ostream &out, const CyclicString &instance) |
Additional Inherited Members | |
![]() | |
static void | registerComponent () |
static void | unregisterComponent () |
Cyclic string.
Definition is similar to a linear string however cyclic. S = (A, C), A (Alphabet) = finite set of symbols, C (Content) = linear representation of cyclic string in some rotation
Note that two same cyclic strings compare not equal in different rotation. In order to either normalize rotation or compare without influence of particular rotation, use respective algoritm.
SymbolType | used for the terminal alphabet |
|
explicit |
Creates a new instance of the string with an empty content.
|
explicit |
Creates a new instance of the string with a concrete alphabet and content.
alphabet | the initial alphabet of the string |
str | the initial content of the string |
|
explicit |
Creates a new instance of the string based on content, the alphabet is implicitly created from the content.
str | the initial content of the string |
|
explicit |
Creates a new instance of the string from the standard string. The alphabet is deduced from the content. The constructor expects SymbolType of the string is constructible from char.
str | the initial content of the string |
|
explicit |
Creates a new instance of the string from c-string. The alphabet is deduced from the content. The constructor expects SymbolType of the string is constructible from char.
str | the initial content of the string |
|
inline |
Adder of an alphabet symbols.
symbols | the new symbols to be added to the alphabet |
|
inline |
Getter of the alphabet.
|
inline |
Getter of the alphabet.
ext::vector< SymbolType > && string::CyclicString< SymbolType >::getContent | ( | ) | && |
Getter of the string content.
const ext::vector< SymbolType > & string::CyclicString< SymbolType >::getContent | ( | ) | const & |
Getter of the string content.
bool string::CyclicString< SymbolType >::isEmpty |
Test function to determine whether the cyclic string is empty
|
inline |
The three way comparison implementation
other | the other instance |
other
.
|
inline |
The equality comparison implementation.
other | the other object to compare with. |
void string::CyclicString< SymbolType >::setContent | ( | ext::vector< SymbolType > | str | ) |
Setter of the string content.
CommonException | when new string contains symbols not present in the alphabet |
new | List of symbols forming string. |
|
friend |
Print this object as raw representation to ostream.
out | ostream where to print |
instance | object to print |