tetengo 1.8.1
A multipurpose library set
Loading...
Searching...
No Matches
tetengo::lattice::input Class Referenceabstract

An input. More...

#include <input.hpp>

+ Inheritance diagram for tetengo::lattice::input:
+ Collaboration diagram for tetengo::lattice::input:

Public Member Functions

virtual ~input ()
 Destroys the input.
 
std::size_t hash_value () const
 Returns the hash value.
 
std::size_t length () const
 Returns the length.
 
std::unique_ptr< inputclone () const
 Clone this input.
 
std::unique_ptr< inputcreate_subrange (std::size_t offset, std::size_t length) const
 Creates a subrange.
 
void append (std::unique_ptr< input > &&p_another)
 Appends another input.
 
template<typename C >
bool is () const
 Returns true when this object can be casted to the specified concrete input.
 
template<typename C >
const C & as () const
 Casts this object to the specified concrete input.
 
template<typename C >
C & as ()
 Casts this object to the specified concrete input.
 

Friends

bool operator== (const input &one, const input &another)
 Returns true if one input is equal to another.
 

Detailed Description

An input.

Member Function Documentation

◆ append()

void tetengo::lattice::input::append ( std::unique_ptr< input > &&  p_another)

Appends another input.

Parameters
p_anotherA unique pointer to another input.
Exceptions
std::invalid_argumentWhen p_another is nullptr or its type does not match.

◆ as() [1/2]

template<typename C >
C & tetengo::lattice::input::as ( )
inline

Casts this object to the specified concrete input.

Template Parameters
CA concrete input type.
Returns
The casted concrete vocabulary.

◆ as() [2/2]

template<typename C >
const C & tetengo::lattice::input::as ( ) const
inline

Casts this object to the specified concrete input.

Template Parameters
CA concrete input type.
Returns
The casted concrete vocabulary.

◆ clone()

std::unique_ptr< input > tetengo::lattice::input::clone ( ) const

Clone this input.

Returns
A unique pointer to a clone.

◆ create_subrange()

std::unique_ptr< input > tetengo::lattice::input::create_subrange ( std::size_t  offset,
std::size_t  length 
) const

Creates a subrange.

Parameters
offsetAn offset.
lengthA length.
Returns
A unique pointer to a subrange.
Exceptions
std::out_of_rangeWhen offset and/or length are out of the range of the input.

◆ hash_value()

std::size_t tetengo::lattice::input::hash_value ( ) const

Returns the hash value.

Returns
The hash value.

◆ is()

template<typename C >
bool tetengo::lattice::input::is ( ) const
inline

Returns true when this object can be casted to the specified concrete input.

Template Parameters
CA concrete input type.
Return values
trueWhen this object can be casted to the specified concrete input.
falseOtherwise.

◆ length()

std::size_t tetengo::lattice::input::length ( ) const

Returns the length.

Returns
The length.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const input one,
const input another 
)
friend

Returns true if one input is equal to another.

Parameters
oneOne input.
anotherAnother input.
Return values
trueWhen one input is equal to another.
valseOtherwise.

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