Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Linear string. More...
#include <LinearString.h>
Public Member Functions | |
LinearString () | |
Creates a new instance of the string with an empty content. More... | |
LinearString (ext::set< SymbolType > alphabet, ext::vector< SymbolType > str) | |
Creates a new instance of the string with a concrete alphabet and content. More... | |
LinearString (ext::vector< SymbolType > str) | |
Creates a new instance of the string based on content, the alphabet is implicitly created from the content. More... | |
LinearString (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... | |
LinearString (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 (const ext::set< SymbolType > &symbols) |
void | appendSymbol (SymbolType symbol) |
const ext::vector< SymbolType > & | getContent () const & |
ext::vector< SymbolType > && | getContent () && |
void | setContent (ext::vector< SymbolType > str) |
bool | empty () const |
size_t | size () const |
auto | operator<=> (const LinearString &other) const |
bool | operator== (const LinearString &other) const |
![]() | |
void | accessComponent () |
Friends | |
ext::ostream & | operator<< (ext::ostream &out, const LinearString &instance) |
Additional Inherited Members | |
![]() | |
static void | registerComponent () |
static void | unregisterComponent () |
Linear string.
S = (A, C), A (Alphabet) = finite set of symbols, C (Content) = representation of the string content
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 |
void string::LinearString< SymbolType >::appendSymbol | ( | SymbolType | symbol | ) |
Appender of a symbol to the string.
symbol | the symbol to be added to the end of the string |
bool string::LinearString< SymbolType >::empty |
Test function to determine whether the cyclic string is empty
|
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::LinearString< SymbolType >::getContent | ( | ) | && |
Getter of the string content.
const ext::vector< SymbolType > & string::LinearString< SymbolType >::getContent | ( | ) | const & |
Getter of the string content.
|
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::LinearString< 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. |
size_t string::LinearString< SymbolType >::size |
Returns length of the content.
|
friend |
Print this object as raw representation to ostream.
out | ostream where to print |
instance | object to print |