Qt 4.8
Public Types | Public Functions | Protected Functions | List of all members
QPatternist::AtomicType Class Referenceabstract

Base class for all classes that implements atomic types. More...

#include <qatomictype_p.h>

Inheritance diagram for QPatternist::AtomicType:
QPatternist::ItemType QPatternist::AnySimpleType QSharedData QPatternist::AnyType QPatternist::SchemaType QPatternist::SchemaComponent QSharedData QPatternist::BuiltinAtomicType QPatternist::NumericType QPatternist::AnyAtomicType QPatternist::AnyURIType QPatternist::Base64BinaryType QPatternist::BooleanType QPatternist::DateTimeType QPatternist::DateType QPatternist::DayTimeDurationType QPatternist::DecimalType QPatternist::DoubleType QPatternist::DurationType QPatternist::FloatType QPatternist::GDayType QPatternist::GMonthDayType QPatternist::GMonthType QPatternist::GYearMonthType QPatternist::GYearType QPatternist::HexBinaryType QPatternist::IntegerType QPatternist::NOTATIONType QPatternist::QNameType QPatternist::SchemaTimeType QPatternist::StringType QPatternist::UntypedAtomicType QPatternist::YearMonthDurationType

Public Types

typedef QExplicitlySharedDataPointer< AtomicTypePtr
 
- Public Types inherited from QPatternist::ItemType
enum  Category { NodeNameTest = 1, Other = 2 }
 
enum  InstanceOf { ClassLocalNameTest, ClassNamespaceNameTest, ClassQNameTest, ClassOther }
 
typedef QList< ItemType::PtrList
 
typedef QExplicitlySharedDataPointer< ItemTypePtr
 
- Public Types inherited from QPatternist::AnySimpleType
typedef QList< AnySimpleType::PtrList
 
typedef QExplicitlySharedDataPointer< AnySimpleTypePtr
 
- Public Types inherited from QPatternist::AnyType
typedef QExplicitlySharedDataPointer< AnyTypePtr
 
- Public Types inherited from QPatternist::SchemaType
enum  DerivationConstraint { RestrictionConstraint = 1, ExtensionConstraint = 2, ListConstraint = 4, UnionConstraint = 8 }
 
enum  DerivationMethod {
  DerivationRestriction = 1, DerivationExtension = 2, DerivationUnion = 4, DerivationList = 8,
  NoDerivation = 16
}
 
typedef QHash< QXmlName, SchemaType::PtrHash
 
typedef QList< SchemaType::PtrList
 
typedef QExplicitlySharedDataPointer< SchemaTypePtr
 
enum  TypeCategory {
  None = 0, SimpleTypeAtomic, SimpleTypeList, SimpleTypeUnion,
  ComplexType
}
 

Public Functions

virtual AtomicTypeVisitorResult::Ptr accept (const QExplicitlySharedDataPointer< AtomicTypeVisitor > &visitor, const SourceLocationReflection *const) const =0
 
virtual AtomicTypeVisitorResult::Ptr accept (const ParameterizedAtomicTypeVisitor::Ptr &visitor, const qint16 param, const SourceLocationReflection *const) const =0
 
virtual ItemType::Ptr atomizedType () const
 
virtual AtomicCasterLocator::Ptr casterLocator () const =0
 
virtual TypeCategory category () const
 
virtual AtomicComparatorLocator::Ptr comparatorLocator () const =0
 
virtual DerivationMethod derivationMethod () const
 
virtual QString displayName (const NamePool::Ptr &np) const
 
virtual bool isAtomicType () const
 
virtual bool isNodeType () const
 
virtual bool itemMatches (const Item &item) const
 
virtual AtomicMathematicianLocator::Ptr mathematicianLocator () const =0
 
virtual bool xdtTypeMatches (const ItemType::Ptr &other) const
 
virtual ~AtomicType ()
 
- Public Functions inherited from QPatternist::ItemType
virtual InstanceOf instanceOf () const
 
 ItemType ()
 
virtual Category itemTypeCategory () const
 
bool operator!= (const ItemType &other) const
 
virtual bool operator== (const ItemType &other) const
 
virtual const ItemTypeoperator| (const ItemType &other) const
 
virtual ItemType::Ptr xdtSuperType () const =0
 
virtual ~ItemType ()
 
- Public Functions inherited from QSharedData
 QSharedData ()
 Constructs a QSharedData object with a reference count of 0. More...
 
 QSharedData (const QSharedData &)
 Constructs a QSharedData object with reference count 0. More...
 
- Public Functions inherited from QPatternist::AnySimpleType
virtual bool isComplexType () const
 
virtual bool isSimpleType () const
 
virtual QXmlName name (const NamePool::Ptr &np) const
 Returns the name of the type. More...
 
virtual SchemaType::Ptr wxsSuperType () const
 
virtual ~AnySimpleType ()
 
- Public Functions inherited from QPatternist::AnyType
virtual DerivationConstraints derivationConstraints () const
 
virtual bool isAbstract () const
 
virtual bool wxsTypeMatches (const SchemaType::Ptr &other) const
 
virtual ~AnyType ()
 
- Public Functions inherited from QPatternist::SchemaType
virtual bool isDefinedBySchema () const
 
 SchemaType ()
 
virtual ~SchemaType ()
 
- Public Functions inherited from QPatternist::SchemaComponent
 SchemaComponent ()
 
virtual ~SchemaComponent ()
 

Protected Functions

 AtomicType ()
 
- Protected Functions inherited from QPatternist::AnySimpleType
 AnySimpleType ()
 
- Protected Functions inherited from QPatternist::AnyType
 AnyType ()
 This constructor is protected, because this class must be sub-classed. More...
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Base class for all classes that implements atomic types.

AtomicType does not implement xs:anyAtomicType, it is the C++ base class for classes that implement atomic types, such as xs:anyAtomicType.

Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 80 of file qatomictype_p.h.

Typedefs

◆ Ptr

Definition at line 85 of file qatomictype_p.h.

Constructors and Destructors

◆ ~AtomicType()

AtomicType::~AtomicType ( )
virtual

Definition at line 58 of file qatomictype.cpp.

59 {
60 }

◆ AtomicType()

AtomicType::AtomicType ( )
protected

Definition at line 54 of file qatomictype.cpp.

55 {
56 }

Functions

◆ accept() [1/2]

virtual AtomicTypeVisitorResult::Ptr QPatternist::AtomicType::accept ( const QExplicitlySharedDataPointer< AtomicTypeVisitor > &  visitor,
const SourceLocationReflection const 
) const
pure virtual

◆ accept() [2/2]

virtual AtomicTypeVisitorResult::Ptr QPatternist::AtomicType::accept ( const ParameterizedAtomicTypeVisitor::Ptr visitor,
const qint16  param,
const SourceLocationReflection const 
) const
pure virtual

◆ atomizedType()

ItemType::Ptr AtomicType::atomizedType ( ) const
virtual
Returns
always 'this'

Implements QPatternist::ItemType.

Reimplemented in QPatternist::NumericType.

Definition at line 87 of file qatomictype.cpp.

88 {
89  return AtomicType::Ptr(const_cast<AtomicType *>(this));
90 }
QExplicitlySharedDataPointer< AtomicType > Ptr
Definition: qatomictype_p.h:85

◆ casterLocator()

virtual AtomicCasterLocator::Ptr QPatternist::AtomicType::casterLocator ( ) const
pure virtual

◆ category()

SchemaType::TypeCategory AtomicType::category ( ) const
virtual
Returns
always SchemaType::SimpleTypeAtomic

Reimplemented from QPatternist::AnySimpleType.

Definition at line 108 of file qatomictype.cpp.

◆ comparatorLocator()

virtual AtomicComparatorLocator::Ptr QPatternist::AtomicType::comparatorLocator ( ) const
pure virtual

◆ derivationMethod()

SchemaType::DerivationMethod AtomicType::derivationMethod ( ) const
virtual
Returns
DerivationRestriction

Reimplemented from QPatternist::AnySimpleType.

Definition at line 113 of file qatomictype.cpp.

◆ displayName()

QString AtomicType::displayName ( const NamePool::Ptr np) const
virtual

◆ isAtomicType()

bool AtomicType::isAtomicType ( ) const
virtual

returns always true

Implements QPatternist::ItemType.

Reimplemented in QPatternist::NumericType.

Definition at line 103 of file qatomictype.cpp.

104 {
105  return true;
106 }

◆ isNodeType()

bool AtomicType::isNodeType ( ) const
virtual

returns always false

Implements QPatternist::ItemType.

Reimplemented in QPatternist::NumericType.

Definition at line 98 of file qatomictype.cpp.

99 {
100  return false;
101 }

◆ itemMatches()

bool AtomicType::itemMatches ( const Item item) const
virtual

Implements a generic algorithm which relies on wxsTypeMatches().

Returns
true depending on if item is an atomic type, and that AtomicValue::itemType()'s SequenceType::itemType() matches this type.

Implements QPatternist::ItemType.

Reimplemented in QPatternist::NumericType.

Definition at line 75 of file qatomictype.cpp.

76 {
77  Q_ASSERT(item);
78  if(item.isNode())
79  return false;
80  else
81  {
82  const SchemaType::Ptr t(static_cast<AtomicType *>(item.type().data()));
83  return wxsTypeMatches(t);
84  }
85 }
bool isNode() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:349
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
T * data() const
Returns a pointer to the shared data object.
Definition: qshareddata.h:145
QExplicitlySharedDataPointer< ItemType > type() const
Returns the ItemType this Item is of.
Definition: qitem_p.h:365
virtual bool wxsTypeMatches(const SchemaType::Ptr &other) const
Definition: qanytype.cpp:54

◆ mathematicianLocator()

virtual AtomicMathematicianLocator::Ptr QPatternist::AtomicType::mathematicianLocator ( ) const
pure virtual

◆ xdtTypeMatches()

bool AtomicType::xdtTypeMatches ( const ItemType::Ptr other) const
virtual

Determines whether other is equal to this type, or is a sub-type of this type.

The implementation is generic, relying on operator==() and xdtSuperType().

Implements QPatternist::ItemType.

Reimplemented in QPatternist::NumericType.

Definition at line 62 of file qatomictype.cpp.

63 {
64  if(other->isAtomicType())
65  {
66  if(*other == *this)
67  return true;
68  else
69  return xdtTypeMatches(other->xdtSuperType());
70  }
71  else
72  return false;
73 }
virtual ItemType::Ptr xdtSuperType() const =0
virtual bool isAtomicType() const =0
virtual bool xdtTypeMatches(const ItemType::Ptr &other) const
Definition: qatomictype.cpp:62

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