diff options
author | Timothy Pearson <[email protected]> | 2012-01-01 18:29:30 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-01-01 18:29:30 -0600 |
commit | b2af005db21bd8fd068cb79b2ae700953128af2c (patch) | |
tree | abd0ed633726bf0bbecb57d30e92836c31e02695 /PerlTQt/marshall.h | |
parent | c1b9383f2032d82db5eb8918dca885e37a901dde (diff) | |
download | libtqt-perl-b2af005db21bd8fd068cb79b2ae700953128af2c.tar.gz libtqt-perl-b2af005db21bd8fd068cb79b2ae700953128af2c.zip |
Move PerlQt
Diffstat (limited to 'PerlTQt/marshall.h')
-rw-r--r-- | PerlTQt/marshall.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/PerlTQt/marshall.h b/PerlTQt/marshall.h new file mode 100644 index 0000000..55be867 --- /dev/null +++ b/PerlTQt/marshall.h @@ -0,0 +1,44 @@ +#ifndef MARSHALL_H +#define MARSHALL_H +#include "smoke.h" + +class SmokeType; + +class Marshall { +public: + /** + * FromSV is used for virtual function return values and regular + * method arguments. + * + * ToSV is used for method return-values and virtual function + * arguments. + */ + typedef void (*HandlerFn)(Marshall *); + enum Action { FromSV, ToSV }; + virtual SmokeType type() = 0; + virtual Action action() = 0; + virtual Smoke::StackItem &item() = 0; + virtual SV* var() = 0; + virtual void unsupported() = 0; + virtual Smoke *smoke() = 0; + /** + * For return-values, next() does nothing. + * For FromSV, next() calls the method and returns. + * For ToSV, next() calls the virtual function and returns. + * + * Required to reset Marshall object to the state it was + * before being called when it returns. + */ + virtual void next() = 0; + /** + * For FromSV, cleanup() returns false when the handler should free + * any allocated memory after next(). + * + * For ToSV, cleanup() returns true when the handler should delete + * the pointer passed to it. + */ + virtual bool cleanup() = 0; + + virtual ~Marshall() {} +}; +#endif |