gtsam/wrap/Constructor.h

75 lines
2.0 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 Constructor.h
* @brief class describing a constructor + code generation
* @author Frank Dellaert
**/
#pragma once
#include <string>
2011-12-09 23:44:35 +08:00
#include <vector>
#include "Argument.h"
namespace wrap {
// Constructor class
struct Constructor {
2011-10-14 12:43:06 +08:00
/// Constructor creates an empty class
Constructor(bool verbose = false) :
2011-10-14 12:43:06 +08:00
verbose_(verbose) {
}
2011-10-14 12:43:06 +08:00
// Then the instance variables are set directly by the Module constructor
2012-06-27 02:52:27 +08:00
std::vector<ArgumentList> args_list;
std::string name;
2011-10-14 12:43:06 +08:00
bool verbose_;
2011-10-14 12:43:06 +08:00
// MATLAB code generation
// toolboxPath is main toolbox directory, e.g., ../matlab
// classFile is class proxy file, e.g., ../matlab/@Point2/Point2.m
/// wrapper name
2011-12-12 05:09:07 +08:00
std::string matlab_wrapper_name(const std::string& className) const;
2011-10-14 12:43:06 +08:00
/**
* Create fragment to select constructor in proxy class, e.g.,
* if nargin == 2, obj.self = new_Pose3_RP(varargin{1},varargin{2}); end
*/
2012-06-27 02:52:27 +08:00
void matlab_proxy_fragment(FileWriter& file,
const std::string& className, const int i,
const ArgumentList args) const;
2011-10-14 12:43:06 +08:00
/// m-file
void matlab_mfile(const std::string& toolboxPath,
2012-06-27 02:52:27 +08:00
const std::string& qualifiedMatlabName,
const ArgumentList args) const;
2011-10-14 12:43:06 +08:00
2011-12-09 23:44:35 +08:00
/// cpp wrapper
2011-10-14 12:43:06 +08:00
void matlab_wrapper(const std::string& toolboxPath,
const std::string& cppClassName,
const std::string& matlabClassName,
const std::vector<std::string>& using_namespaces,
2011-12-12 05:09:07 +08:00
const std::vector<std::string>& includes) const;
2012-06-27 02:52:27 +08:00
/// constructor function
void generate_construct(FileWriter& file, const std::string& cppClassName,
std::vector<ArgumentList>& args_list) const;
};
2012-06-27 02:52:27 +08:00
} // \namespace wrap