Convenience Class for NTTable.
More...
#include "nttable.h"
Convenience Class for NTTable.
- Author
- mrk
Definition at line 137 of file nttable.h.
epics::nt::NTTable::~NTTable |
( |
| ) |
|
|
inline |
Attaches a PVAlarm to the wrapped PVStructure. Does nothing if no alarm field.
- Parameters
-
pvAlarm | the 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.
232 return pvAlarm.
attach(al);
bool attach(PVFieldPtr const &pvField)
std::tr1::shared_ptr< PVStructure > PVStructurePtr
epics::pvData::PVStructurePtr getAlarm() const
Attaches a PVTimeStamp to the wrapped PVStructure. Does nothing if no timeStamp field.
- Parameters
-
pvTimeStamp | the 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.
223 return pvTimeStamp.
attach(ts);
epics::pvData::PVStructurePtr getTimeStamp() const
std::tr1::shared_ptr< PVStructure > PVStructurePtr
bool attach(PVFieldPtr const &pvField)
Creates an NTTable builder instance.
- Returns
- builder instance.
Definition at line 214 of file nttable.cpp.
std::tr1::shared_ptr< detail::NTTableBuilder > NTTableBuilderPtr
Returns the alarm field.
- Returns
- the alarm field or null if no such field.
Definition at line 252 of file nttable.cpp.
254 return pvNTTable->getSubField<
PVStructure>(
"alarm");
Data interface for a structure,.
PVFieldPtr epics::nt::NTTable::getColumn |
( |
std::string const & |
columnName | ) |
const |
Returns the PVField for the column with the specified colum name.
- Parameters
-
columnName | the 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.
269 return pvValue->getSubField(columnName);
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
-
PVT | the expected type of the column which should be be PVScalarArray or a derived class. |
- Parameters
-
columnName | the 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.
313 return std::tr1::dynamic_pointer_cast<PVT>(pvField);
315 return std::tr1::shared_ptr<PVT>();
epics::pvData::PVFieldPtr getColumn(std::string const &columnName) const
std::tr1::shared_ptr< PVField > PVFieldPtr
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.
264 return pvValue->getStructure()->getFieldNames();
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.
244 return pvNTTable->getSubField<
PVString>(
"descriptor");
PVString is special case, since it implements SerializableArray.
Returns the labels field.
- Returns
- the labels field.
Definition at line 257 of file nttable.cpp.
template class for all extensions of PVArray.
Returns the PVStructure wrapped by this instance.
- Returns
- the PVStructure wrapped by this instance.
Definition at line 237 of file nttable.cpp.
Returns the timeStamp field.
- Returns
- the timStamp field or null if no such field.
Definition at line 247 of file nttable.cpp.
249 return pvNTTable->getSubField<
PVStructure>(
"timeStamp");
Data interface for a structure,.
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
-
structure | the Structure to test |
- Returns
- (false,true) if the specified Structure (is not, is) a compatible NTTable
Definition at line 141 of file nttable.cpp.
static const std::string URI
static bool is_a(const std::string &u1, const std::string &u2)
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
-
pvStructure | the PVStructure to test |
- Returns
- (false,true) if the specified PVStructure (is not, is) a compatible NTTable
Definition at line 146 of file nttable.cpp.
148 return is_a(pvStructure->getStructure());
static bool is_a(epics::pvData::StructureConstPtr const &structure)
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
-
structure | the Structure to test |
- Returns
- (false,true) if the specified Structure (is not, is) a compatible NTTable
Definition at line 151 of file nttable.cpp.
160 .has<Structure>(
"value")
162 .maybeHas<Scalar>(
"descriptor")
164 .maybeHas<&NTField::isTimeStamp, Structure>(
"timeStamp");
170 StringArray::const_iterator it;
172 for (it = names.begin(); it != names.end(); ++it)
std::tr1::shared_ptr< const Structure > StructureConstPtr
This class implements introspection object for a structure.
bool isAlarm(epics::pvData::FieldConstPtr const &field)
This class implements introspection object for scalar array.
std::vector< std::string > StringArray
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
-
pvStructure | the PVStructure to test |
- Returns
- (false,true) if the specified PVStructure (is not, is) a compatible NTTable
Definition at line 181 of file nttable.cpp.
183 if(!pvStructure)
return false;
static bool isCompatible(epics::pvData::StructureConstPtr const &structure)
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.
192 if (
getLabels()->getLength() != columns.size())
return false;
195 for (PVFieldPtrArray::const_iterator it = columns.begin();
196 it != columns.end();++it)
199 if (!column.get())
return false;
206 else if (length != colLength)
virtual std::size_t getLength() const =0
Base class for a scalarArray.
std::vector< PVFieldPtr > PVFieldPtrArray
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r) BOOST_NOEXCEPT
std::tr1::shared_ptr< PVScalarArray > PVScalarArrayPtr
epics::pvData::PVStringArrayPtr getLabels() const
epics::nt::NTTable::POINTER_DEFINITIONS |
( |
NTTable |
| ) |
|
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
-
pvStructure | the PVStructure to be wrapped |
- Returns
- NTTable instance wrapping pvStructure on success, null otherwise
Definition at line 130 of file nttable.cpp.
static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const &pvStructure)
static bool isCompatible(epics::pvData::StructureConstPtr const &structure)
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
-
pvStructure | the PVStructure to be wrapped |
- Returns
- NTTable instance wrapping pvStructure
Definition at line 136 of file nttable.cpp.
138 return shared_pointer(
new NTTable(pvStructure));
const std::string epics::nt::NTTable::URI |
|
static |
The documentation for this class was generated from the following files: