Adding OCRep destructor, various move activities 05/305/7
authorErich Keane <erich.keane@intel.com>
Wed, 4 Feb 2015 20:08:26 +0000 (12:08 -0800)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Fri, 6 Feb 2015 20:40:48 +0000 (20:40 +0000)
Apparently OCRepresentation's destructor was causing issues
in the JNI version.  Seemingly adding a virtual destructor to
the OCRepresentation is enough to cause this to go away.

Also adding move construction/assignment to our more expensive
types.

Change-Id: Icb3b6f25e268384b51126e18ec55fc5099c9b2f9
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/305
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
resource/include/OCHeaderOption.h
resource/include/OCRepresentation.h
resource/include/OCResource.h
resource/include/OCResourceRequest.h
resource/include/OCResourceResponse.h
resource/src/OCRepresentation.cpp

index 31517c5..2e2becf 100644 (file)
@@ -64,6 +64,16 @@ namespace OC
                 }
             }
 
+            virtual ~OCHeaderOption(){}
+
+            OCHeaderOption(const OCHeaderOption&) = default;
+
+            OCHeaderOption(OCHeaderOption&&) = default;
+
+            OCHeaderOption& operator=(const OCHeaderOption&) = default;
+
+            OCHeaderOption& operator=(OCHeaderOption&&) = default;
+
             /**
             * API to get Option ID
             * @return unsigned integer option ID
index 2e64fcd..506722e 100644 (file)
@@ -98,7 +98,18 @@ namespace OC
     class OCRepresentation
     {
         public:
-            OCRepresentation();
+            OCRepresentation(): m_interfaceType(InterfaceType::None){}
+
+            OCRepresentation(OCRepresentation&&) = default;
+
+            OCRepresentation(const OCRepresentation&) = default;
+
+            OCRepresentation& operator=(const OCRepresentation&) = default;
+
+            OCRepresentation& operator=(OCRepresentation&&) = default;
+
+            virtual ~OCRepresentation(){}
+
             std::string getJSONRepresentation() const;
 
             void addChild(const OCRepresentation&);
index 63c4253..bbbb3f1 100644 (file)
@@ -52,6 +52,10 @@ namespace OC
     friend class ListenOCContainer;
     public:
         typedef std::shared_ptr<OCResource> Ptr;
+
+        OCResource(OCResource&&) = default;
+        OCResource& operator=(OCResource&&) = default;
+
         /**
         * Virtual destructor
         */
index 50c28c4..107363e 100644 (file)
@@ -57,6 +57,8 @@ namespace OC
         {
         }
 
+        OCResourceRequest(OCResourceRequest&&) = default;
+        OCResourceRequest& operator=(OCResourceRequest&&) = default;
         /**
         *  Virtual destructor
         */
index 7671019..6305a7c 100644 (file)
@@ -57,6 +57,8 @@ namespace OC
         {
         }
 
+        OCResourceResponse(OCResourceResponse&&) = default;
+        OCResourceResponse& operator=(OCResourceResponse&&) = default;
         virtual ~OCResourceResponse(void) {}
 
         /**
index 99b3e65..4394d08 100644 (file)
@@ -163,9 +163,6 @@ namespace OC
 
 namespace OC
 {
-    OCRepresentation::OCRepresentation()
-    :m_interfaceType(InterfaceType::None)
-    { }
     std::string OCRepresentation::getJSONRepresentation() const
     {
         if(empty())