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

Convenience Class for NTTable. More...

#include <nttable.h>

Public Member Functions

 POINTER_DEFINITIONS (NTTable)
 
bool isValid ()
 
 ~NTTable ()
 
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 getLabels () const
 
epics::pvData::StringArray const & getColumnNames () const
 
epics::pvData::PVFieldPtr getColumn (std::string const &columnName) const
 
template<typename PVT >
std::tr1::shared_ptr< PVT > getColumn (std::string const &columnName) 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 NTTableBuilderPtr createBuilder ()
 

Static Public Attributes

static const std::string URI
 

Friends

class detail::NTTableBuilder
 

Detailed Description

Convenience Class for NTTable.

Author
mrk

Definition at line 137 of file nttable.h.

Constructor & Destructor Documentation

◆ ~NTTable()

epics::nt::NTTable::~NTTable ( )
inline

Destructor.

Definition at line 237 of file nttable.h.

Member Function Documentation

◆ attachAlarm()

bool epics::nt::NTTable::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 228 of file nttable.cpp.

◆ attachTimeStamp()

bool epics::nt::NTTable::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 219 of file nttable.cpp.

◆ createBuilder()

NTTableBuilderPtr epics::nt::NTTable::createBuilder ( )
static

Creates an NTTable builder instance.

Returns
builder instance.

Definition at line 214 of file nttable.cpp.

◆ getAlarm()

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

Returns the alarm field.

Returns
the alarm field or null if no such field.

Definition at line 252 of file nttable.cpp.

◆ getColumn() [1/2]

PVFieldPtr epics::nt::NTTable::getColumn ( std::string const &  columnName) const

Returns the PVField for the column with the specified colum name.

Parameters
columnNamethe name of the column.
Returns
the field for the column or null if column does not exist.

Definition at line 267 of file nttable.cpp.

◆ getColumn() [2/2]

template<typename PVT >
std::tr1::shared_ptr<PVT> epics::nt::NTTable::getColumn ( std::string const &  columnName) const
inline

Returns the column with the specified column name and of a specified expected type (for example, PVDoubleArray).

Template Parameters
PVTthe expected type of the column which should be be PVScalarArray or a derived class.
Parameters
columnNamethe name of the column.
Returns
the field for the column or null if column does not exist or is not of the specified type.

Definition at line 309 of file nttable.h.

◆ getColumnNames()

StringArray const & epics::nt::NTTable::getColumnNames ( ) const

Returns the column names for the table. For each name, calling getColumn should return the column, which should not be null.

Returns
the column names.

Definition at line 262 of file nttable.cpp.

◆ getDescriptor()

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

Returns the descriptor field.

Returns
the descriptor field or null if no descriptor field.

Definition at line 242 of file nttable.cpp.

◆ getLabels()

PVStringArrayPtr epics::nt::NTTable::getLabels ( ) const

Returns the labels field.

Returns
the labels field.

Definition at line 257 of file nttable.cpp.

◆ getPVStructure()

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

Returns the PVStructure wrapped by this instance.

Returns
the PVStructure wrapped by this instance.

Definition at line 237 of file nttable.cpp.

◆ getTimeStamp()

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

Returns the timeStamp field.

Returns
the timStamp field or null if no such field.

Definition at line 247 of file nttable.cpp.

◆ is_a() [1/2]

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

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

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

◆ is_a() [2/2]

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

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

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

◆ isCompatible() [1/2]

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

Returns whether the specified Structure is compatible with NTTable.

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

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

◆ isCompatible() [2/2]

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

Returns whether the specified PVStructure is compatible with NTTable.

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

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

◆ isValid()

bool epics::nt::NTTable::isValid ( )

Returns whether the specified structure is a valid NTTable.

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 NTTable

Definition at line 188 of file nttable.cpp.

◆ POINTER_DEFINITIONS()

epics::nt::NTTable::POINTER_DEFINITIONS ( NTTable  )

◆ wrap()

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

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

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

Definition at line 130 of file nttable.cpp.

◆ wrapUnsafe()

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

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

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

Parameters
pvStructurethe PVStructure to be wrapped
Returns
NTTable instance wrapping pvStructure

Definition at line 136 of file nttable.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::NTTableBuilder

friend class detail::NTTableBuilder
friend

Definition at line 322 of file nttable.h.

Member Data Documentation

◆ URI

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

Definition at line 142 of file nttable.h.


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