Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::NeXus::NXAttributes Class Reference

Nexus attributes. More...

#include <NexusClasses.h>

Public Member Functions

int n () const
 number of attributes More...
 
std::vector< std::string > names () const
 Returns the list of attribute names. More...
 
std::string operator() (const std::string &name) const
 returns the value of attribute with name name More...
 
void set (const std::string &name, const std::string &value)
 set the attribute's value More...
 
void set (const std::string &name, double value)
 set the attribute's value as a double More...
 
std::vector< std::string > values () const
 Returns the list of attribute values. More...
 

Private Attributes

std::map< std::string, std::string > m_values
 the list of attributes More...
 

Detailed Description

Nexus attributes.

The type of each attribute is NX_CHAR

Definition at line 73 of file NexusClasses.h.

Member Function Documentation

◆ n()

int Mantid::NeXus::NXAttributes::n ( ) const
inline

number of attributes

Definition at line 75 of file NexusClasses.h.

◆ names()

std::vector< std::string > Mantid::NeXus::NXAttributes::names ( ) const

Returns the list of attribute names.

Definition at line 16 of file NexusClasses.cpp.

References m_values, and value.

◆ operator()()

std::string Mantid::NeXus::NXAttributes::operator() ( const std::string &  name) const

returns the value of attribute with name name

Returns the value of an attribute.

Parameters
name:: The name of the attribute
Returns
The value of the attribute if it exists or an empty string otherwise

Definition at line 37 of file NexusClasses.cpp.

References m_values.

◆ set() [1/2]

void Mantid::NeXus::NXAttributes::set ( const std::string &  name,
const std::string &  value 
)

set the attribute's value

Sets the value of the attribute.

Parameters
name:: The name of the attribute
value:: The new value of the attribute

Definition at line 48 of file NexusClasses.cpp.

References m_values, and value.

Referenced by Mantid::NeXus::NXObject::getAttributes().

◆ set() [2/2]

void Mantid::NeXus::NXAttributes::set ( const std::string &  name,
double  value 
)

set the attribute's value as a double

Sets the value of the attribute as a double.

Parameters
name:: The name of the attribute
value:: The new value of the attribute

Definition at line 54 of file NexusClasses.cpp.

References m_values, and value.

◆ values()

std::vector< std::string > Mantid::NeXus::NXAttributes::values ( ) const

Returns the list of attribute values.

Definition at line 24 of file NexusClasses.cpp.

References m_values, and value.

Member Data Documentation

◆ m_values

std::map<std::string, std::string> Mantid::NeXus::NXAttributes::m_values
private

the list of attributes

Definition at line 84 of file NexusClasses.h.

Referenced by names(), operator()(), set(), and values().


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