};
struct CArray :
- CYValue<CArray, void *>
+ CYPrivate<CArray>
{
+ void *value_;
CYProtect owner_;
Type_privateData *type_;
size_t length_;
CArray(void *value, size_t length, const sig::Type &type, ffi_type *ffi, JSContextRef context, JSObjectRef owner) :
- CYValue(value),
+ value_(value),
owner_(context, owner),
type_(new(*pool_) Type_privateData(type, ffi)),
length_(length)
};
struct CString :
- CYValue<CString, char *>
+ CYPrivate<CString>
{
+ char *value_;
CYProtect owner_;
CString(char *value, JSContextRef context, JSObjectRef owner) :
- CYValue(value),
+ value_(value),
owner_(context, owner)
{
if (owner == NULL)
};
struct Pointer :
- CYValue<Pointer, void *>
+ CYPrivate<Pointer>
{
+ void *value_;
CYProtect owner_;
Type_privateData *type_;
Pointer(void *value, const sig::Type &type, JSContextRef context, JSObjectRef owner) :
- CYValue(value),
+ value_(value),
owner_(context, owner),
type_(new(*pool_) Type_privateData(type))
{
}
Pointer(void *value, const char *encoding, JSContextRef context, JSObjectRef owner) :
- CYValue(value),
+ value_(value),
owner_(context, owner),
type_(new(*pool_) Type_privateData(encoding))
{
};
struct Struct_privateData :
- CYValue<Struct_privateData, void *>
+ CYPrivate<Struct_privateData>
{
+ void *value_;
CYProtect owner_;
Type_privateData *type_;
Struct_privateData(void *value, const sig::Type &type, ffi_type *ffi, JSContextRef context, JSObjectRef owner) :
- CYValue(value),
+ value_(value),
owner_(context, owner),
type_(new(*pool_) Type_privateData(type, ffi))
{
}
};
-template <typename Internal_, typename Value_>
-struct CYValue :
- CYPrivate<Internal_>
-{
- Value_ value_;
-
- CYValue() {
- }
-
- CYValue(const Value_ &value) :
- value_(value)
- {
- }
-
- CYValue(const CYValue &rhs) :
- value_(rhs.value_)
- {
- }
-};
-
template <typename Internal_>
JSClassRef CYPrivate<Internal_>::Class_;
namespace cy {
struct Functor :
- CYValue<Functor, void (*)()>
+ CYPrivate<Functor>
{
private:
void set() {
}
public:
+ void (*value_)();
bool variadic_;
sig::Signature signature_;
ffi_cif cif_;
Functor(void (*value)(), bool variadic, const sig::Signature &signature) :
- CYValue(value),
+ value_(value),
variadic_(variadic)
{
sig::Copy(*pool_, signature_, signature);
}
Functor(void (*value)(), const char *encoding) :
- CYValue(value),
+ value_(value),
variadic_(false)
{
sig::Parse(*pool_, &signature_, encoding, &Structor_);
#include "../Internal.hpp"
struct Selector_privateData :
- CYValue<Selector_privateData, SEL>
+ CYPrivate<Selector_privateData>
{
+ SEL value_;
+
_finline Selector_privateData(SEL value) :
- CYValue(value)
+ value_(value)
{
}
};
struct Instance :
- CYValue<Instance, id>
+ CYPrivate<Instance>
{
typedef unsigned Flags;
static const Flags None = 0;
static const Flags Permanent = 1 << 0;
static const Flags Uninitialized = 1 << 1;
+ id value_;
Flags flags_;
Instance(id value, Flags flags);
namespace cy {
struct Super :
- CYValue<Super, id>
+ CYPrivate<Super>
{
+ id value_;
Class class_;
_finline Super(id value, Class _class) :
- CYValue(value),
+ value_(value),
class_(_class)
{
}
}; }
struct Messages :
- CYValue<Messages, Class>
+ CYPrivate<Messages>
{
+ Class value_;
+
_finline Messages(Class value) :
- CYValue(value)
+ value_(value)
{
}
};
struct Interior :
- CYValue<Interior, id>
+ CYPrivate<Interior>
{
+ id value_;
CYProtect owner_;
_finline Interior(id value, JSContextRef context, JSObjectRef owner) :
- CYValue(value),
+ value_(value),
owner_(context, owner)
{
}
}
Instance::Instance(id value, Flags flags) :
- CYValue(value),
+ value_(value),
flags_(flags)
{
if (IsPermanent());