2011-12-02 10:32:18 +08:00
|
|
|
/**
|
|
|
|
* @file ReturnValue.h
|
|
|
|
*
|
|
|
|
* @brief Encapsulates a return value from a method
|
|
|
|
*
|
|
|
|
* @date Dec 1, 2011
|
|
|
|
* @author Alex Cunningham
|
2012-07-13 06:28:28 +08:00
|
|
|
* @author Richard Roberts
|
2011-12-02 10:32:18 +08:00
|
|
|
*/
|
|
|
|
|
2011-12-09 04:51:17 +08:00
|
|
|
#include <vector>
|
2012-07-10 04:19:37 +08:00
|
|
|
#include <map>
|
2012-01-16 05:42:41 +08:00
|
|
|
|
|
|
|
#include "FileWriter.h"
|
2012-07-13 06:28:28 +08:00
|
|
|
#include "TypeAttributesTable.h"
|
2011-12-02 10:32:18 +08:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2011-12-03 00:43:15 +08:00
|
|
|
namespace wrap {
|
|
|
|
|
2011-12-02 10:32:18 +08:00
|
|
|
struct ReturnValue {
|
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
typedef enum {
|
2012-11-28 03:03:18 +08:00
|
|
|
CLASS = 1,
|
|
|
|
EIGEN = 2,
|
|
|
|
BASIS = 3,
|
2012-11-28 03:03:21 +08:00
|
|
|
VOID = 4
|
2012-10-02 22:40:07 +08:00
|
|
|
} return_category;
|
2011-12-07 11:05:33 +08:00
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
ReturnValue(bool enable_verbosity = true)
|
|
|
|
: verbose(enable_verbosity), isPtr1(false), isPtr2(false),
|
2012-11-28 03:03:21 +08:00
|
|
|
isPair(false), category1(CLASS), category2(CLASS)
|
2012-10-02 22:40:07 +08:00
|
|
|
{}
|
2011-12-02 10:32:18 +08:00
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
bool verbose;
|
|
|
|
bool isPtr1, isPtr2, isPair;
|
|
|
|
return_category category1, category2;
|
2012-11-28 03:03:18 +08:00
|
|
|
std::string type1, type2;
|
|
|
|
std::vector<std::string> namespaces1, namespaces2;
|
2011-12-02 10:32:18 +08:00
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
typedef enum {
|
|
|
|
arg1, arg2, pair
|
|
|
|
} pairing;
|
2011-12-02 10:32:18 +08:00
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
std::string return_type(bool add_ptr, pairing p) const;
|
2011-12-02 10:32:18 +08:00
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
std::string qualifiedType1(const std::string& delim = "") const;
|
|
|
|
std::string qualifiedType2(const std::string& delim = "") const;
|
2011-12-09 04:51:17 +08:00
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
std::string matlab_returnType() const;
|
2011-12-02 10:32:18 +08:00
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
void wrap_result(const std::string& result, FileWriter& file, const TypeAttributesTable& typeAttributes) const;
|
2011-12-02 10:32:18 +08:00
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
void wrapTypeUnwrap(FileWriter& wrapperFile) const;
|
2012-07-24 02:24:39 +08:00
|
|
|
|
2011-12-02 10:32:18 +08:00
|
|
|
};
|
2011-12-03 00:43:15 +08:00
|
|
|
|
|
|
|
} // \namespace wrap
|