FunctionType Class Reference

YCP type Function <returntype, arg1type, arg2type, ...>. More...

#include <Type.h>

Inheritance diagram for FunctionType:

Type Rep

List of all members.

Public Member Functions

 FunctionType (constTypePtr return_type, constFunctionTypePtr arguments)
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) const
TypePtr clone () const
constTypePtr unflex (constTypePtr type, unsigned int number=0) const
std::ostream & toStream (std::ostream &str) const
 FunctionType (constTypePtr returntype=Type::Unspec, bool as_const=false)
 FunctionType (bytecodeistream &str)
 ~FunctionType ()
constTypePtr returnType () const
void concat (constTypePtr t)
int parameterCount () const
constTypePtr parameterType (unsigned int parameter_number) const
constTupleTypePtr parameters () const

Private Member Functions

 REP_BODY (FunctionType)

Private Attributes

const constTypePtr m_returntype
TupleTypePtr m_arguments


Detailed Description

YCP type Function <returntype, arg1type, arg2type, ...>.

Constructor & Destructor Documentation

FunctionType::FunctionType ( constTypePtr  return_type,
constFunctionTypePtr  arguments 
)

References concat().

FunctionType::FunctionType ( constTypePtr  returntype = Type::Unspec,
bool  as_const = false 
)

FunctionType::FunctionType ( bytecodeistream str  ) 

FunctionType::~FunctionType (  ) 


Member Function Documentation

bool FunctionType::canCast ( constTypePtr  to  )  const [inline, virtual]

check, if the type can be casted (at runtime considered to be - similar to dynamic_cast) to another type

Reimplemented from Type.

TypePtr FunctionType::clone (  )  const [virtual]

clone this type

Reimplemented from Type.

References m_arguments, and m_returntype.

void FunctionType::concat ( constTypePtr  t  ) 

References m_arguments.

Referenced by FunctionType().

bool FunctionType::equals ( constTypePtr  expected  )  const [virtual]

check equality of the types, without any assumptions like any == unspec

Reimplemented from Type.

References m_arguments, and m_returntype.

bool FunctionType::isBasetype (  )  const [inline, virtual]

Reimplemented from Type.

int FunctionType::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_arguments, m_returntype, toString(), and y2debug.

constTypePtr FunctionType::matchFlex ( constTypePtr  type,
unsigned int  number = 0 
) const [virtual]

Reimplemented from Type.

References m_arguments, toString(), and y2debug.

int FunctionType::parameterCount (  )  const

References m_arguments.

constTupleTypePtr FunctionType::parameters (  )  const

References m_arguments.

constTypePtr FunctionType::parameterType ( unsigned int  parameter_number  )  const

References m_arguments.

FunctionType::REP_BODY ( FunctionType   )  [private]

constTypePtr FunctionType::returnType (  )  const [inline]

References m_returntype.

std::ostream & FunctionType::toStream ( std::ostream &  str  )  const [virtual]

write bytecode out to stream

write out to bytecode stream

Reimplemented from Type.

References m_arguments, m_returntype, Bytecode::writeBool(), Bytecode::writeType(), and y2debug.

string FunctionType::toString ( void   )  const [virtual]

Converts a type code to its YCP notation.

Reimplemented from Type.

References m_arguments, m_returntype, Type::postToString(), and Type::preToString().

Referenced by match(), matchFlex(), and unflex().

constTypePtr FunctionType::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_arguments, m_returntype, toString(), and y2debug.


Member Data Documentation

TupleTypePtr FunctionType::m_arguments [private]

const constTypePtr FunctionType::m_returntype [private]


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

Generated on a sunny day for yast2-core by doxygen 1.5.9