Experimental Physics and Industrial Control System
Hi:
Assume I have this source data:
struct RGB { int r, g, b; };
struct data
{
double value;
struct RGB color;
};
I can implement a property catalog for the sub-struct:
class RGBCatalog : public propertyCatalog
{ void traverse ( propertyViewer &v) const
{
v.reveal(red_id, rgb->r);
..
and then use that in the PC for the data:
class DataCatalog : public propertyCatalog
{ // constructor somehow gets pointer to 'data',
// prepares RGBCatalog 'color' for data->color
void traverse ( propertyViewer &v) const
{
v.reveal(value_id, data->value);
v.reveal(color_id, color);
...
OK. If I only want the 'value', I use
data_catalog->find(value_id, ...)
and get a 'reveal' callback for the value.
What if my target data is
struct destination
{
double value;
int r, g, b;
}
Is there a way to get
destination->r = data -> color.r;
destination->g = data -> color.g;
?
As far as I see it, I can call
data_catalog->find(color_id, ...).
That results in
reveal(color_id, propertyCatalog &color)
for the whole propertyCatalog for color.
Seems to me that yes, dataAccess helps with handling
containers with differing types for matching properties;
Even containers with differing properties,
but that only on the 'top' level.
Anything one level down must match.
That's the situation where a pulling interface
would be more obvious, because then I can write
the mapping code
destination->r = data_catalog->find("color")->find("red")->toDouble()
----
When I ask the propertyId->getName() to get the property name,
why not return char * "value"?
Instead it's
propertyId->getName(stringSegment s)
and then propertyId will call
s->putChar('v'), s->putChar('a'), s->putChar('l'), ...
That might sound like a very performant and memory-conserving
idea for the channel access library,
but the user of the library still would like to get the property
name, and the required code probably reverses any CPU & mem savings.
-Kay
- Replies:
- RE: data access structures, strings Jeff Hill
- Navigate by Date:
- Prev:
Re: Failure probing for event generator Ernest L. Williams Jr.
- Next:
RE: data access structures, strings Jeff Hill
- Index:
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: Failure probing for event generator Ernest L. Williams Jr.
- Next:
RE: data access structures, strings Jeff Hill
- Index:
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024