GAMS  1.4.0
gams::pose::FrameStore Class Reference

Class for storing and loading frames in a given KnowledgeBase, using given settings, with a set expiry. More...

#include <ReferenceFrame.h>

Public Member Functions

 FrameStore (madara::knowledge::KnowledgeBase kb)
 Constructor for FrameStore Uses default FrameEvalSettings Uses ReferenceFrame::default_expiry() for expiration. More...
 
 FrameStore (madara::knowledge::KnowledgeBase kb, FrameEvalSettings settings)
 Constructor for FrameStore Uses ReferenceFrame::default_expiry() for expiration. More...
 
 FrameStore (madara::knowledge::KnowledgeBase kb, FrameEvalSettings settings, uint64_t expiry)
 Primary constructor for FrameStore. More...
 
 FrameStore (madara::knowledge::KnowledgeBase kb, uint64_t expiry)
 Constructor for FrameStore Uses default FrameEvalSettings. More...
 
uint64_t expiry () const
 Return the current expiry for all frames saved with this FrameStore See ReferenceFrame::expiry(uint64_t) for details of expiration. More...
 
const madara::knowledge::KnowledgeBase & kb () const
 Return the KnowledgeBase to load/save with this FrameStore. More...
 
ReferenceFrame load (const std::string &id, uint64_t timestamp=ETERNAL)
 Load a single ReferenceFrame, by ID. More...
 
template<typename Container >
std::vector< ReferenceFrameload_tree (const Container &ids, uint64_t timestamp=ETERNAL) const
 Load ReferenceFrames, by ID, and their common ancestors. More...
 
template<typename InputIterator >
std::vector< ReferenceFrameload_tree (InputIterator begin, InputIterator end, uint64_t timestamp=ETERNAL) const
 Load ReferenceFrames, by ID, and their common ancestors. More...
 
void save (const ReferenceFrame &frame) const
 Save a ReferenceFrame to the knowledge base, The saved frames will be marked with their timestamp for later retrieval. More...
 
const FrameEvalSettingssettings () const
 Return the current settings for frames saved/loaded with this FrameStore. More...
 

Static Public Attributes

static const uint64_t ETERNAL = ReferenceFrameIdentity::ETERNAL
 
static const uint64_t TEMP = ReferenceFrameIdentity::TEMP
 

Private Attributes

uint64_t expiry_
 
madara::knowledge::KnowledgeBase kb_
 
FrameEvalSettings settings_ = FrameEvalSettings::DEFAULT
 

Detailed Description

Class for storing and loading frames in a given KnowledgeBase, using given settings, with a set expiry.

This class itself is immutable, and thus trivially thread-safe.

Definition at line 1123 of file ReferenceFrame.h.

Constructor & Destructor Documentation

◆ FrameStore() [1/4]

gams::pose::FrameStore::FrameStore ( madara::knowledge::KnowledgeBase  kb,
FrameEvalSettings  settings,
uint64_t  expiry 
)
inline

Primary constructor for FrameStore.

Parameters
kbthe KnowledgeBase to use
prefixwithin the KnowledgeBase to use
expiryexpiration to use for all saves

Definition at line 1146 of file ReferenceFrame.h.

◆ FrameStore() [2/4]

gams::pose::FrameStore::FrameStore ( madara::knowledge::KnowledgeBase  kb,
FrameEvalSettings  settings 
)
inline

Constructor for FrameStore Uses ReferenceFrame::default_expiry() for expiration.

Parameters
kbthe KnowledgeBase to use
settingsto use

Definition at line 1157 of file ReferenceFrame.h.

◆ FrameStore() [3/4]

gams::pose::FrameStore::FrameStore ( madara::knowledge::KnowledgeBase  kb,
uint64_t  expiry 
)
inline

Constructor for FrameStore Uses default FrameEvalSettings.

Parameters
kbthe KnowledgeBase to use
expiryexpiration to use for all saves

Definition at line 1168 of file ReferenceFrame.h.

◆ FrameStore() [4/4]

gams::pose::FrameStore::FrameStore ( madara::knowledge::KnowledgeBase  kb)
inline

Constructor for FrameStore Uses default FrameEvalSettings Uses ReferenceFrame::default_expiry() for expiration.

Parameters
kbthe KnowledgeBase to use

Definition at line 1179 of file ReferenceFrame.h.

Member Function Documentation

◆ expiry()

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

Return the current expiry for all frames saved with this FrameStore See ReferenceFrame::expiry(uint64_t) for details of expiration.

Definition at line 1185 of file ReferenceFrame.h.

◆ kb()

const madara::knowledge::KnowledgeBase& gams::pose::FrameStore::kb ( ) const
inline

Return the KnowledgeBase to load/save with this FrameStore.

Definition at line 1191 of file ReferenceFrame.h.

◆ load()

ReferenceFrame gams::pose::FrameStore::load ( const std::string &  id,
uint64_t  timestamp = ETERNAL 
)
inline

Load a single ReferenceFrame, by ID.

Parameters
idthe ID of the frame to load
timestampif ETERNAL, gets the latest frame (no interpolation) Otherwise, gets the frame at a specified timestamp, interpolated necessary.
Returns
the imported ReferenceFrame, or an invalid frame if none exists.

Definition at line 1216 of file ReferenceFrame.h.

◆ load_tree() [1/2]

template<typename Container >
std::vector<ReferenceFrame> gams::pose::FrameStore::load_tree ( const Container &  ids,
uint64_t  timestamp = ETERNAL 
) const
inline

Load ReferenceFrames, by ID, and their common ancestors.

Will interpolate frames to ensure the returned frames all have a common timestamp.

Template Parameters
aContainer, supporting cbegin() and cend(), of item type std::string
Parameters
idsa Container of ids
timestampif ETERNAL, the latest possible tree will be returned. Otherwise, the specified timestamp will be returned.
Returns
a vector of ReferenceFrames, each corresponding to the input IDs, in the same order. If the timestamp specified cannot be satisfied, returns an empty vector.

Definition at line 1261 of file ReferenceFrame.h.

◆ load_tree() [2/2]

template<typename InputIterator >
std::vector<ReferenceFrame> gams::pose::FrameStore::load_tree ( InputIterator  begin,
InputIterator  end,
uint64_t  timestamp = ETERNAL 
) const
inline

Load ReferenceFrames, by ID, and their common ancestors.

Will interpolate frames to ensure the returned frames all have a common timestamp.

Template Parameters
anInputIterator, of item type std::string
Parameters
beginbeginning iterator
endending iterator
timestampif ETERNAL, the latest possible tree will be returned. Otherwise, the specified timestamp will be returned.
Returns
a vector of ReferenceFrames, each corresponding to the input IDs, in the same order. If the timestamp specified cannot be satisfied, returns an empty vector.

Definition at line 1237 of file ReferenceFrame.h.

◆ save()

void gams::pose::FrameStore::save ( const ReferenceFrame frame) const
inline

Save a ReferenceFrame to the knowledge base, The saved frames will be marked with their timestamp for later retrieval.

If timestamp is ETERNAL, it will always be treated as the most recent frame.

Parameters
framethe ReferenceFrame to store

Definition at line 1201 of file ReferenceFrame.h.

◆ settings()

const FrameEvalSettings& gams::pose::FrameStore::settings ( ) const
inline

Return the current settings for frames saved/loaded with this FrameStore.

Definition at line 1188 of file ReferenceFrame.h.

Member Data Documentation

◆ ETERNAL

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

Definition at line 1136 of file ReferenceFrame.h.

◆ expiry_

uint64_t gams::pose::FrameStore::expiry_
private

Definition at line 1133 of file ReferenceFrame.h.

◆ kb_

madara::knowledge::KnowledgeBase gams::pose::FrameStore::kb_
mutableprivate

Definition at line 1130 of file ReferenceFrame.h.

◆ settings_

FrameEvalSettings gams::pose::FrameStore::settings_ = FrameEvalSettings::DEFAULT
private

Definition at line 1132 of file ReferenceFrame.h.

◆ TEMP

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

Definition at line 1137 of file ReferenceFrame.h.


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