EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: data access structures, strings
From: Marty Kraimer <[email protected]>
To: [email protected]
Date: Tue, 27 Sep 2005 12:56:37 -0500


Kay-Uwe Kasemir wrote:



In a few more years there will be another language.
Today, however, I have to acknowledge that C++ is the only
practical language for implementing V4.
But the APIs for strings, data access, ... could still
be kept basic enough that SWIG can translate the C++
header files into perl bindings,
a perl script could turn the C++ into objective C,
and the C++ and Java implementations also match.

Meaning:
Use 'assign' instead of 'operator =',
'isEqual' instead of 'operator ==',
'getElement' instead of 'operator []', ...


Shouldn't this also apply to dataAccess? {Or should I say :-) }

I would also like to quote the first sentence of the second paragrah of Stroustrup "The C++ Programming Language" in the chapter titled "Strings"

"Experience shows that it is impossible to design the perfect string"

Working on the V4 database design has made me think about what it needs for strings.

For most strings all it needs is a nonmutable string.
For these it wants to be able to pass a reference to it to arbitrary code.
It needs this for things like record type names, field names, record instance names, menu choice names, etc. etc. Some of these may change but very infrequently. The string always contains UTF-8 encoded strings, which I believe can be printed with a "%s" format if
the string is made available as a "const char *"

Perhaps the only type of string connected with an IOC record that changes frequently is a field in a record type like stringin and stringout. In this case the record support can do what ever it wants to handle the string. It can even just use C style strings!!!

Thus all the IOC database needs is a:

1) nonmutable reference counted continguous string. When the reference count goes to 0 the storage can be reclaimed 2) The ability to copy the value from a nonmutable string to a mutable string.


In Java String and StringBuffer are all that is needed.

In C++ all that is needed is

1) A class that holds UFT-8 encoded non-mutable strings and make the contents available as a "const char *" and it's length. The class keeps a reference count and frees the storage when done. 2) The ability to copy the nonmutable string to a "char *" array allocated by the requester.

That is all.

What the IOC database needs for strings is very different than what dataAccess requires.

Marty


Replies:
RE: data access structures, strings Jeff Hill
Re: data access structures, strings Andrew Johnson
References:
RE: data access structures, strings Jeff Hill
Re: data access structures, strings Kay-Uwe Kasemir
Re: data access structures, strings Andrew Johnson
Re: data access structures, strings Kay-Uwe Kasemir

Navigate by Date:
Prev: Re: strings Kay-Uwe Kasemir
Next: RE: data access structures, strings Jeff Hill
Index: 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: strings Benjamin Franksen
Next: RE: data access structures, strings Jeff Hill
Index: 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·