Tuple <type, type, ...> (function arguments). More...
#include <Type.h>
Public Member Functions | |
string | toString () const |
bool | isBasetype () const |
constTypePtr | matchFlex (constTypePtr type, unsigned int number=0) const |
int | match (constTypePtr expected) const |
bool | equals (constTypePtr expected) const |
bool | canCast (constTypePtr to) const |
TypePtr | clone () const |
constTypePtr | unflex (constTypePtr type, unsigned int number=0) const |
std::ostream & | toStream (std::ostream &str) const |
TupleType (constTypePtr type, bool as_const=false) | |
TupleType (bytecodeistream &str) | |
void | concat (constTypePtr t) |
unsigned int | parameterCount () const |
constTypePtr | parameterType (unsigned int parameter_number) const |
~TupleType () | |
Protected Attributes | |
std::vector< constTypePtr > | m_types |
Private Member Functions | |
REP_BODY (TupleType) |
Tuple <type, type, ...> (function arguments).
TupleType::TupleType | ( | constTypePtr | type, | |
bool | as_const = false | |||
) |
References concat().
TupleType::TupleType | ( | bytecodeistream & | str | ) |
References m_types, Bytecode::readInt32(), Bytecode::readType(), and y2debug.
TupleType::~TupleType | ( | ) |
bool TupleType::canCast | ( | constTypePtr | to | ) | const [virtual] |
TypePtr TupleType::clone | ( | ) | const [virtual] |
void TupleType::concat | ( | constTypePtr | t | ) |
References m_types.
Referenced by TupleType().
bool TupleType::equals | ( | constTypePtr | expected | ) | const [virtual] |
bool TupleType::isBasetype | ( | ) | const [inline, virtual] |
Reimplemented from Type.
int TupleType::match | ( | constTypePtr | expected | ) | const [virtual] |
check match with expected type <0: no match, ==0: full match, >0: propagated match
Reimplemented from Type.
References Type::basematch(), m_types, toString(), and y2debug.
constTypePtr TupleType::matchFlex | ( | constTypePtr | type, | |
unsigned int | number = 0 | |||
) | const [virtual] |
Reimplemented from Type.
References m_types, toString(), and y2debug.
unsigned int TupleType::parameterCount | ( | ) | const [inline] |
References m_types.
constTypePtr TupleType::parameterType | ( | unsigned int | parameter_number | ) | const |
References m_types.
TupleType::REP_BODY | ( | TupleType | ) | [private] |
std::ostream & TupleType::toStream | ( | std::ostream & | str | ) | const [virtual] |
write bytecode out to stream
write out to bytecode stream
Reimplemented from Type.
References m_types, Bytecode::writeInt32(), and Bytecode::writeType().
string TupleType::toString | ( | void | ) | const [virtual] |
Converts a type code to its YCP notation.
Reimplemented from Type.
References m_types, Type::postToString(), and Type::preToString().
Referenced by match(), matchFlex(), and unflex().
constTypePtr TupleType::unflex | ( | constTypePtr | type, | |
unsigned int | number = 0 | |||
) | const [virtual] |
replace any 'FlexT' (number == 0) or 'NFlexT' (number != 0) with 'type'
Reimplemented from Type.
References m_types, toString(), and y2debug.
std::vector<constTypePtr> TupleType::m_types [protected] |
Referenced by canCast(), clone(), concat(), equals(), match(), matchFlex(), parameterCount(), parameterType(), toStream(), toString(), TupleType(), and unflex().