yast2-core
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ListType Class Reference

YCP type List <type> More...

#include <Type.h>

Inheritance diagram for ListType:
Type Rep

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 type () const
 
std::ostream & toStream (std::ostream &str) const
 
 ListType (constTypePtr type=Type::Unspec, bool as_const=false)
 
 ListType (bytecodeistream &str)
 
 ~ListType ()
 
- Public Member Functions inherited from Type
 Type ()
 
 Type (tkind kind, bytecodeistream &str)
 
virtual ~Type ()
 
virtual string toXmlString () const
 
virtual std::ostream & toXml (std::ostream &str, int indent) const
 
virtual int matchvalue (YCPValue value) const
 
string preToString () const
 
string postToString () const
 
bool isConst () const
 
void asConst ()
 
bool isReference () const
 
void asReference ()
 
int basematch (constTypePtr expected) const
 
bool isUnspec () const
 
bool isError () const
 
bool isAny () const
 
bool isBoolean () const
 
bool isByteblock () const
 
bool isFloat () const
 
bool isInteger () const
 
bool isLocale () const
 
bool isPath () const
 
bool isString () const
 
bool isSymbol () const
 
bool isTerm () const
 
bool isVoid () const
 
bool isWildcard () const
 
bool isFlex () const
 
bool isNFlex () const
 
bool isVariable () const
 
bool isList () const
 
bool isMap () const
 
bool isBlock () const
 
bool isTuple () const
 
bool isFunction () const
 
bool isNil () const
 
YCPValueType valueType () const
 
- Public Member Functions inherited from Rep
 Rep ()
 
 Rep (const Rep &)
 
Repoperator= (const Rep &)
 
virtual ~Rep ()
 
void ref () const
 
void unref () const
 
unsigned refCount () const
 
virtual const char * repName () const
 
virtual std::ostream & dumpOn (std::ostream &str) const
 

Private Member Functions

 REP_BODY (ListType)
 

Private Attributes

const constTypePtr m_type
 

Additional Inherited Members

- Public Types inherited from Type
enum  type_kind {
  UnspecT = 0, ErrorT, AnyT, BooleanT,
  ByteblockT, FloatT, IntegerT, LocaleT,
  PathT, StringT, SymbolT, TermT,
  VoidT, WildcardT, FlexT, VariableT,
  ListT, MapT, BlockT, TupleT,
  FunctionT, NilT, NFlexT
}
 
typedef enum Type::type_kind tkind
 
- Static Public Member Functions inherited from Type
static void setNocheck (bool nocheck)
 
static constTypePtr vt2type (enum YCPValueType vt)
 
static int nextToken (const char **signature)
 
static constTypePtr fromSignature (const char **signature)
 
static constTypePtr fromSignature (const string &signature)
 
static constTypePtr determineFlexType (constFunctionTypePtr actual, constFunctionTypePtr declared)
 
static FunctionTypePtr Function (constTypePtr return_type)
 
- Static Public Member Functions inherited from Rep
static void ref (const Rep *obj_r)
 
static void unref (const Rep *obj_r)
 
- Static Public Attributes inherited from Type
static const constTypePtr Unspec = TypePtr ( new Type (UnspecT))
 
static const constTypePtr Error = TypePtr ( new Type (ErrorT))
 
static const constTypePtr Any = TypePtr ( new Type (AnyT))
 
static const constTypePtr Void = TypePtr ( new Type (VoidT))
 
static const constTypePtr Boolean = TypePtr ( new Type (BooleanT))
 
static const constTypePtr Byteblock = TypePtr ( new Type (ByteblockT))
 
static const constTypePtr Float = TypePtr ( new Type (FloatT))
 
static const constTypePtr Integer = TypePtr ( new Type (IntegerT))
 
static const constTypePtr Locale = TypePtr ( new Type (LocaleT))
 
static const constTypePtr Path = TypePtr ( new Type (PathT))
 
static const constTypePtr String = TypePtr ( new Type (StringT))
 
static const constTypePtr Symbol = TypePtr ( new Type (SymbolT))
 
static const constTypePtr Term = TypePtr ( new Type (TermT))
 
static const constTypePtr Wildcard = TypePtr ( new Type (WildcardT))
 
static const constTypePtr ConstAny = TypePtr ( new Type (AnyT, true))
 
static const constTypePtr ConstVoid = TypePtr ( new Type (VoidT, true))
 
static const constTypePtr ConstBoolean = TypePtr ( new Type (BooleanT, true))
 
static const constTypePtr ConstByteblock = TypePtr ( new Type (ByteblockT, true))
 
static const constTypePtr ConstFloat = TypePtr ( new Type (FloatT, true))
 
static const constTypePtr ConstInteger = TypePtr ( new Type (IntegerT, true))
 
static const constTypePtr ConstLocale = TypePtr ( new Type (LocaleT, true))
 
static const constTypePtr ConstPath = TypePtr ( new Type (PathT, true))
 
static const constTypePtr ConstString = TypePtr ( new Type (StringT, true))
 
static const constTypePtr ConstSymbol = TypePtr ( new Type (SymbolT, true))
 
static const constTypePtr ConstTerm = TypePtr ( new Type (TermT, true))
 
static const constTypePtr ConstList = TypePtr ( new Type (ListT, true))
 
static const constTypePtr ConstMap = TypePtr ( new Type (MapT, true))
 
static const constTypePtr Flex = TypePtr ( new FlexType())
 
static const constTypePtr ConstFlex = TypePtr ( new FlexType (true))
 
static const constTypePtr NFlex1 = TypePtr ( new NFlexType(1))
 
static const constTypePtr ConstNFlex1 = TypePtr ( new NFlexType (1, true))
 
static const constTypePtr NFlex2 = TypePtr ( new NFlexType(2))
 
static const constTypePtr ConstNFlex2 = TypePtr ( new NFlexType (2, true))
 
static const constTypePtr NFlex3 = TypePtr ( new NFlexType(3))
 
static const constTypePtr ConstNFlex3 = TypePtr ( new NFlexType (3, true))
 
static const constTypePtr NFlex4 = TypePtr ( new NFlexType(4))
 
static const constTypePtr ConstNFlex4 = TypePtr ( new NFlexType (4, true))
 
static const constTypePtr ListUnspec = new ListType (Type::Unspec)
 
static const constTypePtr List = new ListType (Type::Any)
 
static const constTypePtr MapUnspec = new MapType (Type::Unspec, Type::Unspec)
 
static const constTypePtr Map = new MapType (Type::Any, Type::Any)
 
static const constTypePtr Variable = new VariableType (Type::Any)
 
static const constTypePtr Block = new BlockType (Type::Any)
 
static const constTypePtr Nil = TypePtr ( new Type (NilT))
 
- Protected Member Functions inherited from Type
 Type (tkind kind, bool as_const=false, bool as_reference=false)
 
- Protected Member Functions inherited from Rep
virtual void ref_to (unsigned) const
 
virtual void unref_to (unsigned) const
 
- Protected Attributes inherited from Type
tkind m_kind
 
bool m_const
 
bool m_reference
 

Detailed Description

YCP type List <type>

Constructor & Destructor Documentation

ListType::ListType ( constTypePtr  type = Type::Unspec,
bool  as_const = false 
)
ListType::ListType ( bytecodeistream str)
ListType::~ListType ( )

Member Function Documentation

bool ListType::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_type.

TypePtr ListType::clone ( ) const
virtual

clone this type

Reimplemented from Type.

References m_type.

constTypePtr ListType::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 Type::Any, m_type, toString(), type(), and y2debug.

constTypePtr ListType::detailedtype ( constTypePtr  type) const
virtual

Finds a type that contains most information This should be the widest such type - TODO

Reimplemented from Type.

References Type::Error, m_type, toString(), type(), and y2debug.

bool ListType::equals ( constTypePtr  expected) const
virtual

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

Reimplemented from Type.

References m_type.

bool ListType::isBasetype ( ) const
inlinevirtual

Reimplemented from Type.

int ListType::match ( constTypePtr  expected) const
virtual

Checks match with expected type. Match is not symmetric, e.g integer match any but not vice versa.

Parameters
expectedTarget type against which this is matched, so integer.match(any) -> 0 <0: no match, ==0: full match, >0: propagated match

Reimplemented from Type.

References Type::basematch(), m_type, toString(), and y2debug.

constTypePtr ListType::matchFlex ( constTypePtr  type,
unsigned int  number = 0 
) const
virtual

Reimplemented from Type.

References m_type, toString(), and y2debug.

ListType::REP_BODY ( ListType  )
private
std::ostream & ListType::toStream ( std::ostream &  str) const
virtual

write bytecode out to stream

write out to bytecode stream

Reimplemented from Type.

References m_type, str, Type::toStream(), and Bytecode::writeType().

string ListType::toString ( void  ) const
virtual

Converts a type code to its YCP notation.

Reimplemented from Type.

References m_type, Type::postToString(), and Type::preToString().

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

constTypePtr ListType::type ( ) const
inline

References m_type.

Referenced by commontype(), and detailedtype().

constTypePtr ListType::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_type, toString(), and y2debug.

Member Data Documentation

const constTypePtr ListType::m_type
private

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

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