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: Fri, 30 Sep 2005 06:29:32 -0500
Andrew Johnson wrote:

Marty Kraimer wrote:


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


We might need more than one implementation of the nonmutable string; one where the storage is obtained from the system (new/malloc), and a second where the storage is a char* literal that must not be freed when it's no longer referenced. Compiling DBD files generates literals for record type names, field names and menu choice strings. I think we should just store the char* pointer in these cases without using any kind of string wrapper - if any reference count exists it would have to apply to the descriptor as a whole, not just to the name string.

I like the char * pointer for things like record type names, record instance names, etc.(for java a regular String would accomplish the same thing) This would take care of one main use of names It does mean that we can not completely delete anything that has such names because the storage for at least the name will remain. For example we can not completely delete a record instance. I think this is OK.

In my design any const char* buffer or literal can be wrapped with a ConstString at the point of use if it has to be passed to a routine that takes a StringReader. Ownership would never be passed that way though.

Can we accomplish the same thing without exposing the entire String class?

Something like:

interface DbInstance {
   ConstString *getName();
   ...
}





Replies:
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
Re: data access structures, strings Marty Kraimer
Re: data access structures, strings Andrew Johnson

Navigate by Date:
Prev: RE: data access structures, strings Jeff Hill
Next: Re: PP and MS Marty Kraimer
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: data access structures, strings Jeff Hill
Next: Re: data access structures, strings Andrew Johnson
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 ·