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

Convenience Class for NTNameValue. More...

#include <ntnameValue.h>

Public Member Functions

 POINTER_DEFINITIONS (NTNameValue)
 
bool isValid ()
 
 ~NTNameValue ()
 
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::PVStringArrayPtr getName () const
 
epics::pvData::PVFieldPtr getValue () const
 
template<typename PVT >
std::tr1::shared_ptr< PVT > 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 NTNameValueBuilderPtr createBuilder ()
 

Static Public Attributes

static const std::string URI
 

Friends

class detail::NTNameValueBuilder
 

Detailed Description

Convenience Class for NTNameValue.

Author
mrk

Definition at line 128 of file ntnameValue.h.

Constructor & Destructor Documentation

◆ ~NTNameValue()

epics::nt::NTNameValue::~NTNameValue ( )
inline

Destructor.

Definition at line 227 of file ntnameValue.h.

Member Function Documentation

◆ attachAlarm()

bool epics::nt::NTNameValue::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 180 of file ntnameValue.cpp.

◆ attachTimeStamp()

bool epics::nt::NTNameValue::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 171 of file ntnameValue.cpp.

◆ createBuilder()

NTNameValueBuilderPtr epics::nt::NTNameValue::createBuilder ( )
static

Creates an NTNameValue builder instance.

Returns
builder instance.

Definition at line 166 of file ntnameValue.cpp.

◆ getAlarm()

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

Returns the alarm field.

Returns
the alarm field or null if no alarm field.

Definition at line 204 of file ntnameValue.cpp.

◆ getDescriptor()

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

Returns the descriptor field.

Returns
the descriptor field or null if no descriptor field.

Definition at line 194 of file ntnameValue.cpp.

◆ getName()

PVStringArrayPtr epics::nt::NTNameValue::getName ( ) const

Returns the name array field.

Returns
The PVStringArray for the name.

Definition at line 209 of file ntnameValue.cpp.

◆ getPVStructure()

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

Returns the PVStructure wrapped by this instance.

Returns
the PVStructure wrapped by this instance.

Definition at line 189 of file ntnameValue.cpp.

◆ getTimeStamp()

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

Returns the timeStamp field.

Returns
the timStamp field or null if no timeStamp field.

Definition at line 199 of file ntnameValue.cpp.

◆ getValue() [1/2]

PVFieldPtr epics::nt::NTNameValue::getValue ( ) const

Returns the value array field.

Returns
The PVField for the value.

Definition at line 214 of file ntnameValue.cpp.

◆ getValue() [2/2]

template<typename PVT >
std::tr1::shared_ptr<PVT> epics::nt::NTNameValue::getValue ( ) const
inline

Returns the value array field of a specified expected type (e.g. PVDoubleArray).

Template Parameters
PVTThe expected type of the value field which should be be PVScalarArray or a derived class.
Returns
The PVT array for the value.

Definition at line 289 of file ntnameValue.h.

◆ is_a() [1/2]

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

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

Checks if the specified Structure reports compatibility with this version of NTNameValue 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 NTNameValue.

◆ is_a() [2/2]

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

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

Checks if the specified PVStructure reports compatibility with this version of NTNameValue 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 NTNameValue.

◆ isCompatible() [1/2]

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

Returns whether the specified Structure is compatible with NTNameValue.

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

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

◆ isCompatible() [2/2]

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

Returns whether the specified PVStructure is compatible with NTNameValue.

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

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

◆ isValid()

bool epics::nt::NTNameValue::isValid ( )

Returns whether the wrapped PVStructure is valid with respect to this version of NTNameValue.

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

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

Definition at line 161 of file ntnameValue.cpp.

◆ POINTER_DEFINITIONS()

epics::nt::NTNameValue::POINTER_DEFINITIONS ( NTNameValue  )

◆ wrap()

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

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

Checks the supplied PVStructure is compatible with NTNameValue and if so returns an NTNameValue 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
NTNameValue instance wrapping pvStructure on success, null otherwise.

Definition at line 116 of file ntnameValue.cpp.

◆ wrapUnsafe()

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

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

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

Parameters
pvStructurethe PVStructure to be wrapped.
Returns
NTNameValue instance wrapping pvStructure.

Definition at line 122 of file ntnameValue.cpp.

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

Friends And Related Function Documentation

◆ detail::NTNameValueBuilder

friend class detail::NTNameValueBuilder
friend

Definition at line 301 of file ntnameValue.h.

Member Data Documentation

◆ URI

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

Definition at line 133 of file ntnameValue.h.


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