From 0b3e1c9fd1d6a1d8efc4baa721fdfd2d9058eeae Mon Sep 17 00:00:00 2001 From: Dave Hickin Date: Fri, 21 Aug 2015 01:15:40 +0100 Subject: [PATCH] Add isValid() and overloads of is_a() and isCompatible() Add convenience methods is_a(PVStructure). Add overloads of isCompatible taking a Structure since implementation of isCompatible(PVStructure) only uses introspection interface. Implement for NTScalar and NTScalarArray. Add isValid() function that checks NT is valid through data interface. --- src/nt/ntaggregate.h | 35 ++++++++++++++++++++++++++++---- src/nt/ntattribute.h | 35 ++++++++++++++++++++++++++++---- src/nt/ntenum.h | 35 ++++++++++++++++++++++++++++---- src/nt/ntmatrix.h | 35 +++++++++++++++++++++++++++----- src/nt/ntmultiChannel.h | 38 +++++++++++++++++++++++++++++------ src/nt/ntnameValue.h | 35 ++++++++++++++++++++++++++++---- src/nt/ntndarray.h | 34 +++++++++++++++++++++++++++---- src/nt/ntscalar.h | 33 +++++++++++++++++++++++++++--- src/nt/ntscalarArray.h | 35 +++++++++++++++++++++++++++----- src/nt/ntscalarMultiChannel.h | 38 +++++++++++++++++++++++++++++------ src/nt/nttable.h | 33 +++++++++++++++++++++++++++--- src/nt/ntunion.h | 35 ++++++++++++++++++++++++++++---- 12 files changed, 369 insertions(+), 52 deletions(-) diff --git a/src/nt/ntaggregate.h b/src/nt/ntaggregate.h index 0b231df..70405bf 100644 --- a/src/nt/ntaggregate.h +++ b/src/nt/ntaggregate.h @@ -181,7 +181,7 @@ public: static shared_pointer wrap(epics::pvData::PVStructurePtr const & structure); /** - * Wrap (aka dynamic cast, or wrap) the structure to NTMultiChannel without checking for isCompatible + * Wrap (aka dynamic cast, or wrap) the structure to NTAggregate without checking for isCompatible * @param structure The structure to wrap-ed (dynamic cast, wrapped) to NTAggregate. * @return NTAggregate instance. */ @@ -193,14 +193,41 @@ public: * @return (false,true) if (is not, is) an NTAggregate. */ static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTAggregate. + * Is the structure an NTAggregate. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTAggregate. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTAggregate. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. - * @return (false,true) if (is not, is) an NTMultiChannel. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTAggregate. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTAggregate. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTAggregate. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + + /** + * Checks if the specified structure is a valid NTAggregate. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTAggregate + * @return (false,true) if (is not, is) a valid NTAggregate. + */ + bool isValid(); + /** * Create a NTAggregate builder instance. * @return builder instance. diff --git a/src/nt/ntattribute.h b/src/nt/ntattribute.h index b090660..efebcc2 100644 --- a/src/nt/ntattribute.h +++ b/src/nt/ntattribute.h @@ -139,7 +139,7 @@ public: static shared_pointer wrap(epics::pvData::PVStructurePtr const & structure); /** - * Wrap (aka dynamic cast, or wrap) the structure to NTMultiChannel without checking for isCompatible + * Wrap (aka dynamic cast, or wrap) the structure to NTAttribute without checking for isCompatible * @param structure The structure to wrap-ed (dynamic cast, wrapped) to NTAttribute. * @return NTAttribute instance. */ @@ -151,14 +151,41 @@ public: * @return (false,true) if (is not, is) an NTAttribute. */ static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTAttribute. + * Is the structure an NTAttribute. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTAttribute. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTAttribute. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. - * @return (false,true) if (is not, is) an NTMultiChannel. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTAttribute. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTAttribute. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTAttribute. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + + /** + * Checks if the specified structure is a valid NTAttribute. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTAttribute + * @return (false,true) if (is not, is) a valid NTAttribute. + */ + bool isValid(); + /** * Create a NTAttribute builder instance. * @return builder instance. diff --git a/src/nt/ntenum.h b/src/nt/ntenum.h index 4e7fad8..380cda8 100644 --- a/src/nt/ntenum.h +++ b/src/nt/ntenum.h @@ -132,7 +132,7 @@ public: static shared_pointer wrap(epics::pvData::PVStructurePtr const & structure); /** - * Wrap (aka dynamic cast, or wrap) the structure to NTMultiChannel without checking for isCompatible + * Wrap (aka dynamic cast, or wrap) the structure to NTEnum without checking for isCompatible * @param structure The structure to wrap-ed (dynamic cast, wrapped) to NTEnum. * @return NTEnum instance. */ @@ -144,14 +144,41 @@ public: * @return (false,true) if (is not, is) an NTEnum. */ static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTEnum. + * Is the structure an NTEnum. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTEnum. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTEnum. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. - * @return (false,true) if (is not, is) an NTMultiChannel. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTEnum. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTEnum. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTEnum. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + + /** + * Checks if the specified structure is a valid NTEnum. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTEnum + * @return (false,true) if (is not, is) a valid NTEnum. + */ + bool isValid(); + /** * Create a NTEnum builder instance. * @return builder instance. diff --git a/src/nt/ntmatrix.h b/src/nt/ntmatrix.h index 3eb0757..f078c81 100644 --- a/src/nt/ntmatrix.h +++ b/src/nt/ntmatrix.h @@ -149,28 +149,53 @@ public: static shared_pointer wrap(epics::pvData::PVStructurePtr const & structure); /** - * Wrap (aka dynamic cast, or wrap) the structure to NTMultiChannel without checking for isCompatible + * Wrap (aka dynamic cast, or wrap) the structure to NTMatrix without checking for isCompatible * @param structure The structure to wrap-ed (dynamic cast, wrapped) to NTMatrix. * @return NTMatrix instance. */ static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const & structure); - /** * Is the structure an NTMatrix. * @param structure The structure to test. * @return (false,true) if (is not, is) an NTMatrix. */ static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTMatrix.. + * Is the structure an NTMatrix. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTMatrix. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTMatrix. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. - * @return (false,true) if (is not, is) an NTMultiChannel. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTMatrix. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTMatrix. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTMatrix. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + /** + * Checks if the specified structure is a valid NTMatrix. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTMatrix + * @return (false,true) if (is not, is) a valid NTMatrix. + */ + bool isValid(); + /** * Create a NTMatrix builder instance. * @return builder instance. diff --git a/src/nt/ntmultiChannel.h b/src/nt/ntmultiChannel.h index 8243651..b04aa81 100644 --- a/src/nt/ntmultiChannel.h +++ b/src/nt/ntmultiChannel.h @@ -186,22 +186,48 @@ public: * @return NTMultiChannel instance. */ static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const & structure); + /** - * Is the Structure an NTMultiChannel. - * This method structure->getID() and checks if it is the same as the URI. + * Is the structure an NTMultiChannel. * @param structure The structure to test. * @return (false,true) if (is not, is) an NTMultiChannel. */ - static bool is_a( - epics::pvData::StructureConstPtr const &structure); + static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTMultiChannel. + * Is the structure an NTMultiChannel. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTMultiChannel. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTMultiChannel. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTMultiChannel. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTMultiChannel. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. * @return (false,true) if (is not, is) an NTMultiChannel. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + + /** + * Checks if the specified structure is a valid NTMultiChannel. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTMultiChannel + * @return (false,true) if (is not, is) a valid NTMultiChannel. + */ + bool isValid(); + /** * Create a NTMultiChannelBuilder instance * @return builder instance. diff --git a/src/nt/ntnameValue.h b/src/nt/ntnameValue.h index eb617a1..83ca573 100644 --- a/src/nt/ntnameValue.h +++ b/src/nt/ntnameValue.h @@ -144,7 +144,7 @@ public: static shared_pointer wrap(epics::pvData::PVStructurePtr const & structure); /** - * Wrap (aka dynamic cast, or wrap) the structure to NTMultiChannel without checking for isCompatible + * Wrap (aka dynamic cast, or wrap) the structure to NTNameValue without checking for isCompatible * @param structure The structure to wrap-ed (dynamic cast, wrapped) to NTNameValue. * @return NTNameValue instance. */ @@ -156,14 +156,41 @@ public: * @return (false,true) if (is not, is) an NTNameValue. */ static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTNameValue.. + * Is the structure an NTNameValue. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTNameValue. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTNameValue. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. - * @return (false,true) if (is not, is) an NTMultiChannel. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTNameValue. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTNameValue. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTNameValue. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + + /** + * Checks if the specified structure is a valid NTNameValue. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTNameValue + * @return (false,true) if (is not, is) a valid NTNameValue. + */ + bool isValid(); + /** * Create a NTNameValue builder instance. * @return builder instance. diff --git a/src/nt/ntndarray.h b/src/nt/ntndarray.h index fd0725f..c0490f3 100644 --- a/src/nt/ntndarray.h +++ b/src/nt/ntndarray.h @@ -143,7 +143,7 @@ public: static shared_pointer wrap(epics::pvData::PVStructurePtr const & structure); /** - * Wrap (aka dynamic cast, or wrap) the structure to NTMultiChannel without checking for isCompatible + * Wrap (aka dynamic cast, or wrap) the structure to NTNDArray without checking for isCompatible * @param structure The structure to wrap-ed (dynamic cast, wrapped) to NTNDArray. * @return NTNDArray instance. */ @@ -157,13 +157,39 @@ public: static bool is_a(epics::pvData::StructureConstPtr const & structure); /** - * Is the pvStructure compatible with NTNDArray.. + * Is the structure an NTNDArray. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTNDArray. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTNDArray. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. - * @return (false,true) if (is not, is) an NTMultiChannel. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTNDArray. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTNDArray. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTNDArray. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + + /** + * Checks if the specified structure is a valid NTNDArray. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTNDArray + * @return (false,true) if (is not, is) a valid NTNDArray. + */ + bool isValid(); + /** * Create a NTNDArrayBuilder instance * @return builder instance. diff --git a/src/nt/ntscalar.h b/src/nt/ntscalar.h index 7b2da59..e8fb6ef 100644 --- a/src/nt/ntscalar.h +++ b/src/nt/ntscalar.h @@ -171,14 +171,41 @@ public: * @return (false,true) if (is not, is) an NTScalar. */ static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTScalar. + * Is the structure an NTScalar. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTScalar. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTScalar. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. - * @return (false,true) if (is not, is) an NTMultiChannel. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTScalar. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTScalar. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTScalar. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + + /** + * Checks if the specified structure is a valid NTScalar. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTScalar + * @return (false,true) if (is not, is) a valid NTScalar. + */ + bool isValid(); + /** * Create a NTScalar builder instance. * @return builder instance. diff --git a/src/nt/ntscalarArray.h b/src/nt/ntscalarArray.h index d825322..d6717ab 100644 --- a/src/nt/ntscalarArray.h +++ b/src/nt/ntscalarArray.h @@ -160,28 +160,53 @@ public: static shared_pointer wrap(epics::pvData::PVStructurePtr const & structure); /** - * Wrap (aka dynamic cast, or wrap) the structure to NTMultiChannel without checking for isCompatible + * Wrap (aka dynamic cast, or wrap) the structure to NTMatrix without checking for isCompatible * @param structure The structure to wrap-ed (dynamic cast, wrapped) to NTScalarArray. * @return NTScalarArray instance. */ static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const & structure); - /** * Is the structure an NTScalarArray. * @param structure The structure to test. * @return (false,true) if (is not, is) an NTScalarArray. */ static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTScalarArray.. + * Is the structure an NTScalarArray. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTScalarArray. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTScalarArray. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. - * @return (false,true) if (is not, is) an NTMultiChannel. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTScalarArray. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTScalarArray. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTScalarArray. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + /** + * Checks if the specified structure is a valid NTScalarArray. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTScalarArray + * @return (false,true) if (is not, is) a valid NTScalarArray. + */ + bool isValid(); + /** * Create a NTScalarArray builder instance. * @return builder instance. diff --git a/src/nt/ntscalarMultiChannel.h b/src/nt/ntscalarMultiChannel.h index c202279..3cd0a7f 100644 --- a/src/nt/ntscalarMultiChannel.h +++ b/src/nt/ntscalarMultiChannel.h @@ -187,22 +187,48 @@ public: * @return NTScalarMultiChannel instance. */ static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const & structure); + /** - * Is the Structure an NTScalarMultiChannel. - * This method structure->getID() and checks if it is the same as the URI. + * Is the structure an NTScalarMultiChannel. * @param structure The structure to test. * @return (false,true) if (is not, is) an NTScalarMultiChannel. */ - static bool is_a( - epics::pvData::StructureConstPtr const &structure); + static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTScalarMultiChannel. + * Is the structure an NTScalarMultiChannel. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTScalarMultiChannel. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTScalarMultiChannel. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTScalarMultiChannel. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTScalarMultiChannel. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. * @return (false,true) if (is not, is) an NTScalarMultiChannel. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + + /** + * Checks if the specified structure is a valid NTScalarMultiChannel. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTScalarMultiChannel + * @return (false,true) if (is not, is) a valid NTScalarMultiChannel. + */ + bool isValid(); + /** * Create a NTScalarMultiChannelBuilder instance * @return builder instance. diff --git a/src/nt/nttable.h b/src/nt/nttable.h index 32a2e79..20ede95 100644 --- a/src/nt/nttable.h +++ b/src/nt/nttable.h @@ -164,14 +164,41 @@ public: * @return (false,true) if (is not, is) an NTTable. */ static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTTable. + * Is the structure an NTTable. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTTable. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTTable. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. - * @return (false,true) if (is not, is) an NTMultiChannel. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTTable. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTTable. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTTable. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + + /** + * Checks if the specified structure is a valid NTTable. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTTable + * @return (false,true) if (is not, is) a valid NTTable. + */ + bool isValid(); + /** * Create a NTTable builder instance. * @return builder instance. diff --git a/src/nt/ntunion.h b/src/nt/ntunion.h index f080f84..4aa7f1e 100644 --- a/src/nt/ntunion.h +++ b/src/nt/ntunion.h @@ -134,7 +134,7 @@ public: static shared_pointer wrap(epics::pvData::PVStructurePtr const & structure); /** - * Wrap (aka dynamic cast, or wrap) the structure to NTMultiChannel without checking for isCompatible + * Wrap (aka dynamic cast, or wrap) the structure to NTUnion without checking for isCompatible * @param structure The structure to wrap-ed (dynamic cast, wrapped) to NTUnion. * @return NTUnion instance. */ @@ -146,14 +146,41 @@ public: * @return (false,true) if (is not, is) an NTUnion. */ static bool is_a(epics::pvData::StructureConstPtr const & structure); + /** - * Is the pvStructure compatible with NTUnion. + * Is the structure an NTUnion. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTUnion. + */ + static bool is_a(epics::pvData::PVStructurePtr const & pvStructure); + + /** + * Is the Structure compatible with NTUnion. * This method introspects the fields to see if they are compatible. - * @param pvStructure The pvStructure to test. - * @return (false,true) if (is not, is) an NTMultiChannel. + * @param structure The Structure to test. + * @return (false,true) if (is not, is) an NTUnion. + */ + static bool isCompatible( + epics::pvData::StructureConstPtr const &structure); + + /** + * Is the PVStructure compatible with NTUnion. + * This method introspects the fields to see if they are compatible. + * @param pvStructure The PVStructure to test. + * @return (false,true) if (is not, is) an NTUnion. */ static bool isCompatible( epics::pvData::PVStructurePtr const &pvStructure); + + /** + * Checks if the specified structure is a valid NTUnion. + * + * Checks whether the wrapped structure is valid with respect to this + * version of NTUnion + * @return (false,true) if (is not, is) a valid NTUnion. + */ + bool isValid(); + /** * Create a NTUnion builder instance. * @return builder instance.