narrow and narrow_unsafe methods added
This commit is contained in:
@@ -184,6 +184,19 @@ void NTMultiChannelBuilder::reset()
|
||||
|
||||
const std::string NTMultiChannel::URI("uri:ev4:nt/2012/pwd:NTMultiChannel");
|
||||
|
||||
NTMultiChannel::shared_pointer NTMultiChannel::narrow(PVStructurePtr const & structure)
|
||||
{
|
||||
if (!structure || !is_a(structure->getStructure()))
|
||||
return shared_pointer();
|
||||
|
||||
return narrow_unsafe(structure);
|
||||
}
|
||||
|
||||
NTMultiChannel::shared_pointer NTMultiChannel::narrow_unsafe(PVStructurePtr const & structure)
|
||||
{
|
||||
return shared_pointer(new NTMultiChannel(structure));
|
||||
}
|
||||
|
||||
bool NTMultiChannel::is_a(StructureConstPtr const &structure)
|
||||
{
|
||||
return structure->getID() == URI;
|
||||
|
||||
@@ -135,6 +135,23 @@ public:
|
||||
POINTER_DEFINITIONS(NTMultiChannel);
|
||||
|
||||
static const std::string URI;
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTMultiChannel.
|
||||
* First the structure ID is checked against NTMultiChannel::URI.
|
||||
* This method will nullptr if the structure is nullptr.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTMultiChannel.
|
||||
* @return NTMultiChannel instance on success, nullptr otherwise.
|
||||
*/
|
||||
static shared_pointer narrow(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTMultiChannel without checking for null-ness or its ID.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTMultiChannel.
|
||||
* @return NTMultiChannel instance.
|
||||
*/
|
||||
static shared_pointer narrow_unsafe(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Is the pvStructure an NTMultiChannel.
|
||||
* @param structure The structure to test.
|
||||
|
||||
@@ -97,6 +97,19 @@ void NTNameValueBuilder::reset()
|
||||
|
||||
const std::string NTNameValue::URI("uri:ev4:nt/2012/pwd:NTNameValue");
|
||||
|
||||
NTNameValue::shared_pointer NTNameValue::narrow(PVStructurePtr const & structure)
|
||||
{
|
||||
if (!structure || !is_a(structure->getStructure()))
|
||||
return shared_pointer();
|
||||
|
||||
return narrow_unsafe(structure);
|
||||
}
|
||||
|
||||
NTNameValue::shared_pointer NTNameValue::narrow_unsafe(PVStructurePtr const & structure)
|
||||
{
|
||||
return shared_pointer(new NTNameValue(structure));
|
||||
}
|
||||
|
||||
bool NTNameValue::is_a(StructureConstPtr const & structure)
|
||||
{
|
||||
return structure->getID() == URI;
|
||||
|
||||
@@ -106,6 +106,22 @@ public:
|
||||
|
||||
static const std::string URI;
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTNameValue.
|
||||
* First the structure ID is checked against NTNameValue::URI.
|
||||
* This method will nullptr if the structure is nullptr.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTNameValue.
|
||||
* @return NTNameValue instance on success, nullptr otherwise.
|
||||
*/
|
||||
static shared_pointer narrow(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTNameValue without checking for null-ness or its ID.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTNameValue.
|
||||
* @return NTNameValue instance.
|
||||
*/
|
||||
static shared_pointer narrow_unsafe(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Is the structure an NTNameValue.
|
||||
* @param structure The structure to test.
|
||||
|
||||
@@ -177,6 +177,19 @@ const std::string ntAttrStr("uri:ev4:nt/2012/pwd:NTAttribute");
|
||||
static FieldCreatePtr fieldCreate = getFieldCreate();
|
||||
static PVDataCreatePtr pvDataCreate = getPVDataCreate();
|
||||
|
||||
NTNDArray::shared_pointer NTNDArray::narrow(PVStructurePtr const & structure)
|
||||
{
|
||||
if (!structure || !is_a(structure->getStructure()))
|
||||
return shared_pointer();
|
||||
|
||||
return narrow_unsafe(structure);
|
||||
}
|
||||
|
||||
NTNDArray::shared_pointer NTNDArray::narrow_unsafe(PVStructurePtr const & structure)
|
||||
{
|
||||
return shared_pointer(new NTNDArray(structure));
|
||||
}
|
||||
|
||||
bool NTNDArray::is_a(StructureConstPtr const & structure)
|
||||
{
|
||||
return structure->getID() == URI;
|
||||
|
||||
@@ -104,6 +104,22 @@ public:
|
||||
|
||||
static const std::string URI;
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTNDArray.
|
||||
* First the structure ID is checked against NTNDArray::URI.
|
||||
* This method will nullptr if the structure is nullptr.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTNDArray.
|
||||
* @return NTNDArray instance on success, nullptr otherwise.
|
||||
*/
|
||||
static shared_pointer narrow(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTNDArray without checking for null-ness or its ID.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTNDArray.
|
||||
* @return NTNDArray instance.
|
||||
*/
|
||||
static shared_pointer narrow_unsafe(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Is the structure an NTNDArray.
|
||||
* @param structure The structure to test.
|
||||
|
||||
@@ -116,6 +116,19 @@ void NTScalarBuilder::reset()
|
||||
|
||||
const std::string NTScalar::URI("uri:ev4:nt/2012/pwd:NTScalar");
|
||||
|
||||
NTScalar::shared_pointer NTScalar::narrow(PVStructurePtr const & structure)
|
||||
{
|
||||
if (!structure || !is_a(structure->getStructure()))
|
||||
return shared_pointer();
|
||||
|
||||
return narrow_unsafe(structure);
|
||||
}
|
||||
|
||||
NTScalar::shared_pointer NTScalar::narrow_unsafe(PVStructurePtr const & structure)
|
||||
{
|
||||
return shared_pointer(new NTScalar(structure));
|
||||
}
|
||||
|
||||
bool NTScalar::is_a(StructureConstPtr const & structure)
|
||||
{
|
||||
return structure->getID() == URI;
|
||||
|
||||
@@ -122,6 +122,22 @@ public:
|
||||
|
||||
static const std::string URI;
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTScalar.
|
||||
* First the structure ID is checked against NTScalar::URI.
|
||||
* This method will nullptr if the structure is nullptr.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTScalar.
|
||||
* @return NTScalar instance on success, nullptr otherwise.
|
||||
*/
|
||||
static shared_pointer narrow(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTScalar without checking for null-ness or its ID.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTScalar.
|
||||
* @return NTScalar instance.
|
||||
*/
|
||||
static shared_pointer narrow_unsafe(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Is the structure an NTScalar.
|
||||
* @param structure The structure to test.
|
||||
|
||||
@@ -116,6 +116,19 @@ void NTScalarArrayBuilder::reset()
|
||||
|
||||
const std::string NTScalarArray::URI("uri:ev4:nt/2012/pwd:NTScalarArray");
|
||||
|
||||
NTScalarArray::shared_pointer NTScalarArray::narrow(PVStructurePtr const & structure)
|
||||
{
|
||||
if (!structure || !is_a(structure->getStructure()))
|
||||
return shared_pointer();
|
||||
|
||||
return narrow_unsafe(structure);
|
||||
}
|
||||
|
||||
NTScalarArray::shared_pointer NTScalarArray::narrow_unsafe(PVStructurePtr const & structure)
|
||||
{
|
||||
return shared_pointer(new NTScalarArray(structure));
|
||||
}
|
||||
|
||||
bool NTScalarArray::is_a(StructureConstPtr const & structure)
|
||||
{
|
||||
return structure->getID() == URI;
|
||||
|
||||
@@ -122,6 +122,23 @@ public:
|
||||
|
||||
static const std::string URI;
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTScalarArray.
|
||||
* First the structure ID is checked against NTScalarArray::URI.
|
||||
* This method will nullptr if the structure is nullptr.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTScalarArray.
|
||||
* @return NTScalarArray instance on success, nullptr otherwise.
|
||||
*/
|
||||
static shared_pointer narrow(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTScalarArray without checking for null-ness or its ID.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTScalarArray.
|
||||
* @return NTScalarArray instance.
|
||||
*/
|
||||
static shared_pointer narrow_unsafe(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
|
||||
/**
|
||||
* Is the structure an NTScalarArray.
|
||||
* @param structure The structure to test.
|
||||
|
||||
@@ -115,6 +115,19 @@ void NTTableBuilder::reset()
|
||||
|
||||
const std::string NTTable::URI("uri:ev4:nt/2012/pwd:NTTable");
|
||||
|
||||
NTTable::shared_pointer NTTable::narrow(PVStructurePtr const & structure)
|
||||
{
|
||||
if (!structure || !is_a(structure->getStructure()))
|
||||
return shared_pointer();
|
||||
|
||||
return narrow_unsafe(structure);
|
||||
}
|
||||
|
||||
NTTable::shared_pointer NTTable::narrow_unsafe(PVStructurePtr const & structure)
|
||||
{
|
||||
return shared_pointer(new NTTable(structure));
|
||||
}
|
||||
|
||||
bool NTTable::is_a(StructureConstPtr const & structure)
|
||||
{
|
||||
return structure->getID() == URI;
|
||||
|
||||
@@ -110,6 +110,22 @@ public:
|
||||
|
||||
static const std::string URI;
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTTable.
|
||||
* First the structure ID is checked against NTTable::URI.
|
||||
* This method will nullptr if the structure is nullptr.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTTable.
|
||||
* @return NTTable instance on success, nullptr otherwise.
|
||||
*/
|
||||
static shared_pointer narrow(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Narrow (aka dynamic cast, or wrap) the structure to NTTable without checking for null-ness or its ID.
|
||||
* @param structure The structure to narrow-ed (dynamic cast, wrapped) to NTTable.
|
||||
* @return NTTable instance.
|
||||
*/
|
||||
static shared_pointer narrow_unsafe(epics::pvData::PVStructurePtr const & structure);
|
||||
|
||||
/**
|
||||
* Is the structure an NTTable.
|
||||
* @param structure The structure to test.
|
||||
|
||||
Reference in New Issue
Block a user