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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: PVStructure vs Structure |
From: | "Kasemir, Kay via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, "Madden, Timothy J." <tmadden at anl.gov> |
Date: | Fri, 10 Jun 2022 12:38:16 +0000 |
> In pvData, we have PVStructures which I guess define data structures, and Structures which have something to do with introspection.
> What exactly is the difference?
Good question.
In the original pvDataCPP/pvDataJava code, there was a distinction between describing what the data looks like, and a container that actually holds that data.
This has been a stumbling block for me as well because from just the naming in the API I couldn't tell what's what.
In most cases, you need the container:
A server needs to hold the data that it wants to serve.
A client needs to hold the data that it received.
The only case where just need the type info is for the "pvinfo" command.
On the protocol level, a client also receives just the type info when it first connects to a PV, but within a millisecond it then needs to create the container to hold the data.
In the second wave of implementing the protocol, we contemplated just having the container classes. For the "pvinfo" case you would then get a container that happens to be empty. OK, a few wasted "zero" bytes, but cuts the source code and API roughly in half!
With the new Java implementation, that's actually the case, there are only "containers", so a server looks like
https://github.com/ControlSystemStudio/phoebus/blob/master/core/pva/src/test/java/org/epics/pva/server/ServerDemo.java
For the new C++ implementation, the API is also real simple, no step-1-build-description, step-2-build-container:
https://github.com/mdavidsaver/pvxs/blob/master/example/simplesrv.cpp
I'm not sure to which extend the new C++ implementation might internally still have description-without-data, but as an end user you don't really see that.
-Kay
|