normativeTypesCPP
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
epics::nt::NTUnion Class Reference

Convenience Class for NTUnion. More...

#include <ntunion.h>

Public Member Functions

 POINTER_DEFINITIONS (NTUnion)
 
bool isValid ()
 
 ~NTUnion ()
 
bool attachTimeStamp (epics::pvData::PVTimeStamp &pvTimeStamp) const
 
bool attachAlarm (epics::pvData::PVAlarm &pvAlarm) const
 
epics::pvData::PVStructurePtr getPVStructure () const
 
epics::pvData::PVStringPtr getDescriptor () const
 
epics::pvData::PVStructurePtr getTimeStamp () const
 
epics::pvData::PVStructurePtr getAlarm () const
 
epics::pvData::PVUnionPtr getValue () const
 

Static Public Member Functions

static shared_pointer wrap (epics::pvData::PVStructurePtr const &pvStructure)
 
static shared_pointer wrapUnsafe (epics::pvData::PVStructurePtr const &pvStructure)
 
static bool is_a (epics::pvData::StructureConstPtr const &structure)
 
static bool is_a (epics::pvData::PVStructurePtr const &pvStructure)
 
static bool isCompatible (epics::pvData::StructureConstPtr const &structure)
 
static bool isCompatible (epics::pvData::PVStructurePtr const &pvStructure)
 
static NTUnionBuilderPtr createBuilder ()
 

Static Public Attributes

static const std::string URI
 

Friends

class detail::NTUnionBuilder
 

Detailed Description

Convenience Class for NTUnion.

Author
dgh

Definition at line 126 of file ntunion.h.

Constructor & Destructor Documentation

◆ ~NTUnion()

epics::nt::NTUnion::~NTUnion ( )
inline

Destructor.

Definition at line 223 of file ntunion.h.

Member Function Documentation

◆ attachAlarm()

bool epics::nt::NTUnion::attachAlarm ( epics::pvData::PVAlarm &  pvAlarm) const

Attaches a PVAlarm to the wrapped PVStructure. Does nothing if no alarm field.

Parameters
pvAlarmthe PVAlarm that will be attached.
Returns
true if the operation was successfull (i.e. this instance has an alarm field), otherwise false.

Definition at line 173 of file ntunion.cpp.

◆ attachTimeStamp()

bool epics::nt::NTUnion::attachTimeStamp ( epics::pvData::PVTimeStamp &  pvTimeStamp) const

Attaches a PVTimeStamp to the wrapped PVStructure. Does nothing if no timeStamp field.

Parameters
pvTimeStampthe PVTimeStamp that will be attached.
Returns
true if the operation was successfull (i.e. this instance has a timeStamp field), otherwise false.

Definition at line 164 of file ntunion.cpp.

◆ createBuilder()

NTUnionBuilderPtr epics::nt::NTUnion::createBuilder ( )
static

Creates an NTUnion builder instance.

Returns
builder instance.

Definition at line 159 of file ntunion.cpp.

◆ getAlarm()

PVStructurePtr epics::nt::NTUnion::getAlarm ( ) const

Returns the alarm field.

Returns
the alarm field or null if no alarm field.

Definition at line 197 of file ntunion.cpp.

◆ getDescriptor()

PVStringPtr epics::nt::NTUnion::getDescriptor ( ) const

Returns the descriptor field.

Returns
the descriptor field or null if no descriptor field.

Definition at line 187 of file ntunion.cpp.

◆ getPVStructure()

PVStructurePtr epics::nt::NTUnion::getPVStructure ( ) const

Returns the PVStructure wrapped by this instance.

Returns
the PVStructure wrapped by this instance.

Definition at line 182 of file ntunion.cpp.

◆ getTimeStamp()

PVStructurePtr epics::nt::NTUnion::getTimeStamp ( ) const

Returns the timeStamp field.

Returns
the timStamp field or null if no timeStamp field.

Definition at line 192 of file ntunion.cpp.

◆ getValue()

PVUnionPtr epics::nt::NTUnion::getValue ( ) const

Returns the value field.

Returns
the value field.

Definition at line 202 of file ntunion.cpp.

◆ is_a() [1/2]

static bool epics::nt::NTUnion::is_a ( epics::pvData::StructureConstPtr const &  structure)
static

Returns whether the specified Structure reports to be a compatible NTUnion.

Checks if the specified Structure reports compatibility with this version of NTUnion through its type ID, including checking version numbers. The return value does not depend on whether the structure is actually compatible in terms of its introspection type.

Parameters
structurethe Structure to test
Returns
(false,true) if the specified Structure (is not, is) a compatible NTUnion

◆ is_a() [2/2]

static bool epics::nt::NTUnion::is_a ( epics::pvData::PVStructurePtr const &  pvStructure)
static

Returns whether the specified PVStructure reports to be a compatible NTUnion.

Checks if the specified PVStructure reports compatibility with this version of NTUnion through its type ID, including checking version numbers. The return value does not depend on whether the structure is actually compatible in terms of its introspection type.

Parameters
pvStructurethe PVStructure to test
Returns
(false,true) if the specified PVStructure (is not, is) a compatible NTUnion

◆ isCompatible() [1/2]

static bool epics::nt::NTUnion::isCompatible ( epics::pvData::StructureConstPtr const &  structure)
static

Returns whether the specified Structure is compatible with NTUnion.

Checks if the specified Structure is compatible with this version of NTUnion through the introspection interface.

Parameters
structurethe Structure to test
Returns
(false,true) if the specified Structure (is not, is) a compatible NTUnion

◆ isCompatible() [2/2]

static bool epics::nt::NTUnion::isCompatible ( epics::pvData::PVStructurePtr const &  pvStructure)
static

Returns whether the specified PVStructure is compatible with NTUnion.

Checks if the specified PVStructure is compatible with this version of NTUnion through the introspection interface

Parameters
pvStructurethe PVStructure to test
Returns
(false,true) if the specified PVStructure (is not, is) a compatible NTUnion

◆ isValid()

bool epics::nt::NTUnion::isValid ( )

Returns whether the wrapped PVStructure is a valid NTUnion.

Unlike isCompatible(), isValid() may perform checks on the value data as well as the introspection data.

Returns
(false,true) if wrapped PVStructure (is not, is) a valid NTUnion

Definition at line 154 of file ntunion.cpp.

◆ POINTER_DEFINITIONS()

epics::nt::NTUnion::POINTER_DEFINITIONS ( NTUnion  )

◆ wrap()

NTUnion::shared_pointer epics::nt::NTUnion::wrap ( epics::pvData::PVStructurePtr const &  pvStructure)
static

Creates an NTUnion wrapping the specified PVStructure if the latter is compatible.

Checks the supplied PVStructure is compatible with NTUnion and if so returns an NTUnion which wraps it. This method will return null if the structure is is not compatible or is null.

Parameters
pvStructurethe PVStructure to be wrapped
Returns
NTUnion instance wrapping pvStructure on success, null otherwise

Definition at line 110 of file ntunion.cpp.

◆ wrapUnsafe()

NTUnion::shared_pointer epics::nt::NTUnion::wrapUnsafe ( epics::pvData::PVStructurePtr const &  pvStructure)
static

Creates an NTUnion wrapping the specified PVStructure, regardless of the latter's compatibility.

No checks are made as to whether the specified PVStructure is compatible with NTUnion or is non-null.

Parameters
pvStructurethe PVStructure to be wrapped
Returns
NTUnion instance wrapping pvStructure

Definition at line 116 of file ntunion.cpp.

References epics::nt::Result::is(), and epics::nt::Result::maybeHas().

Friends And Related Function Documentation

◆ detail::NTUnionBuilder

friend class detail::NTUnionBuilder
friend

Definition at line 276 of file ntunion.h.

Member Data Documentation

◆ URI

const std::string epics::nt::NTUnion::URI
static

Definition at line 131 of file ntunion.h.


The documentation for this class was generated from the following files: