comp.lang.ada
 help / color / mirror / Atom feed
From: egilhh <egilhovik@hotmail.com>
Subject: Re: (GNADE) Access attribute not allowed in generic body
Date: Thu, 15 Aug 2013 01:37:52 -0700 (PDT)
Date: 2013-08-15T01:37:52-07:00	[thread overview]
Message-ID: <14a38e9e-0449-4df7-8998-930f3c29634b@googlegroups.com> (raw)
In-Reply-To: <c2kkhpusa6e7.1py6twokcaei3$.dlg@40tude.net>

On Thursday, August 15, 2013 9:53:37 AM UTC+2, Dmitry A. Kazakov wrote:
> 
> 2.0. I moved Get and Set to private part of the package and used
> 
> 'Unrestricted_Access in Register. E.g.:


'Unrestricted_Access is Gnat-specific. A more portable alternative would
be constants in the private part of the spec:


> with GNU.DB.SQLCLI.Generic_Attr.String_Attribute;

[...] 
 
> private
> 
>    function Get (Handle    : Ctx;
> 
>                  Attribute : Attr.T;
> 
>                  MaxLength : SQLSMALLINT := 0;
> 
>                  Data      : Attr.Aux;
> 
>                  ErrorCode : access SQLRETURN)
> 
>                 return Attr.Attribute_Value_Pair'Class;
> 
>    procedure Set (Handle    : in  Ctx;
> 
>                   AV_Pair   : in  Attr.Attribute_Value_Pair'Class;
> 
>                   Data      : in  Attr.Aux;
> 
>                   ErrorCode : out SQLRETURN);

Get_Access : constant Attr_Get_Func := Get'Access;
Set_Access : constant Attr_Set_Proc := Set'Access;

> end GNU.DB.SQLCLI.Dispatch.A_String;
> 
> --------------------------------
> 
> package body GNU.DB.SQLCLI.Dispatch.A_String is

[...]

>    procedure Register (Index : in Attr.T) is
> 
>    begin

Get_Dispatch_Array (Index) := Get_Access;
Set_Dispatch_Array (Index) := Set_Access;
 
>    end Register;
> 
> 
> 
> end GNU.DB.SQLCLI.Dispatch.A_String;
> 
> -----------------------------------


  parent reply	other threads:[~2013-08-15  8:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15  7:27 (GNADE) Access attribute not allowed in generic body Dwiki
2013-08-15  7:37 ` Dwiki
2013-08-15  7:53 ` Dmitry A. Kazakov
2013-08-15  8:17   ` Dwiki
2013-08-16 16:46     ` Stephen Leake
2013-08-18 13:40       ` Dwiki
2013-08-15  8:37   ` egilhh [this message]
2013-08-16 16:44   ` Stephen Leake
2013-08-15 13:42 ` Shark8
2013-08-15 15:10   ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox