Merge pull request #1655 from borglab/variable-keyformatter
commit
5a3706c6bb
|
@ -10,7 +10,7 @@
|
|||
* -------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @file Key.h
|
||||
* @file Key.cpp
|
||||
* @brief
|
||||
* @author Richard Roberts
|
||||
* @author Alex Cunningham
|
||||
|
@ -26,6 +26,9 @@ using namespace std;
|
|||
|
||||
namespace gtsam {
|
||||
|
||||
/// Assign default key formatter
|
||||
KeyFormatter DefaultKeyFormatter = &_defaultKeyFormatter;
|
||||
|
||||
/* ************************************************************************* */
|
||||
string _defaultKeyFormatter(Key key) {
|
||||
const Symbol asSymbol(key);
|
||||
|
|
|
@ -37,10 +37,16 @@ using KeyFormatter = std::function<std::string(Key)>;
|
|||
// Helper function for DefaultKeyFormatter
|
||||
GTSAM_EXPORT std::string _defaultKeyFormatter(Key key);
|
||||
|
||||
/// The default KeyFormatter, which is used if no KeyFormatter is passed to
|
||||
/// a nonlinear 'print' function. Automatically detects plain integer keys
|
||||
/// and Symbol keys.
|
||||
static const KeyFormatter DefaultKeyFormatter = &_defaultKeyFormatter;
|
||||
/**
|
||||
* The default KeyFormatter, which is used if no KeyFormatter is passed
|
||||
* to a 'print' function.
|
||||
*
|
||||
* Automatically detects plain integer keys and Symbol keys.
|
||||
*
|
||||
* Marked as `extern` so that it can be updated by external libraries.
|
||||
*
|
||||
*/
|
||||
extern GTSAM_EXPORT KeyFormatter DefaultKeyFormatter;
|
||||
|
||||
// Helper function for Multi-robot Key Formatter
|
||||
GTSAM_EXPORT std::string _multirobotKeyFormatter(gtsam::Key key);
|
||||
|
@ -124,7 +130,3 @@ struct traits<Key> {
|
|||
};
|
||||
|
||||
} // namespace gtsam
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue