2011-10-14 02:41:56 +08:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
* 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
|
|
|
|
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
/**
|
2011-10-14 11:23:14 +08:00
|
|
|
* @file Class.h
|
|
|
|
* @brief describe the C++ class that is being wrapped
|
|
|
|
* @author Frank Dellaert
|
2011-10-14 02:41:56 +08:00
|
|
|
**/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "Constructor.h"
|
|
|
|
#include "Method.h"
|
2011-12-02 10:32:18 +08:00
|
|
|
#include "StaticMethod.h"
|
2011-10-14 02:41:56 +08:00
|
|
|
|
2011-12-03 00:43:15 +08:00
|
|
|
namespace wrap {
|
|
|
|
|
2011-10-14 12:43:06 +08:00
|
|
|
/// Class has name, constructors, methods
|
2011-10-14 02:41:56 +08:00
|
|
|
struct Class {
|
2011-10-14 12:43:06 +08:00
|
|
|
/// Constructor creates an empty class
|
2011-10-14 02:41:56 +08:00
|
|
|
Class(bool verbose=true) : verbose_(verbose) {}
|
|
|
|
|
2011-10-14 12:43:06 +08:00
|
|
|
// Then the instance variables are set directly by the Module constructor
|
2011-12-09 23:44:35 +08:00
|
|
|
std::string name; ///< Class name
|
2011-12-09 04:51:13 +08:00
|
|
|
std::vector<Constructor> constructors; ///< Class constructors
|
|
|
|
std::vector<Method> methods; ///< Class methods
|
|
|
|
std::vector<StaticMethod> static_methods; ///< Static methods
|
2011-12-09 23:44:35 +08:00
|
|
|
std::vector<std::string> namespaces; ///< Stack of namespaces
|
|
|
|
std::vector<std::string> includes; ///< header include overrides
|
|
|
|
bool verbose_; ///< verbose flag
|
2011-10-14 12:43:06 +08:00
|
|
|
|
|
|
|
// And finally MATLAB code is emitted, methods below called by Module::matlab_code
|
2011-12-12 05:09:07 +08:00
|
|
|
void matlab_proxy(const std::string& classFile) const; ///< emit proxy class
|
2011-10-14 12:43:06 +08:00
|
|
|
void matlab_constructors(const std::string& toolboxPath,
|
2011-12-12 05:09:07 +08:00
|
|
|
const std::vector<std::string>& using_namespaces) const; ///< emit constructor wrappers
|
2011-10-14 12:43:06 +08:00
|
|
|
void matlab_methods(const std::string& classPath,
|
2011-12-12 05:09:07 +08:00
|
|
|
const std::vector<std::string>& using_namespaces) const; ///< emit method wrappers
|
2011-12-02 10:32:18 +08:00
|
|
|
void matlab_static_methods(const std::string& classPath,
|
2011-12-12 05:09:07 +08:00
|
|
|
const std::vector<std::string>& using_namespaces) const; ///< emit static method wrappers
|
2012-01-16 05:42:41 +08:00
|
|
|
void matlab_make_fragment(FileWriter& file,
|
2011-10-14 12:43:06 +08:00
|
|
|
const std::string& toolboxPath,
|
2011-12-12 05:09:07 +08:00
|
|
|
const std::string& mexFlags) const; ///< emit make fragment for global make script
|
2012-01-16 05:42:41 +08:00
|
|
|
void makefile_fragment(FileWriter& file) const; ///< emit makefile fragment
|
2011-12-09 04:51:13 +08:00
|
|
|
std::string qualifiedName(const std::string& delim = "") const; ///< creates a namespace-qualified name, optional delimiter
|
2011-10-14 02:41:56 +08:00
|
|
|
};
|
|
|
|
|
2011-12-03 00:43:15 +08:00
|
|
|
} // \namespace wrap
|
|
|
|
|