MapType Class Reference

YCP type Map <keytype, valuetype> More...

#include <Type.h>

Inheritance diagram for MapType:
Type Rep

List of all members.

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
constTypePtr commontype (constTypePtr type) const
constTypePtr detailedtype (constTypePtr type) const
bool canCast (constTypePtr to) const
TypePtr clone () const
constTypePtr unflex (constTypePtr type, unsigned int number=0) const
constTypePtr keytype () const
constTypePtr valuetype () const
std::ostream & toStream (std::ostream &str) const
 MapType (constTypePtr key=Type::Unspec, constTypePtr value=Type::Unspec, bool as_const=false)
 MapType (bytecodeistream &str)
 ~MapType ()

Private Member Functions

 REP_BODY (MapType)

Private Attributes

const constTypePtr m_keytype
const constTypePtr m_valuetype

Detailed Description

YCP type Map <keytype, valuetype>


Constructor & Destructor Documentation

MapType::MapType ( constTypePtr  key = Type::Unspec,
constTypePtr  value = Type::Unspec,
bool  as_const = false 
)
MapType::MapType ( bytecodeistream str  ) 
MapType::~MapType (  ) 

Member Function Documentation

bool MapType::canCast ( constTypePtr  to  )  const [virtual]

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

Reimplemented from Type.

References m_keytype, and m_valuetype.

TypePtr MapType::clone (  )  const [virtual]

clone this type

Reimplemented from Type.

References m_keytype, and m_valuetype.

Referenced by unflex().

constTypePtr MapType::commontype ( constTypePtr  type  )  const [virtual]

Finds a type that can hold both given types This should be the narrowest such type - TODO

Reimplemented from Type.

References m_keytype, m_valuetype, toString(), and y2debug.

constTypePtr MapType::detailedtype ( constTypePtr  type  )  const [virtual]

Finds a type which contains most information

Reimplemented from Type.

References m_keytype, m_valuetype, toString(), and y2debug.

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

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

Reimplemented from Type.

References m_keytype, and m_valuetype.

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

Reimplemented from Type.

constTypePtr MapType::keytype (  )  const [inline]

References m_keytype.

int MapType::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_keytype, m_valuetype, toString(), and y2debug.

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

Reimplemented from Type.

References m_keytype, m_valuetype, toString(), and y2debug.

MapType::REP_BODY ( MapType   )  [private]
std::ostream & MapType::toStream ( std::ostream &  str  )  const [virtual]

write bytecode out to stream

write out to bytecode stream

Reimplemented from Type.

References m_keytype, m_valuetype, and Bytecode::writeType().

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

Converts a type code to its YCP notation.

Reimplemented from Type.

References m_keytype, m_valuetype, Type::postToString(), and Type::preToString().

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

constTypePtr MapType::unflex ( constTypePtr  type,
unsigned int  number = 0 
) const [virtual]

replace any 'FlexT' (number == 0) or 'NFlexT' (number != 0) with 'type'

Reimplemented from Type.

References clone(), m_keytype, m_valuetype, toString(), and y2debug.

constTypePtr MapType::valuetype (  )  const [inline]

References m_valuetype.


Member Data Documentation

const constTypePtr MapType::m_keytype [private]
const constTypePtr MapType::m_valuetype [private]

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

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