U ل=^�T � @ s� d dl Z d dlZddlmZ ddlmZmZmZ dZdZ dZ dd� ZG d d � d e�Z G dd� de �ZG d d� de�Ze� ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Zee�Zdd � Zee�ZG d!d"� d"e�ZG d#d$� d$e�Zeed%�d�ZG d&d'� d'e �ZG d(d)� d)e�Z G d*d+� d+e �Z!G d,d-� d-e �Z"G d.d/� d/e�Z#d<d0d1�Z$d=d2d3�Z%e� Z&e�'� Z(d4d5� Z)d6d7� Z*d8d9� Z+d:d;� Z,dS )>� N� )� allocate_lock)� CDefError�VerificationError�VerificationMissing� � c C s@ | t @ rd|�� }| t@ r(d|�� }| t@ r<d|�� }|S )Nz const z volatile z __restrict )�Q_CONST�lstrip� Q_VOLATILE� Q_RESTRICT)�quals�replace_with� r � /model.py�qualify s r c @ sP e Zd ZdZdZddd�Zdd� Zd d � Zdd� Zdd d�Z dd� Z dd� ZdS )�BaseTypeByIdentityF� �a C filer c C sx | j }|�� }|rB|�d�r.d|kr.d| }n|d dkrBd| }t||�}|�d|�}d|krttd | �� |f ��|S ) N�*z&[�(%s)r z[(� �&�$z-cannot generate '%s' in %s: unknown type name)�c_name_with_marker�strip� startswithr �replacer �_get_c_name)�selfr �contextr �resultr r r � get_c_name s ��zBaseTypeByIdentity.get_c_namec C s | j �dd�S )Nr r )r r �r r r r r / s zBaseTypeByIdentity._get_c_namec C s d| � � kS )Nr �r r# r r r � has_c_name2 s zBaseTypeByIdentity.has_c_namec C s dS �NFr r# r r r �is_integer_type5 s z"BaseTypeByIdentity.is_integer_typec C sB z|j | }W n. tk r< | �||�}|j �| |�}Y nX |S �N)�_cached_btypes�KeyError�build_backend_type� setdefault)r �ffi� finishlist� can_delay�BTypeZBType2r r r �get_cached_btype8 s z#BaseTypeByIdentity.get_cached_btypec C s d| � � f S )Nz<%s>r$ r# r r r �__repr__A s zBaseTypeByIdentity.__repr__c s � fdd�� j D �S )Nc s g | ]}|t � |�f�qS r )�getattr)�.0�namer# r r � <listcomp>E s z1BaseTypeByIdentity._get_items.<locals>.<listcomp>)�_attrs_r# r r# r � _get_itemsD s zBaseTypeByIdentity._get_itemsN)r r r )F)�__name__� __module__�__qualname__� is_array_type�is_raw_functionr"