osmium::OSMObject Class Reference

`#include <object.hpp>`

Inheritance diagram for osmium::OSMObject:
[legend]
Collaboration diagram for osmium::OSMObject:
[legend]

## Public Types

typedef osmium::memory::CollectionIterator< Item > | iterator
typedef osmium::memory::CollectionIterator< const Item > | const_iterator
template<typename T >
using | t_iterator = osmium::memory::ItemIterator< T >
template<typename T >
using | t_const_iterator = osmium::memory::ItemIterator< const T >

## Public Member Functions

object_id_type | id () const noexcept
| Get ID of this object. More...
unsigned_object_id_type | positive_id () const noexcept
| Get absolute value of the ID of this object. More...
OSMObject & | set_id (object_id_type id) noexcept
OSMObject & | set_id (const char *id)
bool | deleted () const noexcept
| Is this object marked as deleted? More...
bool | visible () const noexcept
| Is this object marked visible (ie not deleted)? More...
OSMObject & | set_deleted (bool deleted) noexcept
OSMObject & | set_visible (bool visible) noexcept
OSMObject & | set_visible (const char *visible)
object_version_type | version () const noexcept
| Get version of this object. More...
OSMObject & | set_version (object_version_type version) noexcept
OSMObject & | set_version (const char *version)
changeset_id_type | changeset () const noexcept
| Get changeset id of this object. More...
OSMObject & | set_changeset (changeset_id_type changeset) noexcept
OSMObject & | set_changeset (const char *changeset)
user_id_type | uid () const noexcept
| Get user id of this object. More...
OSMObject & | set_uid (user_id_type uid) noexcept
OSMObject & | set_uid_from_signed (signed_user_id_type uid) noexcept
OSMObject & | set_uid (const char *uid)
bool | user_is_anonymous () const noexcept
| Is this user anonymous? More...
osmium::Timestamp | timestamp () const noexcept
| Get timestamp when this object last changed. More...
OSMObject & | set_timestamp (const osmium::Timestamp &timestamp) noexcept
const char * | user () const noexcept
| Get user name for this object. More...
const TagList & | tags () const
| Get the list of tags for this object. More...
const char * | get_value_by_key (const char *key, const char *default_value=nullptr) const noexcept
void | set_attribute (const char *attr, const char *value)
iterator | begin ()
iterator | end ()
const_iterator | cbegin () const
const_iterator | cend () const
const_iterator | begin () const
const_iterator | end () const
template<typename T >
t_iterator< T > | begin ()
template<typename T >
t_iterator< T > | end ()
template<typename T >
t_const_iterator< T > | cbegin () const
template<typename T >
t_const_iterator< T > | cend () const
template<typename T >
t_const_iterator< T > | begin () const
template<typename T >
t_const_iterator< T > | end () const
Public Member Functions inherited from osmium::OSMEntity
| OSMEntity (osmium::memory::item_size_type size, osmium::item_type type)
bool | type_is_in (osmium::osm_entity_bits::type entity_bits) const
Public Member Functions inherited from osmium::memory::Item
unsigned char * | next () noexcept
const unsigned char * | next () const noexcept
item_size_type | byte_size () const noexcept
item_size_type | padded_size () const
item_type | type () const noexcept
bool | removed () const noexcept
void | set_removed (bool removed) noexcept

## Protected Member Functions

| OSMObject (osmium::memory::item_size_type size, osmium::item_type type)
void | set_user_size (string_size_type size)
Protected Member Functions inherited from osmium::memory::Item
| Item (item_size_type size=0, item_type type=item_type()) noexcept
| Item (const Item &)=delete
| Item (Item &&)=delete
Item & | operator= (const Item &)=delete
Item & | operator= (Item &&)=delete
Item & | set_type (const item_type item_type) noexcept

## Private Member Functions

size_t | sizeof_object () const noexcept
unsigned char * | user_position () noexcept
const unsigned char * | user_position () const noexcept
string_size_type | user_size () const noexcept
unsigned char * | subitems_position ()
const unsigned char * | subitems_position () const

## Private Attributes

object_id_type | m_id
bool | m_deleted: 1
object_version_type | m_version: 31
osmium::Timestamp | m_timestamp
user_id_type | m_uid
changeset_id_type | m_changeset

## Detailed Description

OSMObject (Node, Way, Relation, or Area).

## Member Typedef Documentation

typedef osmium::memory::CollectionIterator<const Item> osmium::OSMObject::const_iterator

typedef osmium::memory::CollectionIterator<Item> osmium::OSMObject::iterator

template<typename T >

using osmium::OSMObject::t_const_iterator = osmium::memory::ItemIterator<const T>

template<typename T >

using osmium::OSMObject::t_iterator = osmium::memory::ItemIterator<T>

## Constructor & Destructor Documentation

osmium::OSMObject::OSMObject | ( | osmium::memory::item_size_type | size,
|  | osmium::item_type | type
| ) |  |

inline protected

## Member Function Documentation

iterator osmium::OSMObject::begin | ( |  | ) |

inline

const_iterator osmium::OSMObject::begin | ( |  | ) | const

inline

template<typename T >

t_iterator<T> osmium::OSMObject::begin | ( |  | ) |

inline

template<typename T >

t_const_iterator<T> osmium::OSMObject::begin | ( |  | ) | const

inline

const_iterator osmium::OSMObject::cbegin | ( |  | ) | const

inline

template<typename T >

t_const_iterator<T> osmium::OSMObject::cbegin | ( |  | ) | const

inline

const_iterator osmium::OSMObject::cend | ( |  | ) | const

inline

template<typename T >

t_const_iterator<T> osmium::OSMObject::cend | ( |  | ) | const

inline

changeset_id_type osmium::OSMObject::changeset | ( |  | ) | const

inline noexcept

Get changeset id of this object.

bool osmium::OSMObject::deleted | ( |  | ) | const

inline noexcept

Is this object marked as deleted?

iterator osmium::OSMObject::end | ( |  | ) |

inline

const_iterator osmium::OSMObject::end | ( |  | ) | const

inline

template<typename T >

t_iterator<T> osmium::OSMObject::end | ( |  | ) |

inline

template<typename T >

t_const_iterator<T> osmium::OSMObject::end | ( |  | ) | const

inline

const char* osmium::OSMObject::get_value_by_key | ( | const char * | key,
|  | const char * | default_value = `nullptr`
| ) |  | const

inline noexcept

Get tag value by key.

Convenience function that will forward to same function on TagList object.

object_id_type osmium::OSMObject::id | ( |  | ) | const

inline noexcept

Get ID of this object.

unsigned_object_id_type osmium::OSMObject::positive_id | ( |  | ) | const

inline noexcept

Get absolute value of the ID of this object.

void osmium::OSMObject::set_attribute | ( | const char * | attr,
|  | const char * | value
| ) |  |

inline

Set named attribute.

Parameters

  attr | Name of the attribute (must be one of "id", "version", "changeset", "timestamp", "uid", "visible")
  value | Value of the attribute

OSMObject& osmium::OSMObject::set_changeset | ( | changeset_id_type | changeset | ) |

inline noexcept

Set changeset id of this object.

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_changeset | ( | const char * | changeset | ) |

inline

Set changeset id of this object.

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_deleted | ( | bool | deleted | ) |

inline noexcept

Mark this object as deleted (or not).

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_id | ( | object_id_type | id | ) |

inline noexcept

Set ID of this object.

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_id | ( | const char * | id | ) |

inline

Set ID of this object.

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_timestamp | ( | const osmium::Timestamp & | timestamp | ) |

inline noexcept

Set the timestamp when this object last changed.

Parameters

  timestamp | Timestamp

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_uid | ( | user_id_type | uid | ) |

inline noexcept

Set user id of this object.

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_uid | ( | const char * | uid | ) |

inline

Set user id of this object.

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_uid_from_signed | ( | signed_user_id_type | uid | ) |

inline noexcept

Set user id of this object. Sets uid to 0 (anonymous) if the given uid is smaller than 0.

Returns
  Reference to object to make calls chainable.

void osmium::OSMObject::set_user_size | ( | string_size_type | size | ) |

inline protected

OSMObject& osmium::OSMObject::set_version | ( | object_version_type | version | ) |

inline noexcept

Set object version.

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_version | ( | const char * | version | ) |

inline

Set object version.

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_visible | ( | bool | visible | ) |

inline noexcept

Mark this object as visible (ie not deleted) (or not).

Returns
  Reference to object to make calls chainable.

OSMObject& osmium::OSMObject::set_visible | ( | const char * | visible | ) |

inline

Mark this object as visible (ie not deleted) or deleted.

Parameters

  visible | Either "true" or "false"

Returns
  Reference to object to make calls chainable.

size_t osmium::OSMObject::sizeof_object | ( |  | ) | const

inline private noexcept

unsigned char* osmium::OSMObject::subitems_position | ( |  | ) |

inline private

const unsigned char* osmium::OSMObject::subitems_position | ( |  | ) | const

inline private

const TagList& osmium::OSMObject::tags | ( |  | ) | const

inline

Get the list of tags for this object.

osmium::Timestamp osmium::OSMObject::timestamp | ( |  | ) | const

inline noexcept

Get timestamp when this object last changed.

user_id_type osmium::OSMObject::uid | ( |  | ) | const

inline noexcept

Get user id of this object.

const char* osmium::OSMObject::user | ( |  | ) | const

inline noexcept

Get user name for this object.

bool osmium::OSMObject::user_is_anonymous | ( |  | ) | const

inline noexcept

Is this user anonymous?

unsigned char* osmium::OSMObject::user_position | ( |  | ) |

inline private noexcept

const unsigned char* osmium::OSMObject::user_position | ( |  | ) | const

inline private noexcept

string_size_type osmium::OSMObject::user_size | ( |  | ) | const

inline private noexcept

object_version_type osmium::OSMObject::version | ( |  | ) | const

inline noexcept

Get version of this object.

bool osmium::OSMObject::visible | ( |  | ) | const

inline noexcept

Is this object marked visible (ie not deleted)?

## Member Data Documentation

changeset_id_type osmium::OSMObject::m_changeset

private

bool osmium::OSMObject::m_deleted

private

object_id_type osmium::OSMObject::m_id

private

osmium::Timestamp osmium::OSMObject::m_timestamp

private

user_id_type osmium::OSMObject::m_uid

private

object_version_type osmium::OSMObject::m_version

private

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

- osmium/osm/object.hpp