gtsam/wrap/Module.h

66 lines
2.2 KiB
C
Raw Normal View History

/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
/**
* @file Module.h
* @brief describes module to be wrapped
* @author Frank Dellaert
2012-07-13 06:28:28 +08:00
* @author Richard Roberts
**/
#pragma once
#include <string>
#include <vector>
#include <map>
#include "Class.h"
2012-07-13 06:28:28 +08:00
#include "TemplateInstantiationTypedef.h"
#include "ForwardDeclaration.h"
namespace wrap {
2011-10-14 12:43:06 +08:00
/**
* A module just has a name and a list of classes
*/
struct Module {
2011-10-14 12:43:06 +08:00
std::string name; ///< module name
std::vector<Class> classes; ///< list of classes
2012-07-13 06:28:28 +08:00
std::vector<TemplateInstantiationTypedef> templateInstantiationTypedefs; ///< list of template instantiations
bool verbose; ///< verbose flag
// std::vector<std::string> using_namespaces; ///< all default namespaces
std::vector<ForwardDeclaration> forward_declarations;
std::vector<std::string> includes; ///< Include statements
2011-10-14 12:43:06 +08:00
/// constructor that parses interface file
Module(const std::string& interfacePath,
const std::string& moduleName,
bool enable_verbose=true);
2011-10-14 12:43:06 +08:00
/// MATLAB code generation:
void matlab_code(
const std::string& path,
const std::string& headerPath) const;
void finish_wrapper(FileWriter& file, const std::vector<std::string>& functionNames) const;
void generateIncludes(FileWriter& file) const;
private:
2012-07-13 06:28:28 +08:00
static std::vector<Class> ExpandTypedefInstantiations(const std::vector<Class>& classes, const std::vector<TemplateInstantiationTypedef> instantiations);
static std::vector<std::string> GenerateValidTypes(const std::vector<Class>& classes, const std::vector<ForwardDeclaration> forwardDeclarations);
static void WriteCollectorsAndCleanupFcn(FileWriter& wrapperFile, const std::string& moduleName, const std::vector<Class>& classes);
static void WriteRTTIRegistry(FileWriter& wrapperFile, const std::string& moduleName, const std::vector<Class>& classes);
};
} // \namespace wrap