gtsam/wrap/Constructor.h

68 lines
1.8 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
2012-07-13 06:28:28 +08:00
* @author Richard Roberts
**/
#pragma once
2014-05-26 01:26:14 +08:00
#include "Argument.h"
#include <string>
2011-12-09 23:44:35 +08:00
#include <vector>
namespace wrap {
// Constructor class
struct Constructor {
/// Constructor creates an empty class
Constructor(bool verbose = false) :
verbose_(verbose) {
}
// Then the instance variables are set directly by the Module constructor
2014-05-26 01:26:14 +08:00
std::vector<ArgumentList> args_list;
std::string name;
bool verbose_;
// MATLAB code generation
// toolboxPath is main toolbox directory, e.g., ../matlab
// classFile is class proxy file, e.g., ../matlab/@Point2/Point2.m
/// wrapper name
std::string matlab_wrapper_name(const std::string& className) const;
/**
* Create fragment to select constructor in proxy class, e.g.,
* if nargin == 2, obj.self = new_Pose3_RP(varargin{1},varargin{2}); end
*/
void proxy_fragment(FileWriter& file, const std::string& wrapperName,
2014-05-26 01:26:14 +08:00
bool hasParent, const int id, const ArgumentList args) const;
/// cpp wrapper
std::string wrapper_fragment(FileWriter& file,
2014-05-26 01:26:14 +08:00
const std::string& cppClassName, const std::string& matlabUniqueName,
const std::string& cppBaseClassName, int id,
const ArgumentList& al) const;
/// constructor function
void generate_construct(FileWriter& file, const std::string& cppClassName,
2014-05-26 01:26:14 +08:00
std::vector<ArgumentList>& args_list) const;
2014-05-26 01:26:14 +08:00
};
2012-06-27 02:52:27 +08:00
} // \namespace wrap