Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions | Friends
string::WildcardLinearString< SymbolType > Class Template Referencefinal

Linear wildcard string. More...

#include <WildcardLinearString.h>

Inheritance diagram for string::WildcardLinearString< SymbolType >:
[legend]
Collaboration diagram for string::WildcardLinearString< SymbolType >:
[legend]

Public Member Functions

 WildcardLinearString (ext::set< SymbolType > alphabet, ext::vector< SymbolType > str, SymbolType wildcard)
 Creates a new instance of the string with a concrete alphabet, content and wildcard. More...
 
 WildcardLinearString (ext::vector< SymbolType > str, SymbolType wildcard)
 Creates a new instance of the string based on content and the wildcard, the alphabet is implicitly created from the content. More...
 
 WildcardLinearString (const std::string &str, char wildcard)
 Creates a new instance of the string from the standard string and the wildcard. The alphabet is deduced from the content. The constructor expects SymbolType of the string is constructible from char. More...
 
 WildcardLinearString (const std::string &str)
 Creates a new instance of the string from the standard string. The wildcard is defaultly constructed. The alphabet is deduced from the content. The constructor expects SymbolType of the string is constructible from char. More...
 
 WildcardLinearString (const char *str, char wildcard)
 Creates a new instance of the string from c-string and the wildcard. The alphabet is deduced from the content. The constructor expects SymbolType of the string is constructible from char. More...
 
 WildcardLinearString (const LinearString< SymbolType > &string, SymbolType wildcard)
 Creates a new instance of the string based on a linear string. It copies the alphabet and content. The wildcard is set from the the parametery. More...
 
 WildcardLinearString (const LinearString< SymbolType > &string)
 Creates a new instance of the string based on a linear string. It copies the alphabet and content. The wildcard is defaultly constructed. More...
 
const ext::set< SymbolType > & getAlphabet () const &
 
ext::set< SymbolType > && getAlphabet () &&
 
void extendAlphabet (const ext::set< SymbolType > &symbols)
 
const SymbolType & getWildcardSymbol () const &
 
SymbolType && getWildcardSymbol () &&
 
bool setWildcardSymbol (SymbolType wildcard)
 
void appendSymbol (SymbolType symbol)
 
const ext::vector< SymbolType > & getContent () const &
 
ext::vector< SymbolType > && getContent () &&
 
void setContent (ext::vector< SymbolType > str)
 
bool isEmpty () const
 
auto operator<=> (const WildcardLinearString &other) const
 
bool operator== (const WildcardLinearString &other) const
 
- Public Member Functions inherited from core::Components< WildcardLinearString< DefaultSymbolType >, ext::set< DefaultSymbolType >, component::Set, GeneralAlphabet, DefaultSymbolType, component::Value, WildcardSymbol >
void accessComponent ()
 

Friends

ext::ostreamoperator<< (ext::ostream &out, const WildcardLinearString &instance)
 

Additional Inherited Members

- Static Public Member Functions inherited from core::Components< WildcardLinearString< DefaultSymbolType >, ext::set< DefaultSymbolType >, component::Set, GeneralAlphabet, DefaultSymbolType, component::Value, WildcardSymbol >
static void registerComponent ()
 
static void unregisterComponent ()
 

Detailed Description

template<class SymbolType = DefaultSymbolType>
class string::WildcardLinearString< SymbolType >

Linear wildcard string.

S = (A, C, W), A (Alphabet) = finite set of symbols, C (Content) = representation of the string content W (Wildcard symbol) = symbol representing an wildcard symbol

Template Parameters
SymbolTypeused for the terminal alphabet

Constructor & Destructor Documentation

◆ WildcardLinearString() [1/7]

template<class SymbolType >
string::WildcardLinearString< SymbolType >::WildcardLinearString ( ext::set< SymbolType >  alphabet,
ext::vector< SymbolType >  str,
SymbolType  wildcard 
)
explicit

Creates a new instance of the string with a concrete alphabet, content and wildcard.

Parameters
alphabetthe initial alphabet of the string
strthe initial content of the string
wildcardthe explicit wildcard symbol

◆ WildcardLinearString() [2/7]

template<class SymbolType >
string::WildcardLinearString< SymbolType >::WildcardLinearString ( ext::vector< SymbolType >  str,
SymbolType  wildcard 
)
explicit

Creates a new instance of the string based on content and the wildcard, the alphabet is implicitly created from the content.

Parameters
strthe initial content of the string
wildcardthe explicit wildcard symbol

◆ WildcardLinearString() [3/7]

template<class SymbolType >
string::WildcardLinearString< SymbolType >::WildcardLinearString ( const std::string &  str,
char  wildcard 
)
explicit

Creates a new instance of the string from the standard string and the wildcard. The alphabet is deduced from the content. The constructor expects SymbolType of the string is constructible from char.

Parameters
strthe initial content of the string
wildcardthe explicit wildcard symbol

◆ WildcardLinearString() [4/7]

template<class SymbolType >
string::WildcardLinearString< SymbolType >::WildcardLinearString ( const std::string &  str)
explicit

Creates a new instance of the string from the standard string. The wildcard is defaultly constructed. The alphabet is deduced from the content. The constructor expects SymbolType of the string is constructible from char.

Parameters
strthe initial content of the string

◆ WildcardLinearString() [5/7]

template<class SymbolType >
string::WildcardLinearString< SymbolType >::WildcardLinearString ( const char *  str,
char  wildcard 
)
explicit

Creates a new instance of the string from c-string and the wildcard. The alphabet is deduced from the content. The constructor expects SymbolType of the string is constructible from char.

Parameters
strthe initial content of the string
wildcardthe explicit wildcard symbol

◆ WildcardLinearString() [6/7]

template<class SymbolType >
string::WildcardLinearString< SymbolType >::WildcardLinearString ( const LinearString< SymbolType > &  string,
SymbolType  wildcard 
)
explicit

Creates a new instance of the string based on a linear string. It copies the alphabet and content. The wildcard is set from the the parametery.

Parameters
stringthe linear string to base the string on
wildcardthe explicit wildcard symbol

◆ WildcardLinearString() [7/7]

template<class SymbolType >
string::WildcardLinearString< SymbolType >::WildcardLinearString ( const LinearString< SymbolType > &  string)
explicit

Creates a new instance of the string based on a linear string. It copies the alphabet and content. The wildcard is defaultly constructed.

Parameters
stringthe linear string to base the string on

Member Function Documentation

◆ appendSymbol()

template<class SymbolType >
void string::WildcardLinearString< SymbolType >::appendSymbol ( SymbolType  symbol)

Appender of a symbol to the string.

Parameters
symbolthe symbol to be added to the end of the string
Here is the call graph for this function:

◆ extendAlphabet()

template<class SymbolType = DefaultSymbolType>
void string::WildcardLinearString< SymbolType >::extendAlphabet ( const ext::set< SymbolType > &  symbols)
inline

Adder of an alphabet symbols.

Parameters
symbolsthe new symbols to be added to the alphabet

◆ getAlphabet() [1/2]

template<class SymbolType = DefaultSymbolType>
ext::set< SymbolType > && string::WildcardLinearString< SymbolType >::getAlphabet ( ) &&
inline

Getter of the alphabet.

Returns
the alphabet of the string
Here is the call graph for this function:

◆ getAlphabet() [2/2]

template<class SymbolType = DefaultSymbolType>
const ext::set< SymbolType > & string::WildcardLinearString< SymbolType >::getAlphabet ( ) const &
inline

Getter of the alphabet.

Returns
the alphabet of the string
Here is the caller graph for this function:

◆ getContent() [1/2]

template<class SymbolType = DefaultSymbolType>
ext::vector< SymbolType > && string::WildcardLinearString< SymbolType >::getContent ( ) &&

Getter of the string content.

Returns
List of symbols forming string.

◆ getContent() [2/2]

template<class SymbolType = DefaultSymbolType>
const ext::vector< SymbolType > & string::WildcardLinearString< SymbolType >::getContent ( ) const &

Getter of the string content.

Returns
List of symbols forming string.
Here is the caller graph for this function:

◆ getWildcardSymbol() [1/2]

template<class SymbolType = DefaultSymbolType>
SymbolType && string::WildcardLinearString< SymbolType >::getWildcardSymbol ( ) &&
inline

Getter of the wildcard symbol

Returns
the wildcard symbol of the string
Here is the call graph for this function:

◆ getWildcardSymbol() [2/2]

template<class SymbolType = DefaultSymbolType>
const SymbolType & string::WildcardLinearString< SymbolType >::getWildcardSymbol ( ) const &
inline

Getter of the wildcard symbol

Returns
the wildcard symbol of the string
Here is the caller graph for this function:

◆ isEmpty()

template<class SymbolType >
bool string::WildcardLinearString< SymbolType >::isEmpty

Test function to determine whether the cyclic string is empty

Returns
true if string is an empty word (vector length is 0)

◆ operator<=>()

template<class SymbolType = DefaultSymbolType>
auto string::WildcardLinearString< SymbolType >::operator<=> ( const WildcardLinearString< SymbolType > &  other) const
inline

The three way comparison implementation

Parameters
otherthe other instance
Returns
the ordering between this object and the other.
Here is the call graph for this function:

◆ operator==()

template<class SymbolType = DefaultSymbolType>
bool string::WildcardLinearString< SymbolType >::operator== ( const WildcardLinearString< SymbolType > &  other) const
inline

The equality comparison implementation.

Parameters
otherthe other object to compare with.
Returns
true if this and other objects are equal, false othervise
Here is the call graph for this function:

◆ setContent()

template<class SymbolType >
void string::WildcardLinearString< SymbolType >::setContent ( ext::vector< SymbolType >  str)

Setter of the string content.

Exceptions
CommonExceptionwhen new string contains symbols not present in the alphabet
Parameters
newList of symbols forming string.
Here is the call graph for this function:

◆ setWildcardSymbol()

template<class SymbolType = DefaultSymbolType>
bool string::WildcardLinearString< SymbolType >::setWildcardSymbol ( SymbolType  wildcard)
inline

Setter of the wildcard symbol

Parameters
wildcardnew wildcard symbol of the string
Returns
true if the wildcard symbol was indeed changed

Friends And Related Function Documentation

◆ operator<<

template<class SymbolType = DefaultSymbolType>
ext::ostream & operator<< ( ext::ostream out,
const WildcardLinearString< SymbolType > &  instance 
)
friend

Print this object as raw representation to ostream.

Parameters
outostream where to print
instanceobject to print
Returns
modified output stream

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