* pointers and protected objects
@ 2014-10-17 12:51 tonyg
2014-10-17 13:20 ` Simon Wright
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: tonyg @ 2014-10-17 12:51 UTC (permalink / raw)
I can create pointers to protected objects, but how do I initialise the protected object as it is a limited type and the syntax
po_ptr := new Po_Type'(Po_Type_Instance) would not be allowed
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: pointers and protected objects
2014-10-17 12:51 pointers and protected objects tonyg
@ 2014-10-17 13:20 ` Simon Wright
2014-10-17 14:51 ` tonyg
2014-10-17 15:42 ` Adam Beneschan
2014-10-23 8:54 ` tonyg
2 siblings, 1 reply; 7+ messages in thread
From: Simon Wright @ 2014-10-17 13:20 UTC (permalink / raw)
tonyg <tonythegair@gmail.com> writes:
> I can create pointers to protected objects, but how do I initialise
> the protected object as it is a limited type and the syntax
>
> po_ptr := new Po_Type'(Po_Type_Instance) would not be allowed
So far as I am aware, you can't; the PO needs to be self-initializing
(you can give the protected type discriminants, which may help)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: pointers and protected objects
2014-10-17 12:51 pointers and protected objects tonyg
2014-10-17 13:20 ` Simon Wright
@ 2014-10-17 15:42 ` Adam Beneschan
2014-10-23 8:54 ` tonyg
2 siblings, 0 replies; 7+ messages in thread
From: Adam Beneschan @ 2014-10-17 15:42 UTC (permalink / raw)
On Friday, October 17, 2014 5:51:43 AM UTC-7, tonyg wrote:
> I can create pointers to protected objects, but how do I initialise the protected object as it is a limited type and the syntax
>
> po_ptr := new Po_Type'(Po_Type_Instance) would not be allowed
That syntax would mean that a new protected object would be created and Po_Type_Instance would be copied to it. But you can't copy protected objects.
You can, however, say
po_ptr := new Po_Type;
or
po_ptr := new Po_Type'(Some_Function(...));
where Some_Function is a function that returns a Po_Type.
-- Adam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: pointers and protected objects
2014-10-17 12:51 pointers and protected objects tonyg
2014-10-17 13:20 ` Simon Wright
2014-10-17 15:42 ` Adam Beneschan
@ 2014-10-23 8:54 ` tonyg
2 siblings, 0 replies; 7+ messages in thread
From: tonyg @ 2014-10-23 8:54 UTC (permalink / raw)
Thanks for your help all :)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-10-23 8:54 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-17 12:51 pointers and protected objects tonyg
2014-10-17 13:20 ` Simon Wright
2014-10-17 14:51 ` tonyg
2014-10-17 15:36 ` Simon Wright
2014-10-17 17:21 ` AdaMagica
2014-10-17 15:42 ` Adam Beneschan
2014-10-23 8:54 ` tonyg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox