Metall  v0.27
A persistent memory allocator for data-centric analytics
metall::unique_object_attr_accessor< _offset_type, _size_type > Class Template Reference

Objet attribute accessor for unique object. More...

#include </home/runner/work/metall/metall/include/metall/object_attribute_accessor.hpp>

Inheritance diagram for metall::unique_object_attr_accessor< _offset_type, _size_type >:
metall::attraccs_detail::general_named_object_attr_accessor< _offset_type, _size_type >

Public Types

using size_type = typename base_type::size_type
 
using name_type = typename base_type::name_type
 
using offset_type = typename base_type::offset_type
 
using length_type = typename base_type::length_type
 
using description_type = typename base_type::description_type
 
using const_iterator = typename base_type::const_iterator
 
- Public Types inherited from metall::attraccs_detail::general_named_object_attr_accessor< _offset_type, _size_type >
using size_type = typename object_directory_type::size_type
 
using name_type = typename object_directory_type::name_type
 
using offset_type = typename object_directory_type::offset_type
 
using length_type = typename object_directory_type::length_type
 
using description_type = typename object_directory_type::description_type
 
using const_iterator = typename object_directory_type::const_iterator
 

Public Member Functions

 unique_object_attr_accessor () noexcept=default
 
 unique_object_attr_accessor (const std::string &object_attribute_file_path) noexcept
 
size_type count (const char *name) const noexcept
 Counts the number of objects with the name. As object name must be unique, only 1 or 0 is returned. More...
 
template<typename T >
size_type count (const decltype(unique_instance) &) const noexcept
 Counts the number of the unique object of type T with the name, i.e., 1 or 0 is returned. More...
 
const_iterator find (const char *name) const noexcept
 Finds the position of the object attribute with 'name'. More...
 
template<typename T >
const_iterator find (const decltype(unique_instance) &) const noexcept
 Finds the position of the attribute of the unique object of type T. More...
 
bool set_description (const_iterator position, const description_type &description) noexcept
 Sets an description. An existing one is overwrite. More...
 
bool set_description (const char *name, const description_type &description) noexcept
 Sets an description. An existing one is overwrite. More...
 
template<typename T >
bool set_description (const decltype(unique_instance) &, const description_type &description) noexcept
 Sets an description to the unique object of type T. An existing one is overwrite. More...
 
- Public Member Functions inherited from metall::attraccs_detail::general_named_object_attr_accessor< _offset_type, _size_type >
 general_named_object_attr_accessor () noexcept=default
 
 general_named_object_attr_accessor (const std::string &object_attribute_file_path) noexcept
 
 general_named_object_attr_accessor (const general_named_object_attr_accessor &other) noexcept
 
 general_named_object_attr_accessor (general_named_object_attr_accessor &&) noexcept=default
 
general_named_object_attr_accessoroperator= (const general_named_object_attr_accessor &other) noexcept
 
general_named_object_attr_accessoroperator= (general_named_object_attr_accessor &&) noexcept=default
 
bool good () const noexcept
 Returns if the internal state is good. More...
 
size_type num_objects () const noexcept
 Returns the number of objects in the directory. More...
 
size_type count (const char *name) const noexcept
 Counts the number of objects with the name. As object name must be unique, only 1 or 0 is returned. More...
 
const_iterator find (const char *name) const noexcept
 Finds the position of the object attribute with 'name'. More...
 
const_iterator begin () const noexcept
 Returns a const iterator that points the beginning of stored object attribute. More...
 
const_iterator end () const noexcept
 Returns a const iterator that points the end of stored object attribute. More...
 
bool set_description (const_iterator position, const description_type &description) noexcept
 Sets an description. An existing one is overwrite. More...
 
bool set_description (const char *name, const description_type &description) noexcept
 Sets an description. An existing one is overwrite. More...
 

Detailed Description

template<typename _offset_type, typename _size_type>
class metall::unique_object_attr_accessor< _offset_type, _size_type >

Objet attribute accessor for unique object.

Template Parameters
_offset_typeOffset type.
_size_typeSize type.

Member Typedef Documentation

◆ size_type

template<typename _offset_type , typename _size_type >
using metall::unique_object_attr_accessor< _offset_type, _size_type >::size_type = typename base_type::size_type

◆ name_type

template<typename _offset_type , typename _size_type >
using metall::unique_object_attr_accessor< _offset_type, _size_type >::name_type = typename base_type::name_type

◆ offset_type

template<typename _offset_type , typename _size_type >
using metall::unique_object_attr_accessor< _offset_type, _size_type >::offset_type = typename base_type::offset_type

◆ length_type

template<typename _offset_type , typename _size_type >
using metall::unique_object_attr_accessor< _offset_type, _size_type >::length_type = typename base_type::length_type

◆ description_type

template<typename _offset_type , typename _size_type >
using metall::unique_object_attr_accessor< _offset_type, _size_type >::description_type = typename base_type::description_type

◆ const_iterator

template<typename _offset_type , typename _size_type >
using metall::unique_object_attr_accessor< _offset_type, _size_type >::const_iterator = typename base_type::const_iterator

Constructor & Destructor Documentation

◆ unique_object_attr_accessor() [1/2]

template<typename _offset_type , typename _size_type >
metall::unique_object_attr_accessor< _offset_type, _size_type >::unique_object_attr_accessor ( )
defaultnoexcept

◆ unique_object_attr_accessor() [2/2]

template<typename _offset_type , typename _size_type >
metall::unique_object_attr_accessor< _offset_type, _size_type >::unique_object_attr_accessor ( const std::string &  object_attribute_file_path)
inlineexplicitnoexcept

Member Function Documentation

◆ count() [1/2]

template<typename _offset_type , typename _size_type >
size_type metall::unique_object_attr_accessor< _offset_type, _size_type >::count ( const char *  name) const
inlinenoexcept

Counts the number of objects with the name. As object name must be unique, only 1 or 0 is returned.

Parameters
nameA name of an object to count.
Returns
Returns 1 if the object exist; otherwise, 0.

◆ count() [2/2]

template<typename _offset_type , typename _size_type >
template<typename T >
size_type metall::unique_object_attr_accessor< _offset_type, _size_type >::count ( const decltype(unique_instance) &  ) const
inlinenoexcept

Counts the number of the unique object of type T with the name, i.e., 1 or 0 is returned.

Template Parameters
TA type of an object.
Returns
Returns 1 if the object exist; otherwise, 0.

◆ find() [1/2]

template<typename _offset_type , typename _size_type >
const_iterator metall::unique_object_attr_accessor< _offset_type, _size_type >::find ( const char *  name) const
inlinenoexcept

Finds the position of the object attribute with 'name'.

Parameters
nameA name of an object to find.
Returns
Returns a const iterator that points the found object attribute. If not found, a returned iterator is equal to that of end().

◆ find() [2/2]

template<typename _offset_type , typename _size_type >
template<typename T >
const_iterator metall::unique_object_attr_accessor< _offset_type, _size_type >::find ( const decltype(unique_instance) &  ) const
inlinenoexcept

Finds the position of the attribute of the unique object of type T.

Template Parameters
TA type of an object.
Returns
Returns a const iterator that points the found object attribute. If not found, a returned iterator is equal to that of end().

◆ set_description() [1/3]

template<typename _offset_type , typename _size_type >
bool metall::unique_object_attr_accessor< _offset_type, _size_type >::set_description ( const_iterator  position,
const description_type description 
)
inlinenoexcept

Sets an description. An existing one is overwrite.

Parameters
positionAn iterator to an object.
descriptionA description string in description_type.
Returns
Returns true if a description is set (stored) successfully. Otherwise, false.

◆ set_description() [2/3]

template<typename _offset_type , typename _size_type >
bool metall::unique_object_attr_accessor< _offset_type, _size_type >::set_description ( const char *  name,
const description_type description 
)
inlinenoexcept

Sets an description. An existing one is overwrite.

Parameters
nameA name of an object.
descriptionA description string in description_type.
Returns
Returns true if a description is set (stored) successfully. Otherwise, false.

◆ set_description() [3/3]

template<typename _offset_type , typename _size_type >
template<typename T >
bool metall::unique_object_attr_accessor< _offset_type, _size_type >::set_description ( const decltype(unique_instance) &  ,
const description_type description 
)
inlinenoexcept

Sets an description to the unique object of type T. An existing one is overwrite.

Template Parameters
TA type of an object.
Parameters
descriptionA description string in description_type.
Returns
Returns true if a description is set (stored) successfully. Otherwise, false.

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