]> git.saurik.com Git - cycript.git/blobdiff - ObjectiveC/Internal.hpp
Maintain a logical setup for const on sig::String.
[cycript.git] / ObjectiveC / Internal.hpp
index 356f61bbdfe3bd6e20f982c1e59153b709c12a72..fcfec702d7131e1d4bafe74e5ebd9ea6e1e135dd 100644 (file)
@@ -27,7 +27,7 @@
 #include "../Internal.hpp"
 
 struct Selector_privateData :
-    CYPrivate<Selector_privateData>
+    CYRoot
 {
     SEL value_;
 
@@ -38,7 +38,7 @@ struct Selector_privateData :
 };
 
 struct Instance :
-    CYPrivate<Instance>
+    CYPrivateOld<Instance>
 {
     typedef unsigned Flags;
     static const Flags None = 0;
@@ -66,7 +66,7 @@ struct Instance :
 
 namespace cy {
 struct Super :
-    CYPrivate<Super>
+    CYRoot
 {
     id value_;
     Class class_;
@@ -79,20 +79,51 @@ struct Super :
 }; }
 
 struct Messages :
-    CYPrivate<Messages>
+    CYRoot
 {
+    virtual Class GetClass() const = 0;
+};
+
+struct Prototype :
+    Messages
+{
+    static constexpr const char *const Cache_ = "p";
+
     Class value_;
 
-    _finline Messages(Class value) :
+    _finline Prototype(Class value) :
         value_(value)
     {
     }
 
+    Class GetClass() const override {
+        return value_;
+    }
+
+    JSValueRef GetPrototype(JSContextRef context) const;
+};
+
+struct Constructor :
+    Messages
+{
+    static constexpr const char *const Cache_ = "m";
+
+    Class value_;
+
+    _finline Constructor(Class value) :
+        value_(value)
+    {
+    }
+
+    Class GetClass() const override {
+        return value_;
+    }
+
     JSValueRef GetPrototype(JSContextRef context) const;
 };
 
 struct Interior :
-    CYPrivate<Interior>
+    CYRoot
 {
     id value_;
     CYProtect owner_;