Disabled serialization syntactic sugar functions
parent
cf5a43a6c6
commit
5a7ee5f146
82
gtsam.h
82
gtsam.h
|
@ -2110,47 +2110,47 @@ pair<gtsam::NonlinearFactorGraph*, gtsam::Values*> load2D_robust(string filename
|
||||||
//*************************************************************************
|
//*************************************************************************
|
||||||
// Serialization
|
// Serialization
|
||||||
//*************************************************************************
|
//*************************************************************************
|
||||||
#include <gtsam/slam/serialization.h>
|
//#include <gtsam/slam/serialization.h>
|
||||||
|
//
|
||||||
// Serialize/Deserialize a NonlinearFactorGraph
|
//// Serialize/Deserialize a NonlinearFactorGraph
|
||||||
string serializeGraph(const gtsam::NonlinearFactorGraph& graph);
|
//string serializeGraph(const gtsam::NonlinearFactorGraph& graph);
|
||||||
|
//
|
||||||
gtsam::NonlinearFactorGraph* deserializeGraph(string serialized_graph);
|
//gtsam::NonlinearFactorGraph* deserializeGraph(string serialized_graph);
|
||||||
|
//
|
||||||
string serializeGraphXML(const gtsam::NonlinearFactorGraph& graph);
|
//string serializeGraphXML(const gtsam::NonlinearFactorGraph& graph);
|
||||||
string serializeGraphXML(const gtsam::NonlinearFactorGraph& graph, string name);
|
//string serializeGraphXML(const gtsam::NonlinearFactorGraph& graph, string name);
|
||||||
|
//
|
||||||
gtsam::NonlinearFactorGraph* deserializeGraphXML(string serialized_graph);
|
//gtsam::NonlinearFactorGraph* deserializeGraphXML(string serialized_graph);
|
||||||
gtsam::NonlinearFactorGraph* deserializeGraphXML(string serialized_graph, string name);
|
//gtsam::NonlinearFactorGraph* deserializeGraphXML(string serialized_graph, string name);
|
||||||
|
//
|
||||||
// Serialize/Deserialize a Values
|
//// Serialize/Deserialize a Values
|
||||||
string serializeValues(const gtsam::Values& values);
|
//string serializeValues(const gtsam::Values& values);
|
||||||
|
//
|
||||||
gtsam::Values* deserializeValues(string serialized_values);
|
//gtsam::Values* deserializeValues(string serialized_values);
|
||||||
|
//
|
||||||
string serializeValuesXML(const gtsam::Values& values);
|
//string serializeValuesXML(const gtsam::Values& values);
|
||||||
string serializeValuesXML(const gtsam::Values& values, string name);
|
//string serializeValuesXML(const gtsam::Values& values, string name);
|
||||||
|
//
|
||||||
gtsam::Values* deserializeValuesXML(string serialized_values);
|
//gtsam::Values* deserializeValuesXML(string serialized_values);
|
||||||
gtsam::Values* deserializeValuesXML(string serialized_values, string name);
|
//gtsam::Values* deserializeValuesXML(string serialized_values, string name);
|
||||||
|
//
|
||||||
// Serialize
|
//// Serialize
|
||||||
bool serializeGraphToFile(const gtsam::NonlinearFactorGraph& graph, string fname);
|
//bool serializeGraphToFile(const gtsam::NonlinearFactorGraph& graph, string fname);
|
||||||
bool serializeGraphToXMLFile(const gtsam::NonlinearFactorGraph& graph, string fname);
|
//bool serializeGraphToXMLFile(const gtsam::NonlinearFactorGraph& graph, string fname);
|
||||||
bool serializeGraphToXMLFile(const gtsam::NonlinearFactorGraph& graph, string fname, string name);
|
//bool serializeGraphToXMLFile(const gtsam::NonlinearFactorGraph& graph, string fname, string name);
|
||||||
|
//
|
||||||
bool serializeValuesToFile(const gtsam::Values& values, string fname);
|
//bool serializeValuesToFile(const gtsam::Values& values, string fname);
|
||||||
bool serializeValuesToXMLFile(const gtsam::Values& values, string fname);
|
//bool serializeValuesToXMLFile(const gtsam::Values& values, string fname);
|
||||||
bool serializeValuesToXMLFile(const gtsam::Values& values, string fname, string name);
|
//bool serializeValuesToXMLFile(const gtsam::Values& values, string fname, string name);
|
||||||
|
//
|
||||||
// Deserialize
|
//// Deserialize
|
||||||
gtsam::NonlinearFactorGraph* deserializeGraphFromFile(string fname);
|
//gtsam::NonlinearFactorGraph* deserializeGraphFromFile(string fname);
|
||||||
gtsam::NonlinearFactorGraph* deserializeGraphFromXMLFile(string fname);
|
//gtsam::NonlinearFactorGraph* deserializeGraphFromXMLFile(string fname);
|
||||||
gtsam::NonlinearFactorGraph* deserializeGraphFromXMLFile(string fname, string name);
|
//gtsam::NonlinearFactorGraph* deserializeGraphFromXMLFile(string fname, string name);
|
||||||
|
//
|
||||||
gtsam::Values* deserializeValuesFromFile(string fname);
|
//gtsam::Values* deserializeValuesFromFile(string fname);
|
||||||
gtsam::Values* deserializeValuesFromXMLFile(string fname);
|
//gtsam::Values* deserializeValuesFromXMLFile(string fname);
|
||||||
gtsam::Values* deserializeValuesFromXMLFile(string fname, string name);
|
//gtsam::Values* deserializeValuesFromXMLFile(string fname, string name);
|
||||||
|
|
||||||
//*************************************************************************
|
//*************************************************************************
|
||||||
// Utilities
|
// Utilities
|
||||||
|
|
|
@ -32,11 +32,18 @@ endif()
|
||||||
# To exclude a source from the library build (in any subfolder)
|
# To exclude a source from the library build (in any subfolder)
|
||||||
# Add the full name to this list, as in the following example
|
# Add the full name to this list, as in the following example
|
||||||
# Sources to remove from builds
|
# Sources to remove from builds
|
||||||
set (excluded_sources "")
|
set (excluded_sources #"")
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/slam/serialization.cpp"
|
||||||
# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/TypedDiscreteFactor.cpp"
|
# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/TypedDiscreteFactor.cpp"
|
||||||
# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/TypedDiscreteFactorGraph.cpp"
|
# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/TypedDiscreteFactorGraph.cpp"
|
||||||
# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/parseUAI.cpp"
|
# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/parseUAI.cpp"
|
||||||
# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/PotentialTable.cpp")
|
# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/PotentialTable.cpp")
|
||||||
|
)
|
||||||
|
|
||||||
|
set (excluded_headers #"")
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/slam/serialization.h"
|
||||||
|
# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/TypedDiscreteFactor.h
|
||||||
|
)
|
||||||
|
|
||||||
if(GTSAM_USE_QUATERNIONS)
|
if(GTSAM_USE_QUATERNIONS)
|
||||||
set(excluded_sources ${excluded_sources} "${CMAKE_CURRENT_SOURCE_DIR}/geometry/Rot3M.cpp")
|
set(excluded_sources ${excluded_sources} "${CMAKE_CURRENT_SOURCE_DIR}/geometry/Rot3M.cpp")
|
||||||
|
@ -56,6 +63,7 @@ foreach(subdir ${gtsam_subdirs})
|
||||||
set(subdir_srcs ${subdir_cpp_srcs} ${subdir_headers}) # Include header files so they show up in Visual Studio
|
set(subdir_srcs ${subdir_cpp_srcs} ${subdir_headers}) # Include header files so they show up in Visual Studio
|
||||||
gtsam_assign_source_folders("${subdir_srcs}") # Create MSVC structure
|
gtsam_assign_source_folders("${subdir_srcs}") # Create MSVC structure
|
||||||
list(REMOVE_ITEM subdir_srcs ${excluded_sources})
|
list(REMOVE_ITEM subdir_srcs ${excluded_sources})
|
||||||
|
list(REMOVE_ITEM subdir_srcs ${excluded_headers})
|
||||||
set(${subdir}_srcs ${subdir_srcs})
|
set(${subdir}_srcs ${subdir_srcs})
|
||||||
if (GTSAM_BUILD_CONVENIENCE_LIBRARIES AND (subdir_cpp_srcs)) # Only build convenience library if sources exist
|
if (GTSAM_BUILD_CONVENIENCE_LIBRARIES AND (subdir_cpp_srcs)) # Only build convenience library if sources exist
|
||||||
message(STATUS "Building Convenience Library: ${subdir}")
|
message(STATUS "Building Convenience Library: ${subdir}")
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
# Install headers
|
# Install headers
|
||||||
|
set (slam_excluded_headers #"")
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/serialization.h"
|
||||||
|
)
|
||||||
|
|
||||||
file(GLOB slam_headers "*.h")
|
file(GLOB slam_headers "*.h")
|
||||||
|
list(REMOVE_ITEM slam_headers ${slam_excluded_headers})
|
||||||
install(FILES ${slam_headers} DESTINATION include/gtsam/slam)
|
install(FILES ${slam_headers} DESTINATION include/gtsam/slam)
|
||||||
|
|
||||||
# Components to link tests in this subfolder against
|
# Components to link tests in this subfolder against
|
||||||
|
@ -15,8 +20,8 @@ set(slam_local_libs
|
||||||
|
|
||||||
# Files to exclude from compilation of tests and timing scripts
|
# Files to exclude from compilation of tests and timing scripts
|
||||||
set(slam_excluded_files
|
set(slam_excluded_files
|
||||||
# "${CMAKE_CURRENT_SOURCE_DIR}/tests/testTypedDiscreteFactor.cpp" # Example of excluding a test
|
"${CMAKE_CURRENT_SOURCE_DIR}/tests/testSerialization.cpp"
|
||||||
"" # Add to this list, with full path, to exclude
|
# "" # Add to this list, with full path, to exclude
|
||||||
)
|
)
|
||||||
|
|
||||||
# Build tests
|
# Build tests
|
||||||
|
|
Loading…
Reference in New Issue