This PR fixes issue #33 by ensuring that the target GDD has enough space to accept all elements before copying the value from a source GDD.
In addition to that, this PR adresses two other issues that I found while investigating the issue mentioned earlier:
In addition to preserving meta-data when a monitor requests a DBR_CTRL type, meta-data is now also preserved when a monitor requests a DBR_GR type.
When enum labels are changed on the server side, the gateway now correctly passes on these changes. Before, the gateway would keep sending the old labels in DBR_GR_ENUM and DBR_CTRL_ENUM updates even though it had received and processed updated labels. I found this issue because the code in PCAS had some comment about ensuring that enum labels are copied correctly and when I checked, I found that we were indeed affected by this problem.
Some implementation notes:
I took the basic idea for this patch from the createDBRDD function in casStrmClient.cc of PCAS. That’s how I also found out about the problem with the enum labels.
I copied the the convertContainerMemberToAtomic function from the same source file and adjusted it to our needs.
I used the gddAppType_dbr_* preprocessor macros instead of looking up application types in the gddDbrToAit table. I think that this table is mainly intended for cases where the DBR that shall be looked up is only known at runtime, but for our range checks, we know them at compile time, so we can save the overhead of the lookup.
This PR fixes issue #33 by ensuring that the target GDD has enough space to accept all elements before copying the value from a source GDD.
In addition to that, this PR adresses two other issues that I found while investigating the issue mentioned earlier:
DBR_CTRL
type, meta-data is now also preserved when a monitor requests aDBR_GR
type.DBR_GR_ENUM
andDBR_CTRL_ENUM
updates even though it had received and processed updated labels. I found this issue because the code in PCAS had some comment about ensuring that enum labels are copied correctly and when I checked, I found that we were indeed affected by this problem.Some implementation notes:
createDBRDD
function incasStrmClient.cc
of PCAS. That’s how I also found out about the problem with the enum labels.convertContainerMemberToAtomic
function from the same source file and adjusted it to our needs.gddAppType_dbr_*
preprocessor macros instead of looking up application types in thegddDbrToAit
table. I think that this table is mainly intended for cases where the DBR that shall be looked up is only known at runtime, but for our range checks, we know them at compile time, so we can save the overhead of the lookup.