GAMS  1.2.2
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, FrameEvalSettings settings, uint64_t expiry)
 Primary constructor for FrameStore. More...
 
 FrameStore (madara::knowledge::KnowledgeBase kb, FrameEvalSettings settings)
 Constructor for FrameStore Uses ReferenceFrame::default_expiry() for expiration. More...
 
 FrameStore (madara::knowledge::KnowledgeBase kb, uint64_t expiry)
 Constructor for FrameStore Uses default FrameEvalSettings. More...
 
 FrameStore (madara::knowledge::KnowledgeBase kb)
 Constructor for FrameStore Uses default FrameEvalSettings Uses ReferenceFrame::default_expiry() for expiration. 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=-1)
 Load a single ReferenceFrame, by ID. More...
 
template<typename InputIterator >
std::vector< ReferenceFrameload_tree (InputIterator begin, InputIterator end, uint64_t timestamp=-1) const
 Load ReferenceFrames, by ID, and their common ancestors. More...
 
template<typename Container >
std::vector< ReferenceFrameload_tree (const Container &ids, uint64_t timestamp=-1) 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...
 

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 952 of file ReferenceFrame.h.

Constructor & Destructor Documentation

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 972 of file ReferenceFrame.h.

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 983 of file ReferenceFrame.h.

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 994 of file ReferenceFrame.h.

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 1005 of file ReferenceFrame.h.

Member Function Documentation

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 1011 of file ReferenceFrame.h.

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

Return the KnowledgeBase to load/save with this FrameStore.

Definition at line 1017 of file ReferenceFrame.h.

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

Load a single ReferenceFrame, by ID.

Parameters
idthe ID of the frame to load
timestampif -1, 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 1042 of file ReferenceFrame.h.

template<typename InputIterator >
std::vector<ReferenceFrame> gams::pose::FrameStore::load_tree ( InputIterator  begin,
InputIterator  end,
uint64_t  timestamp = -1 
) 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 -1, 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 1063 of file ReferenceFrame.h.

template<typename Container >
std::vector<ReferenceFrame> gams::pose::FrameStore::load_tree ( const Container &  ids,
uint64_t  timestamp = -1 
) 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 -1, 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 1087 of file ReferenceFrame.h.

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 -1, it will always be treated as the most recent frame.

Parameters
framethe ReferenceFrame to store

Definition at line 1027 of file ReferenceFrame.h.

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

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

Definition at line 1014 of file ReferenceFrame.h.

Member Data Documentation

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

Definition at line 962 of file ReferenceFrame.h.

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

Definition at line 959 of file ReferenceFrame.h.

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

Definition at line 961 of file ReferenceFrame.h.


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