generics and records

spambox_at_volja.net
Date: 02/27/05

  • Next message: Dmitry A. Kazakov: "Re: generics and records"
    Date: 27 Feb 2005 11:34:00 -0800
    
    

    Hello,
    in the process of learning Ada, I came to the problem of generics and
    records. I want to instantiate a package with a record type:

    generic
     type x is private;
    package ...
    private
     type xx is new x;
    end ...

    When I want to use it:

    type myrecord is
     ...
    package somename is new seeabove(myrecord);

    I don't know if this is the correct way. The problem is, how do I make
    a component of myrecord available to the package?

    Thanks,

    andrej


  • Next message: Dmitry A. Kazakov: "Re: generics and records"

    Relevant Pages

    • Re: Generics vs Constants - what criteria do you use to choose between these?
      ... static problem of generics, ... By defining a record type in a global ... package which contains elements for each constant required, ... only the lower level entity/architecture that needs it is modified ...
      (comp.lang.vhdl)
    • Re: Generics vs Constants - what criteria do you use to choose between these?
      ... Constants can be defined in a global package for the project, ... Generics are not locally static, and must be passed down through the ... By defining a record type in a global ... flexibility of design, ease of understanding the design, and ease of ...
      (comp.lang.vhdl)
    • Re: generics and records
      ... I want to instantiate a package with a record type: ... > type x is private; ... The formal part of a generic specifies what the generic needs in order ...
      (comp.lang.ada)
    • Re: Data table text I/O package?
      ... > record type. ... > package, but have to put some code generation into the system (or can ... So the header might be: ... correct type as indicated by the header? ...
      (comp.lang.ada)
    • Re: The Language I want
      ... It has nothing to do with inheritance. ... The point is that visibility belongs to package / module. ... Generics is a huge mess. ... Yes it does it protects members from access by users, ...
      (comp.lang.misc)