|
SAGA C++ API 1.5.3
|
The SAGA attribute interface. More...
#include <attribute.hpp>

Public Types | |
| typedef std::vector< std::string > | strvec_type |
| Attribute string vector type. | |
| typedef std::map< std::string, std::string > | strmap_type |
| Attribute string map type. | |
Public Member Functions | |
| impl::attribute_interface * | get_attr (void) const |
| @ impl::attribute_interface* get_attr (void); | |
| template<typename ImplType > | |
| ImplType * | get_target_object () const |
| std::string | get_attribute (std::string const &key) const |
| Gets an attribute value. | |
| void | set_attribute (std::string const &key, std::string const &value) |
| Sets an attribute to a value. | |
| strvec_type | get_vector_attribute (std::string const &key) const |
| Gets the array of values associated with an attribute. | |
| void | set_vector_attribute (std::string const &key, strvec_type const &value) |
| Sets an attribute to an array of values. | |
| void | remove_attribute (std::string const &key) |
| Removes an attribute. | |
| strvec_type | list_attributes () const |
| Gets the list of attribute keys. | |
| strvec_type | find_attributes (std::string const &pattern) const |
| Finds matching attributes. | |
| bool | attribute_exists (std::string const &key) const |
| Checks if the attribute exists. | |
| bool | attribute_is_readonly (std::string const &key) const |
| Checks the attribute mode. | |
| bool | attribute_is_writable (std::string const &key) const |
| Checks the attribute mode. | |
| bool | attribute_is_vector (std::string const &key) const |
| Checks if it is vector. | |
| bool | attribute_is_removable (std::string const &key) const |
| Checks the attribute mode. | |
Protected Member Functions | |
| void | init (char const *const *scalar_ro, char const *const *scalar_rw, char const *const *vector_ro, char const *const *vector_rw) |
| @ Derived& derived() | |
| void | init (bool extensible, bool cache_only=false) |
| void | init_keynames (strvec_type const &keynames) |
| void | init_keynames (char const *const *keynames) |
The SAGA attribute interface.
Classes implementing this interface maintain a set of attributes. These attributes can be considered as a pair of string-based key-value pairs attached to the object. This interface provies methods for querying, adding, and removing attributes.
Usage example:
saga::url lfn("rls://localhost//lfn.dat");
//logical_file implements the attribute interface
logical_file::logical_file lf (lfn);
std::vector<std::string> keys(lf.list_attributes());
std::vector<std::string>::const_iterator end = keys.end();
std::vector<std::string>::const_iterator key_it = keys.begin();
for(; key_it != end; ++key_it) { std::cout << lf.get_attribute(*key_it) << std::endl };
| typedef std::vector<std::string> saga::detail::attribute< Derived >::strvec_type |
Attribute string vector type.
Reimplemented in saga::attribute.
| typedef std::map<std::string, std::string> saga::detail::attribute< Derived >::strmap_type |
Attribute string map type.
Reimplemented in saga::attribute.
| impl::attribute_interface * saga::detail::attribute< Derived >::get_attr | ( | void | ) | const |
@ impl::attribute_interface* get_attr (void);
References saga::IncorrectState.
| ImplType * saga::detail::attribute< Derived >::get_target_object | ( | void | ) | const |
References saga::IncorrectState.
| void saga::detail::attribute< Derived >::init | ( | char const *const * | scalar_ro, |
| char const *const * | scalar_rw, | ||
| char const *const * | vector_ro, | ||
| char const *const * | vector_rw | ||
| ) | [inline, protected] |
@ Derived& derived()
References saga::IncorrectState.
Referenced by saga::advert::directory::directory(), saga::advert::entry::entry(), saga::replica::logical_directory::logical_directory(), and saga::replica::logical_file::logical_file().
| void saga::detail::attribute< Derived >::init | ( | bool | extensible, |
| bool | cache_only = false |
||
| ) | [inline, protected] |
References saga::IncorrectState.
| void saga::detail::attribute< Derived >::init_keynames | ( | strvec_type const & | keynames | ) | [inline, protected] |
References saga::IncorrectState.
| void saga::detail::attribute< Derived >::init_keynames | ( | char const *const * | keynames | ) | [inline, protected] |
References saga::IncorrectState.
| std::string saga::detail::attribute< Derived >::get_attribute | ( | std::string const & | key | ) | const [inline] |
Gets an attribute value.
| key | Attribute key name |
| void saga::detail::attribute< Derived >::set_attribute | ( | std::string const & | key, |
| std::string const & | value | ||
| ) | [inline] |
Sets an attribute to a value.
| key | Attribute key name |
| value | String value to set the attribute to |
| strvec_type saga::detail::attribute< Derived >::get_vector_attribute | ( | std::string const & | key | ) | const [inline] |
Gets the array of values associated with an attribute.
| key | Attribute key name |
| void saga::detail::attribute< Derived >::set_vector_attribute | ( | std::string const & | key, |
| strvec_type const & | value | ||
| ) | [inline] |
Sets an attribute to an array of values.
| key | Attribute key name |
| values | String array of attribute values |
| void saga::detail::attribute< Derived >::remove_attribute | ( | std::string const & | key | ) | [inline] |
Removes an attribute.
| key | Attribute key to be removed |
| strvec_type saga::detail::attribute< Derived >::list_attributes | ( | ) | const [inline] |
Gets the list of attribute keys.
| strvec_type saga::detail::attribute< Derived >::find_attributes | ( | std::string const & | pattern | ) | const [inline] |
Finds matching attributes.
| pattern | Key name search pattern |
| bool saga::detail::attribute< Derived >::attribute_exists | ( | std::string const & | key | ) | const [inline] |
Checks if the attribute exists.
| key | Attribute key name |
| bool saga::detail::attribute< Derived >::attribute_is_readonly | ( | std::string const & | key | ) | const [inline] |
Checks the attribute mode.
| key | Attribute key name. |
| bool saga::detail::attribute< Derived >::attribute_is_writable | ( | std::string const & | key | ) | const [inline] |
Checks the attribute mode.
| key | Attribute key name. |
| bool saga::detail::attribute< Derived >::attribute_is_vector | ( | std::string const & | key | ) | const [inline] |
Checks if it is vector.
| key | Attribute key name. |
| bool saga::detail::attribute< Derived >::attribute_is_removable | ( | std::string const & | key | ) | const [inline] |
Checks the attribute mode.
| key | Attribute key. |