Formatting and headers
parent
43e238c6ab
commit
1002696f83
|
@ -19,11 +19,11 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "FileWriter.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "FileWriter.h"
|
|
||||||
|
|
||||||
namespace wrap {
|
namespace wrap {
|
||||||
|
|
||||||
/// Argument class
|
/// Argument class
|
||||||
|
|
|
@ -8,12 +8,11 @@
|
||||||
* @author Richard Roberts
|
* @author Richard Roberts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include "FileWriter.h"
|
#include "FileWriter.h"
|
||||||
#include "TypeAttributesTable.h"
|
#include "TypeAttributesTable.h"
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
namespace wrap {
|
namespace wrap {
|
||||||
|
@ -21,16 +20,13 @@ namespace wrap {
|
||||||
struct ReturnValue {
|
struct ReturnValue {
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CLASS = 1,
|
CLASS = 1, EIGEN = 2, BASIS = 3, VOID = 4
|
||||||
EIGEN = 2,
|
|
||||||
BASIS = 3,
|
|
||||||
VOID = 4
|
|
||||||
} return_category;
|
} return_category;
|
||||||
|
|
||||||
ReturnValue(bool enable_verbosity = true)
|
ReturnValue(bool enable_verbosity = true) :
|
||||||
: verbose(enable_verbosity), isPtr1(false), isPtr2(false),
|
verbose(enable_verbosity), isPtr1(false), isPtr2(false), isPair(false), category1(
|
||||||
isPair(false), category1(CLASS), category2(CLASS)
|
CLASS), category2(CLASS) {
|
||||||
{}
|
}
|
||||||
|
|
||||||
bool verbose;
|
bool verbose;
|
||||||
bool isPtr1, isPtr2, isPair;
|
bool isPtr1, isPtr2, isPair;
|
||||||
|
@ -49,7 +45,8 @@ struct ReturnValue {
|
||||||
|
|
||||||
std::string matlab_returnType() const;
|
std::string matlab_returnType() const;
|
||||||
|
|
||||||
void wrap_result(const std::string& result, FileWriter& file, const TypeAttributesTable& typeAttributes) const;
|
void wrap_result(const std::string& result, FileWriter& file,
|
||||||
|
const TypeAttributesTable& typeAttributes) const;
|
||||||
|
|
||||||
void wrapTypeUnwrap(FileWriter& wrapperFile) const;
|
void wrapTypeUnwrap(FileWriter& wrapperFile) const;
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,6 @@
|
||||||
#include "ReturnValue.h"
|
#include "ReturnValue.h"
|
||||||
#include "TypeAttributesTable.h"
|
#include "TypeAttributesTable.h"
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <list>
|
|
||||||
|
|
||||||
namespace wrap {
|
namespace wrap {
|
||||||
|
|
||||||
/// StaticMethod class
|
/// StaticMethod class
|
||||||
|
@ -33,7 +30,8 @@ struct StaticMethod {
|
||||||
|
|
||||||
/// Constructor creates empty object
|
/// Constructor creates empty object
|
||||||
StaticMethod(bool verbosity = true) :
|
StaticMethod(bool verbosity = true) :
|
||||||
verbose(verbosity) {}
|
verbose(verbosity) {
|
||||||
|
}
|
||||||
|
|
||||||
// Then the instance variables are set directly by the Module constructor
|
// Then the instance variables are set directly by the Module constructor
|
||||||
bool verbose;
|
bool verbose;
|
||||||
|
@ -45,22 +43,20 @@ struct StaticMethod {
|
||||||
// with those in rhs, but in subsequent calls it adds additional argument
|
// with those in rhs, but in subsequent calls it adds additional argument
|
||||||
// lists as function overloads.
|
// lists as function overloads.
|
||||||
void addOverload(bool verbose, const std::string& name,
|
void addOverload(bool verbose, const std::string& name,
|
||||||
const ArgumentList& args, const ReturnValue& retVal);
|
const ArgumentList& args, const ReturnValue& retVal);
|
||||||
|
|
||||||
// MATLAB code generation
|
// MATLAB code generation
|
||||||
// classPath is class directory, e.g., ../matlab/@Point2
|
// classPath is class directory, e.g., ../matlab/@Point2
|
||||||
void proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wrapperFile,
|
void proxy_wrapper_fragments(FileWriter& proxyFile, FileWriter& wrapperFile,
|
||||||
const std::string& cppClassName, const std::string& matlabQualName, const std::string& matlabUniqueName,
|
const std::string& cppClassName, const std::string& matlabQualName,
|
||||||
const std::string& wrapperName, const TypeAttributesTable& typeAttributes,
|
const std::string& matlabUniqueName, const std::string& wrapperName,
|
||||||
std::vector<std::string>& functionNames) const;
|
const TypeAttributesTable& typeAttributes,
|
||||||
|
std::vector<std::string>& functionNames) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string wrapper_fragment(FileWriter& file,
|
std::string wrapper_fragment(FileWriter& file,
|
||||||
const std::string& cppClassName,
|
const std::string& cppClassName, const std::string& matlabUniqueName,
|
||||||
const std::string& matlabUniqueName,
|
int overload, int id, const TypeAttributesTable& typeAttributes) const; ///< cpp wrapper
|
||||||
int overload,
|
|
||||||
int id,
|
|
||||||
const TypeAttributesTable& typeAttributes) const; ///< cpp wrapper
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // \namespace wrap
|
} // \namespace wrap
|
||||||
|
|
Loading…
Reference in New Issue