Skip to content

Commit

Permalink
add id and parent to pdal::Metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Mar 21, 2012
1 parent f01b2c6 commit 4577f77
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions include/pdal/Metadata.hpp
Expand Up @@ -227,6 +227,23 @@ class PDAL_DLL Metadata
/// returns the attribute value for a given attribute key
std::string getAttribute(std::string const& name) const;

/** @name Parent/child relationships
*/
/// denotes the parent relationship of this instance to another
/// with a given metadata::id
/// @param id the metadata::id of the parent dimension to this instance
inline void setParent( metadata::id const& id)
{
m_parentDimensionID = id;
}

/// @return the metadata::id of the parent Metadata entry to this one.
inline metadata::id const& getParent( ) const
{
return m_parentDimensionID;
}


/** @name private attributes
*/
private:
Expand All @@ -236,6 +253,7 @@ class PDAL_DLL Metadata
metadata::Type m_type;
metadata::MetadataAttributeM m_attributes;
metadata::id m_uuid;
metadata::id m_parentDimensionID;

};

Expand Down
9 changes: 9 additions & 0 deletions src/Metadata.cpp
Expand Up @@ -41,6 +41,11 @@
#include <sstream>
#include <string>

#include <boost/algorithm/string.hpp>
#include <boost/uuid/string_generator.hpp>
#include <boost/uuid/random_generator.hpp>
#include <boost/uuid/uuid_io.hpp>

namespace pdal
{

Expand All @@ -49,6 +54,8 @@ Metadata::Metadata( std::string const& name,
: m_name(name)
, m_namespace(ns)
, m_type(metadata::String)
, m_uuid(boost::uuids::nil_uuid())
, m_parentDimensionID(boost::uuids::nil_uuid())
{
return;
}
Expand All @@ -59,6 +66,8 @@ Metadata::Metadata(const Metadata& other)
, m_name(other.m_name)
, m_namespace(other.m_namespace)
, m_type(other.m_type)
, m_uuid(other.m_uuid)
, m_parentDimensionID(other.m_parentDimensionID)
{
return;
}
Expand Down

0 comments on commit 4577f77

Please sign in to comment.