NuriaProject Framework  0.1
The NuriaProject Framework
Public Member Functions | Friends | List of all members
Nuria::MetaAnnotation Class Reference

The MetaAnnotation class allows access to annotations. More...

#include <metaobject.hpp>

Public Member Functions

 MetaAnnotation ()
 
bool isValid () const
 
QByteArray name () const
 
QVariant value () const
 

Friends

class MetaEnum
 
class MetaField
 
class MetaMethod
 
class MetaObject
 

Detailed Description

The MetaAnnotation class allows access to annotations.

Annotations can be used to store user-defined meta-data for classes, enums, methods and fields.

Usage
Annotations are basically a key-value pair. The key is always a QByteArray, while the value can be of arbitary type. This means you can also store complex types (Other than integers and strings) as long the type is registered in Qts meta system using Q_DECLARE_METATYPE.

The primary macro for this is NURIA_ANNOTATE. This macro takes two arguments, first being the key written as symbol and the second one being the value.

Annotations can be accessed using annotationCount() and annotation() in Nuria::Meta* classes.

Order of annotations
Annotations are always sorted by key in ascending order. There may be multiple annotations of the same key in any given element. If there are multiple annotations with the same key, the order they were written in is retained.

Constructor & Destructor Documentation

Nuria::MetaAnnotation::MetaAnnotation ( )

Returns a invalid instance.

Member Function Documentation

bool Nuria::MetaAnnotation::isValid ( ) const

Returns true if this instance is valid.

QByteArray Nuria::MetaAnnotation::name ( ) const

Returns the name of the annotation.

QVariant Nuria::MetaAnnotation::value ( ) const

Returns the value of the annotation.


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