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

Convenience Class for NTURI. More...

#include <nturi.h>

Public Member Functions

 POINTER_DEFINITIONS (NTURI)
 
bool isValid ()
 
 ~NTURI ()
 
epics::pvData::PVStructurePtr getPVStructure () const
 
epics::pvData::PVStringPtr getScheme () const
 
epics::pvData::PVStringPtr getAuthority () const
 
epics::pvData::PVStringPtr getPath () const
 
epics::pvData::PVStructurePtr getQuery () const
 
epics::pvData::StringArray const & getQueryNames () const
 
epics::pvData::PVFieldPtr getQueryField (std::string const &name) const
 
template<typename PVT >
std::tr1::shared_ptr< PVT > getQueryField (std::string const &name) 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 NTURIBuilderPtr createBuilder ()
 

Static Public Attributes

static const std::string URI
 

Friends

class detail::NTURIBuilder
 

Detailed Description

Convenience Class for NTURI.

Author
dgh

Definition at line 136 of file nturi.h.

Constructor & Destructor Documentation

◆ ~NTURI()

epics::nt::NTURI::~NTURI ( )
inline

Destructor.

Definition at line 236 of file nturi.h.

Member Function Documentation

◆ createBuilder()

NTURIBuilderPtr epics::nt::NTURI::createBuilder ( )
static

Creates an NTURI builder instance.

Returns
builder instance.

Definition at line 193 of file nturi.cpp.

◆ getAuthority()

PVStringPtr epics::nt::NTURI::getAuthority ( ) const

Returns the authority field.

Returns
the authority field or null if no such field.

Definition at line 210 of file nturi.cpp.

◆ getPath()

PVStringPtr epics::nt::NTURI::getPath ( ) const

Returns the path field.

Returns
the path field.

Definition at line 215 of file nturi.cpp.

◆ getPVStructure()

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

Returns the PVStructure wrapped by this instance.

Returns
the PVStructure wrapped by this instance.

Definition at line 199 of file nturi.cpp.

◆ getQuery()

PVStructurePtr epics::nt::NTURI::getQuery ( ) const

Returns the query field.

Returns
the query field or null if no such field.

Definition at line 220 of file nturi.cpp.

◆ getQueryField() [1/2]

PVFieldPtr epics::nt::NTURI::getQueryField ( std::string const &  name) const

Returns the subfield of the query field with the specified name.

Parameters
namethe name of the subfield.
Returns
the the subfield of the query field or null if the field does not exist.

Definition at line 230 of file nturi.cpp.

◆ getQueryField() [2/2]

template<typename PVT >
std::tr1::shared_ptr<PVT> epics::nt::NTURI::getQueryField ( std::string const &  name) const
inline

Returns the subfield of the query field (parameter) with the specified name and of a specified expected type (for example, PVString).

Template Parameters
PVTthe expected type of the subfield which should be be PVString, PVInt pr PVDouble.
Parameters
namethe subfield of the query field or null if the field does not exist or is not of the expected type.
Returns
The PVT field.

Definition at line 293 of file nturi.h.

◆ getQueryNames()

StringArray const & epics::nt::NTURI::getQueryNames ( ) const

Returns the names of the query fields for the URI. For each name, calling getQueryField should return the query field, which should not be null.

Returns
The query field names.

Definition at line 225 of file nturi.cpp.

◆ getScheme()

PVStringPtr epics::nt::NTURI::getScheme ( ) const

Returns the scheme field.

Returns
the scheme field.

Definition at line 205 of file nturi.cpp.

◆ is_a() [1/2]

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

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

Checks if the specified Structure reports compatibility with this version of NTScalar 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 (is not, is) a compatible NTScalar

◆ is_a() [2/2]

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

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

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

◆ isCompatible() [1/2]

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

Returns whether the specified Structure is compatible with NTURI.

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

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

◆ isCompatible() [2/2]

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

Returns whether the specified PVStructure is compatible with NTURI.

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

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

◆ isValid()

bool epics::nt::NTURI::isValid ( )

Returns whether the wrapped PVStructure is a valid NTURI.

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 NTURI.

Definition at line 188 of file nturi.cpp.

◆ POINTER_DEFINITIONS()

epics::nt::NTURI::POINTER_DEFINITIONS ( NTURI  )

◆ wrap()

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

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

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

Definition at line 130 of file nturi.cpp.

◆ wrapUnsafe()

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

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

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

Parameters
pvStructurethe PVStructure to be wrapped
Returns
NTScalar instance wrapping pvStructure

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

friend class detail::NTURIBuilder
friend

Definition at line 305 of file nturi.h.

Member Data Documentation

◆ URI

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

Definition at line 141 of file nturi.h.


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