Bläddra i källkod

Merge pull request #558 from yikenan/master

move the getType() function implementation from hpp file to cpp file
Leonid Stryzhevskyi 2 år sedan
förälder
incheckning
3805abfcb6

+ 5 - 0
src/oatpp/core/data/mapping/type/Any.cpp

@@ -28,6 +28,11 @@ namespace oatpp { namespace data { namespace mapping { namespace type {
 
 namespace __class {
   const ClassId Any::CLASS_ID("Any");
+
+  Type* Any::getType() {
+    static Type type(CLASS_ID);
+    return &type;
+  }
 }
 
 Any::Any()

+ 1 - 4
src/oatpp/core/data/mapping/type/Any.hpp

@@ -44,10 +44,7 @@ namespace __class {
      */
     static const ClassId CLASS_ID;
 
-    static Type *getType() {
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type *getType();
 
   };
 

+ 59 - 0
src/oatpp/core/data/mapping/type/Primitive.cpp

@@ -125,6 +125,65 @@ namespace __class {
 
   const ClassId Boolean::CLASS_ID("Boolean");
 
+  Type* String::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* Int8::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* UInt8::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* Int16::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* UInt16::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* Int32::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* UInt32::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* Int64::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* UInt64::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* Float32::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* Float64::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
+
+  Type* Boolean::getType(){
+    static Type type(CLASS_ID);
+    return &type;
+  }
 }
   
 }}}}

+ 12 - 48
src/oatpp/core/data/mapping/type/Primitive.hpp

@@ -546,10 +546,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -557,10 +554,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -568,10 +562,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -579,10 +570,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -590,10 +578,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -601,10 +586,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -612,10 +594,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -623,10 +602,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -634,10 +610,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -645,10 +618,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -656,10 +626,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };
 
@@ -667,10 +634,7 @@ namespace __class {
   public:
     static const ClassId CLASS_ID;
 
-    static Type* getType(){
-      static Type type(CLASS_ID);
-      return &type;
-    }
+    static Type* getType();
 
   };