GAMS  1.2.2
gams::pose::ReferenceFrameIdentity Class Reference

For internal use. More...

#include <ReferenceFrame.h>

Public Member Functions

 ReferenceFrameIdentity (std::string id, uint64_t expiry)
 Public by necessity. Use lookup instead. More...
 
void expire_older_than (madara::knowledge::KnowledgeBase &kb, uint64_t time, const FrameEvalSettings &settings=FrameEvalSettings::DEFAULT) const
 
uint64_t expiry (uint64_t age) const
 If a frame newer than this time is saved, expire saved frames of the same ID older than this duration into the past from the timestamp of the new frame. More...
 
uint64_t expiry () const
 Return the current expiry. More...
 
std::shared_ptr< ReferenceFrameVersionget_version (uint64_t timestamp) const
 
const std::string & id () const
 
void register_version (uint64_t timestamp, std::shared_ptr< ReferenceFrameVersion > ver) const
 

Static Public Member Functions

static uint64_t default_expiry (uint64_t age)
 Set the default expiry value for new frames IDs. More...
 
static uint64_t default_expiry ()
 Return the default expiry for new frame IDs. More...
 
static const std::string & default_prefix ()
 
static std::shared_ptr< ReferenceFrameIdentityfind (std::string id)
 
static void gc ()
 Old versions of frames can remain loaded in memory after they are no longer needed. More...
 
static std::shared_ptr< ReferenceFrameIdentitylookup (std::string id)
 
static std::shared_ptr< ReferenceFrameIdentitymake_guid ()
 

Private Attributes

uint64_t expiry_ = -1
 
std::string id_
 
std::map< uint64_t, std::weak_ptr< ReferenceFrameVersion > > versions_
 
std::mutex versions_lock_
 

Static Private Attributes

static uint64_t default_expiry_
 
static std::map< std::string, std::weak_ptr< ReferenceFrameIdentity > > idents_
 
static std::mutex idents_lock_
 

Detailed Description

For internal use.

Use ReferenceFrame or FrameStore.

Represents a frame's identity, persisting across timestamped versions, including id and type.

Definition at line 83 of file ReferenceFrame.h.

Constructor & Destructor Documentation

gams::pose::ReferenceFrameIdentity::ReferenceFrameIdentity ( std::string  id,
uint64_t  expiry 
)
inline

Public by necessity. Use lookup instead.

Definition at line 104 of file ReferenceFrame.h.

Member Function Documentation

static uint64_t gams::pose::ReferenceFrameIdentity::default_expiry ( uint64_t  age)
inlinestatic

Set the default expiry value for new frames IDs.

Setting this will not change any already created frame IDs.

If a frame newer than its expiry is saved, saved frames expire of the same ID older than this duration into the past from the timestamp of the new frame.

Expired frames are deleted from the KnowledgeBase.

Set to -1 (the default) to never expire frames.

Note: if a timestamp -1 frame is saved and this is not -1, all other frames will expire immediately.

Returns
previous default expiry

Definition at line 154 of file ReferenceFrame.h.

static uint64_t gams::pose::ReferenceFrameIdentity::default_expiry ( )
inlinestatic

Return the default expiry for new frame IDs.

Definition at line 163 of file ReferenceFrame.h.

static const std::string& gams::pose::ReferenceFrameIdentity::default_prefix ( )
inlinestatic

Definition at line 199 of file ReferenceFrame.h.

void gams::pose::ReferenceFrameIdentity::expire_older_than ( madara::knowledge::KnowledgeBase &  kb,
uint64_t  time,
const FrameEvalSettings settings = FrameEvalSettings::DEFAULT 
) const
uint64_t gams::pose::ReferenceFrameIdentity::expiry ( uint64_t  age) const
inline

If a frame newer than this time is saved, expire saved frames of the same ID older than this duration into the past from the timestamp of the new frame.

Expired frames are deleted from the KnowledgeBase.

Set to -1 (the default) to never expire frames.

Note: if a timestamp -1 frame is saved and this is not -1, all other frames will expire immediately.

Returns
previous expiry

Definition at line 182 of file ReferenceFrame.h.

uint64_t gams::pose::ReferenceFrameIdentity::expiry ( ) const
inline

Return the current expiry.

Definition at line 191 of file ReferenceFrame.h.

static std::shared_ptr<ReferenceFrameIdentity> gams::pose::ReferenceFrameIdentity::find ( std::string  id)
static
static void gams::pose::ReferenceFrameIdentity::gc ( )
static

Old versions of frames can remain loaded in memory after they are no longer needed.

Call this function to clean them out.

std::shared_ptr<ReferenceFrameVersion> gams::pose::ReferenceFrameIdentity::get_version ( uint64_t  timestamp) const
inline

Definition at line 122 of file ReferenceFrame.h.

const std::string& gams::pose::ReferenceFrameIdentity::id ( ) const
inline

Definition at line 135 of file ReferenceFrame.h.

static std::shared_ptr<ReferenceFrameIdentity> gams::pose::ReferenceFrameIdentity::lookup ( std::string  id)
static
static std::shared_ptr<ReferenceFrameIdentity> gams::pose::ReferenceFrameIdentity::make_guid ( )
static
void gams::pose::ReferenceFrameIdentity::register_version ( uint64_t  timestamp,
std::shared_ptr< ReferenceFrameVersion ver 
) const
inline

Definition at line 113 of file ReferenceFrame.h.

Member Data Documentation

uint64_t gams::pose::ReferenceFrameIdentity::default_expiry_
staticprivate

Definition at line 91 of file ReferenceFrame.h.

uint64_t gams::pose::ReferenceFrameIdentity::expiry_ = -1
mutableprivate

Definition at line 98 of file ReferenceFrame.h.

std::string gams::pose::ReferenceFrameIdentity::id_
private

Definition at line 86 of file ReferenceFrame.h.

std::map<std::string, std::weak_ptr<ReferenceFrameIdentity> > gams::pose::ReferenceFrameIdentity::idents_
staticprivate

Definition at line 89 of file ReferenceFrame.h.

std::mutex gams::pose::ReferenceFrameIdentity::idents_lock_
staticprivate

Definition at line 93 of file ReferenceFrame.h.

std::map<uint64_t, std::weak_ptr<ReferenceFrameVersion> > gams::pose::ReferenceFrameIdentity::versions_
mutableprivate

Definition at line 96 of file ReferenceFrame.h.

std::mutex gams::pose::ReferenceFrameIdentity::versions_lock_
mutableprivate

Definition at line 100 of file ReferenceFrame.h.


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