libpniio
Public Types | Public Member Functions | Private Attributes
pni::io::nx::nxlink< IMPID > Class Template Reference

representation of a NeXus link More...

#include <link.hpp>

Collaboration diagram for pni::io::nx::nxlink< IMPID >:
Collaboration graph
[legend]

Public Types

using parent_type = typename nxobject_trait< IMPID >::group_type
 parent type More...
 
using object_type = typename nxobject_trait< IMPID >::object_type
 object type More...
 
using link_type = nxlink< IMPID >
 link type More...
 

Public Member Functions

 nxlink ()
 default constructor More...
 
 nxlink (const parent_type &parent, const pni::core::string &name)
 constructor More...
 
 nxlink (const parent_type &parent, size_t index)
 constructor More...
 
pni::core::string filename () const noexcept
 get filename More...
 
pni::core::string name () const noexcept
 return the links name More...
 
object_type parent () const noexcept
 return parent object More...
 
nxpath target_path () const
 path to the link target More...
 
nxlink_status status () const
 return link status More...
 
nxlink_type type () const
 return link type More...
 
bool is_valid () const
 checks if a link is valid More...
 
object_type resolve () const
 resolve the link More...
 

Private Attributes

parent_type _parent
 parent object More...
 
pni::core::string _name
 name of the link below the parent More...
 

Detailed Description

template<nximp_code IMPID>
class pni::io::nx::nxlink< IMPID >

The nxlink template represents a single NeXus link. It stores the parent object (group) of the link and its name.

Template Parameters
IMPIDimplementation ID

Member Typedef Documentation

template<nximp_code IMPID>
using pni::io::nx::nxlink< IMPID >::link_type = nxlink<IMPID>
template<nximp_code IMPID>
using pni::io::nx::nxlink< IMPID >::object_type = typename nxobject_trait<IMPID>::object_type
template<nximp_code IMPID>
using pni::io::nx::nxlink< IMPID >::parent_type = typename nxobject_trait<IMPID>::group_type

Constructor & Destructor Documentation

template<nximp_code IMPID>
pni::io::nx::nxlink< IMPID >::nxlink ( )
inline
template<nximp_code IMPID>
pni::io::nx::nxlink< IMPID >::nxlink ( const parent_type parent,
const pni::core::string &  name 
)
inline
Parameters
parentreference to the parent object
namethe name of the link
template<nximp_code IMPID>
pni::io::nx::nxlink< IMPID >::nxlink ( const parent_type parent,
size_t  index 
)
inline
Parameters
parentreference to the parent object
indexnumeric index of the link

Member Function Documentation

template<nximp_code IMPID>
pni::core::string pni::io::nx::nxlink< IMPID >::filename ( ) const
inlinenoexcept

Returns the name of the file where the link is stored.

Returns
filename as string
template<nximp_code IMPID>
bool pni::io::nx::nxlink< IMPID >::is_valid ( ) const
inline

Simple wrapper around status(). If the link is valid this method returns true, false otherwise.

Returns
true if valid, false otherwise
template<nximp_code IMPID>
string pni::io::nx::nxlink< IMPID >::name ( ) const
inlinenoexcept
Returns
name of the link as string
template<nximp_code IMPID>
object_type pni::io::nx::nxlink< IMPID >::parent ( ) const
inlinenoexcept

Return a copy of the parent object below which the link is stored.

Returns
parent object as instance of nxobject
template<nximp_code IMPID>
object_type pni::io::nx::nxlink< IMPID >::resolve ( ) const
inline

Resolve the link and return the object referenced by it. If the link is invalid a link_error exception will be thrown.

Exceptions
link_errorif link cannot be resolved
Returns
instance of nxobject
template<nximp_code IMPID>
nxlink_status pni::io::nx::nxlink< IMPID >::status ( ) const
inlinenoexcept

Return the current status of the link which can be either VALID or INVALID.

Returns
link status
template<nximp_code IMPID>
const nxpath & pni::io::nx::nxlink< IMPID >::target_path ( ) const
inlinenoexcept

Full path to the target to which the link points to.

Returns
target path as instance of nxpath
template<nximp_code IMPID>
nxlink_type pni::io::nx::nxlink< IMPID >::type ( ) const
inlinenoexcept
Returns
type of the link

Field Documentation

template<nximp_code IMPID>
pni::core::string pni::io::nx::nxlink< IMPID >::_name
private
template<nximp_code IMPID>
parent_type pni::io::nx::nxlink< IMPID >::_parent
private

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