Hdf5Element Class Reference

An Hdf5Element is the most basic base class of an HDF component. More...

#include <Hdf5Element.h>

Inheritance diagram for Hdf5Element:

Inheritance graph

List of all members.

Public Types

typedef std::map< std::string,
Hdf5Attribute * > 
AttributeContainer

Public Member Functions

Hdf5AttributeaddAttribute (const std::string &name, const DataVariant &value)
const AttributeContainergetAttributes () const
Hdf5AttributegetAttribute (const std::string &name) const
size_t getNumAttributes () const
bool removeAttribute (const std::string &name)
virtual ~Hdf5Element ()

Protected Member Functions

 Hdf5Element (Hdf5Node *pParent, const std::string &name)


Detailed Description

An Hdf5Element is the most basic base class of an HDF component.

It provides access to the name of the item, as well as its attributes.

Definition at line 28 of file Hdf5Element.h.


Member Typedef Documentation

typedef std::map<std::string, Hdf5Attribute*> Hdf5Element::AttributeContainer

The type of container that is used internally to store and manage Hdf5Attributes.

Definition at line 34 of file Hdf5Element.h.


Constructor & Destructor Documentation

virtual Hdf5Element::~Hdf5Element (  )  [virtual]

Destroys an Hdf5Element and all of its attributes.

Hdf5Element::Hdf5Element ( Hdf5Node pParent,
const std::string &  name 
) [protected]

Creates an Hdf5Element object, which is the most basic type of HDF object.

Parameters:
pParent The parent node of this element.
name The name of the HDF object.


Member Function Documentation

Hdf5Attribute* Hdf5Element::addAttribute ( const std::string &  name,
const DataVariant value 
)

Creates an attribute with a given type and number of elements.

For supported types, see DynamicObject::set().

Parameters:
name The name of the attribute.
value The current value of the attribute.
Returns:
Returns a new Hdf5Attribute with the given name and value.

const AttributeContainer& Hdf5Element::getAttributes (  )  const

Gets the element's attributes.

Returns:
Returns the member vector of attributes. NOTE: You cannot call delete on an Hdf5Attribute since its destructor is protected.

Hdf5Attribute* Hdf5Element::getAttribute ( const std::string &  name  )  const

Gets an attribute based on its name.

Parameters:
name The name of the attribute to fetch.
Returns:
Returns a pointer to the Hdf5Attribute with the matching name. If multiple attributes with that name exist, the first one in the vector of attributes is returned. NOTE: You cannot call delete on this pointer since the Hdf5Attribute destructor is protected.

size_t Hdf5Element::getNumAttributes (  )  const

Gets the number of attributes.

Returns:
The number of attributes in the element. Equivalent to calling getAttributes().size().

bool Hdf5Element::removeAttribute ( const std::string &  name  ) 

Removes an attribute from the Hdf5Element.

Parameters:
name The name of the attribute to remove from the Hdf5Element. This is the only way to manually delete an attribute from this object since Hdf5Attribute::~Hdf5Attribute is protected.
Returns:
Returns true if the operation was successful. False, otherwise.


Software Development Kit - Opticks 4.9.0 Build 16218