Osmium  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Attributes
Osmium::OSM::Object Class Reference

#include <object.hpp>

Inheritance diagram for Osmium::OSM::Object:
Inheritance graph
[legend]
Collaboration diagram for Osmium::OSM::Object:
Collaboration graph
[legend]

List of all members.

Classes

struct  JavascriptTemplate

Public Member Functions

osm_object_id_t id () const
Objectid (osm_object_id_t id)
Objectid (const char *id)
osm_version_t version () const
Objectversion (osm_version_t version)
Objectversion (const char *version)
osm_changeset_id_t changeset () const
Objectchangeset (osm_changeset_id_t changeset)
Objectchangeset (const char *changeset)
osm_user_id_t uid () const
Objectuid (osm_user_id_t uid)
Objectuid (const char *uid)
time_t timestamp () const
time_t endtime () const
std::string timestamp_as_string () const
std::string endtime_as_string () const
Objecttimestamp (time_t timestamp)
Objectendtime (time_t timestamp)
Objecttimestamp (const char *timestamp)
const char * user () const
Objectuser (const char *user)
bool visible () const
Objectvisible (bool visible)
Objectvisible (const char *visible)
virtual osm_object_type_t get_type () const =0
void set_attribute (const char *attr, const char *value)
const TagListtags () const
TagListtags ()
void tags (TagList &tags)
v8::Persistent< v8::Object > get_instance () const
v8::Handle< v8::Value > js_id () const
v8::Handle< v8::Value > js_version () const
v8::Handle< v8::Value > js_timestamp_as_string () const
v8::Handle< v8::Value > js_uid () const
v8::Handle< v8::Value > js_user () const
v8::Handle< v8::Value > js_changeset () const
v8::Handle< v8::Value > js_visible () const
v8::Handle< v8::Value > js_tags () const

Public Attributes

v8::Persistent< v8::Object > js_object_instance

Static Public Attributes

static const int max_characters_username = 255
static const int max_utf16_length_username = 2 * (max_characters_username + 1)
 maximum number of UTF-16 units
static const int max_length_username = 255 * 4 + 1
 maximum length of OSM user name (255 UTF-8 characters + null byte)

Protected Member Functions

 Object ()
 Object (const Object &o)
virtual ~Object ()

Private Attributes

osm_object_id_t m_id
 object id
osm_version_t m_version
 object version
osm_changeset_id_t m_changeset
 id of last changeset that changed this object
time_t m_timestamp
 when this object changed last
time_t m_endtime
 when this object version was replaced by a new one
osm_user_id_t m_uid
 user id of user who last changed this object
char m_user [max_length_username]
 name of user who last changed this object
bool m_visible
 object visible (only when working with history data)
TagList m_tags

Detailed Description

Parent class for nodes, ways, and relations.


Constructor & Destructor Documentation

Osmium::OSM::Object::Object ( ) [inline, protected]
Osmium::OSM::Object::Object ( const Object o) [inline, protected]
virtual Osmium::OSM::Object::~Object ( ) [inline, protected, virtual]

Member Function Documentation

Object& Osmium::OSM::Object::changeset ( const char *  changeset) [inline]
time_t Osmium::OSM::Object::endtime ( ) const [inline]
Object& Osmium::OSM::Object::endtime ( time_t  timestamp) [inline]

Set the endtime after which this object is no longer valid. (This is only used when working with history data.)

Parameters:
timestampTime in seconds since epoch.
Returns:
Reference to object to make calls chainable.
std::string Osmium::OSM::Object::endtime_as_string ( ) const [inline]

Get the timestamp until which this object is valid.

Returns:
Timestamp as a string in ISO format (yyyy-mm-ddThh:mm:ssZ). Empty string if unset.
v8::Persistent<v8::Object> Osmium::OSM::Object::get_instance ( ) const [inline]
virtual osm_object_type_t Osmium::OSM::Object::get_type ( ) const [pure virtual]
Object& Osmium::OSM::Object::id ( const char *  id) [inline]
v8::Handle<v8::Value> Osmium::OSM::Object::js_changeset ( ) const [inline]
v8::Handle<v8::Value> Osmium::OSM::Object::js_id ( ) const [inline]
v8::Handle<v8::Value> Osmium::OSM::Object::js_tags ( ) const [inline]
v8::Handle<v8::Value> Osmium::OSM::Object::js_timestamp_as_string ( ) const [inline]
v8::Handle<v8::Value> Osmium::OSM::Object::js_uid ( ) const [inline]
v8::Handle<v8::Value> Osmium::OSM::Object::js_user ( ) const [inline]
v8::Handle<v8::Value> Osmium::OSM::Object::js_version ( ) const [inline]
v8::Handle<v8::Value> Osmium::OSM::Object::js_visible ( ) const [inline]
void Osmium::OSM::Object::set_attribute ( const char *  attr,
const char *  value 
) [inline]

Set named attribute.

Parameters:
attrName of the attribute (must be one of "id", "version", "changeset", "timestamp", "uid", "user", "visible")
valueValue of the attribute
const TagList& Osmium::OSM::Object::tags ( ) const [inline]
void Osmium::OSM::Object::tags ( TagList tags) [inline]
time_t Osmium::OSM::Object::timestamp ( ) const [inline]
Object& Osmium::OSM::Object::timestamp ( time_t  timestamp) [inline]

Set the timestamp when this object last changed.

Parameters:
timestampTime in seconds since epoch.
Returns:
Reference to object to make calls chainable.
Object& Osmium::OSM::Object::timestamp ( const char *  timestamp) [inline]

Set the timestamp when this object last changed.

Parameters:
timestampTimestamp in the format "yyyy-mm-ddThh:mm:ssZ".
Returns:
Reference to object to make calls chainable.
Exceptions:
std::invalid_argumentThrown when the given string can't be parsed as a timestamp. The object timestamp will remain unchanged in this case.
std::string Osmium::OSM::Object::timestamp_as_string ( ) const [inline]

Get the timestamp when this object last changed.

Returns:
Timestamp as a string in ISO format (yyyy-mm-ddThh:mm:ssZ). Empty string if unset.
Object& Osmium::OSM::Object::uid ( const char *  uid) [inline]
const char* Osmium::OSM::Object::user ( ) const [inline]

Get the name of the user who last changed this object.

Returns:
Pointer to internal buffer with user name.
Object& Osmium::OSM::Object::user ( const char *  user) [inline]

Set the name of the user who last changed this object.

Returns:
Reference to object to make calls chainable.
Exceptions:
std::length_errorThrown when the username contains more than max_characters_username (255 UTF-8 characters). When the exception is thrown the username is set to "".
Object& Osmium::OSM::Object::version ( const char *  version) [inline]
bool Osmium::OSM::Object::visible ( ) const [inline]

Get the visible flag of this object. (This is only used in OSM files with history.)

Returns:
Visible flag.
Object& Osmium::OSM::Object::visible ( bool  visible) [inline]

Set the visible flag of this object. (This is only used in OSM files with history.)

Returns:
Reference to object to make calls chainable.
Object& Osmium::OSM::Object::visible ( const char *  visible) [inline]

Set the visible flag of this object. (This is only used in OSM files with history.)

Returns:
Reference to object to make calls chainable.

Member Data Documentation

v8::Persistent<v8::Object> Osmium::OSM::Object::js_object_instance

id of last changeset that changed this object

when this object version was replaced by a new one

object id

when this object changed last

user id of user who last changed this object

name of user who last changed this object

object version

object visible (only when working with history data)

const int Osmium::OSM::Object::max_length_username = 255 * 4 + 1 [static]

maximum length of OSM user name (255 UTF-8 characters + null byte)

maximum number of UTF-16 units


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines