On Nov 21, 2005, at 10:37 , Benjamin Franksen wrote:
On Monday 21 November 2005 15:15, Kay-Uwe Kasemir wrote:
The ca_*puser accessors naturally deal with generic (void *),
^^^^^^^^^
so you might have to cast to/from (Channel *) or whatever custom type
you plan to park in the user pointer.
Being used to programming languages that properly support polymorphic
types, I find (void*) rather artificial ;-/
Ben's right.
I should be careful with 'naturally'.
Computers and programming languages are
about as artificial as one could get,
nothing natural about them at all.
The 'void *' was, for the lack of a better term,
'generic' in the original ChannelAccess C API,
because C happily assigns 'void *' to/from any
pointer.
C++ is more picky, so you need the additional casts.
Or write your own template wrapper around the 'chid',
with your custom type as the template argument,
to have the user pointer accessible without additional
casts.
- References:
- RE: Writing to PVs Liyu, Andrei
- Re: Writing to PVs Kay-Uwe Kasemir
- Re: Writing to PVs Benjamin Franksen
- Navigate by Date:
- Prev:
Re: Writing to PVs Benjamin Franksen
- Next:
CAMAC-based stepper motor controllers Peregrine M. McGehee
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Writing to PVs Benjamin Franksen
- Next:
infrastructure questions rolf
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|