GAMS  1.4.0
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 () const
 Return the current expiry. More...
 
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...
 
void gc_versions ()
 
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 ()
 Return the default expiry for new frame IDs. More...
 
static uint64_t default_expiry (uint64_t age)
 Set the default expiry value for new frames 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 ()
 

Static Public Attributes

static const uint64_t ETERNAL = ReferenceFrame::ETERNAL
 
static const uint64_t TEMP = ReferenceFrame::TEMP
 

Private Attributes

uint64_t expiry_ = ETERNAL
 
std::string id_
 
std::map< uint64_t, std::weak_ptr< ReferenceFrameVersion > > versions_
 
std::recursive_mutex versions_lock_
 

Static Private Attributes

static ReferenceFrameArena arena_
 
static uint64_t default_expiry_
 
static std::recursive_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 105 of file ReferenceFrame.h.

Constructor & Destructor Documentation

◆ ReferenceFrameIdentity()

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

Public by necessity. Use lookup instead.

Definition at line 131 of file ReferenceFrame.h.

Member Function Documentation

◆ default_expiry() [1/2]

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

Return the default expiry for new frame IDs.

Definition at line 205 of file ReferenceFrame.h.

◆ default_expiry() [2/2]

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 ETERNAL (the default) to never expire frames.

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

Returns
previous default expiry

Definition at line 196 of file ReferenceFrame.h.

◆ default_prefix()

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

Definition at line 241 of file ReferenceFrame.h.

◆ expire_older_than()

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

◆ expiry() [1/2]

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

Return the current expiry.

Definition at line 233 of file ReferenceFrame.h.

◆ expiry() [2/2]

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 ETERNAL (the default) to never expire frames.

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

Returns
previous expiry

Definition at line 224 of file ReferenceFrame.h.

◆ find()

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

Definition at line 141 of file ReferenceFrame.h.

◆ gc()

static void gams::pose::ReferenceFrameIdentity::gc ( )
inlinestatic

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

Call this function to clean them out.

Definition at line 250 of file ReferenceFrame.h.

◆ gc_versions()

void gams::pose::ReferenceFrameIdentity::gc_versions ( )

◆ get_version()

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

Definition at line 164 of file ReferenceFrame.h.

◆ id()

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

Definition at line 177 of file ReferenceFrame.h.

◆ lookup()

static std::shared_ptr<ReferenceFrameIdentity> gams::pose::ReferenceFrameIdentity::lookup ( std::string  id)
inlinestatic

Definition at line 134 of file ReferenceFrame.h.

◆ make_guid()

static std::shared_ptr<ReferenceFrameIdentity> gams::pose::ReferenceFrameIdentity::make_guid ( )
inlinestatic

Definition at line 148 of file ReferenceFrame.h.

◆ register_version()

void gams::pose::ReferenceFrameIdentity::register_version ( uint64_t  timestamp,
std::shared_ptr< ReferenceFrameVersion ver 
) const
inline

Definition at line 155 of file ReferenceFrame.h.

Member Data Documentation

◆ arena_

ReferenceFrameArena gams::pose::ReferenceFrameIdentity::arena_
staticprivate

Definition at line 114 of file ReferenceFrame.h.

◆ default_expiry_

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

Definition at line 118 of file ReferenceFrame.h.

◆ ETERNAL

const uint64_t gams::pose::ReferenceFrameIdentity::ETERNAL = ReferenceFrame::ETERNAL
static

Definition at line 108 of file ReferenceFrame.h.

◆ expiry_

uint64_t gams::pose::ReferenceFrameIdentity::expiry_ = ETERNAL
mutableprivate

Definition at line 125 of file ReferenceFrame.h.

◆ id_

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

Definition at line 112 of file ReferenceFrame.h.

◆ idents_lock_

std::recursive_mutex gams::pose::ReferenceFrameIdentity::idents_lock_
staticprivate

Definition at line 120 of file ReferenceFrame.h.

◆ TEMP

const uint64_t gams::pose::ReferenceFrameIdentity::TEMP = ReferenceFrame::TEMP
static

Definition at line 109 of file ReferenceFrame.h.

◆ versions_

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

Definition at line 123 of file ReferenceFrame.h.

◆ versions_lock_

std::recursive_mutex gams::pose::ReferenceFrameIdentity::versions_lock_
mutableprivate

Definition at line 127 of file ReferenceFrame.h.


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