18#ifndef QGSATTRIBUTES_H 
   19#define QGSATTRIBUTES_H 
   30#include <QExplicitlySharedDataPointer> 
   39class QgsFeaturePrivate;
 
   48typedef QMap<int, QgsField> QgsFieldMap;
 
   71      : QVector<QVariant>( size )
 
 
   80      : QVector<QVariant>( size, v )
 
 
   88      : QVector<QVariant>( v )
 
 
  102      if ( size() != v.size() )
 
  104      const QVariant *b = constData();
 
  105      const QVariant *i = b + size();
 
  106      const QVariant *j = v.constData() + size();
 
 
  131      if ( index < 0 || index >= size() )
 
  134      return at( index ).userType() == QMetaType::type( 
"QgsUnsetAttributeValue" );
 
 
 
  152  % ConvertFromTypeCode
 
  156  if ( ( l = PyList_New( sipCpp->size() ) ) == NULL )
 
  160  for ( 
int i = 0; i < sipCpp->size(); ++i )
 
  162    QVariant *v = 
new QVariant( sipCpp->at( i ) );
 
  165    if ( ( tobj = sipConvertFromNewType( v, sipType_QVariant, Py_None ) ) == NULL )
 
  173    PyList_SET_ITEM( l, i, tobj );
 
  181  if ( sipIsErr == NULL )
 
  183    if ( !PyList_Check( sipPy ) )
 
  186    for ( SIP_SSIZE_T i = 0; i < PyList_GET_SIZE( sipPy ); ++i )
 
  187      if ( !sipCanConvertToType( PyList_GET_ITEM( sipPy, i ), sipType_QVariant, SIP_NOT_NONE ) )
 
  194  SIP_SSIZE_T listSize = PyList_GET_SIZE( sipPy );
 
  195  qv->reserve( listSize );
 
  197  for ( SIP_SSIZE_T i = 0; i < listSize; ++i )
 
  199    PyObject *obj = PyList_GET_ITEM( sipPy, i );
 
  200    if ( obj == Py_None )
 
  202      qv->append( QVariant( QVariant::Int ) );
 
  207      QVariant *t = 
reinterpret_cast<QVariant *
>( sipConvertToType( obj, sipType_QVariant, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr ) );
 
  211        sipReleaseType( t, sipType_QVariant, state );
 
  218      sipReleaseType( t, sipType_QVariant, state );
 
  224  return sipGetState( sipTransferObj );
 
bool operator!=(const QgsAttributes &v) const
QgsAttributes(int size)
Create a new vector of attributes with the given size.
bool isUnsetValue(int index) const
Returns true if the attribute at the specified index is an unset value.
QgsAttributes(int size, const QVariant &v)
Constructs a vector with an initial size of size elements.
bool operator==(const QgsAttributes &v) const
Compares two vectors of attributes.
QgsAttributes()=default
Constructor for QgsAttributes.
QgsAttributes(const QVector< QVariant > &v)
Copies another vector of attributes.
CORE_EXPORT QgsAttributeMap toMap() const
Returns a QgsAttributeMap of the attribute values.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
A rectangle specified with double values.
static bool isNull(const QVariant &variant, bool silenceNullWarnings=false)
Returns true if the specified variant should be considered a NULL value.
CORE_EXPORT uint qHash(const QgsAttributes &attributes)
Hash for QgsAttributes.
QMap< int, QString > QgsFieldNameMap
QMap< int, QVariant > QgsAttributeMap