Change names of include-guards of primitiveResource headers
authorcoderhyme <jhyo.kim@samsung.com>
Thu, 2 Jul 2015 10:54:27 +0000 (19:54 +0900)
committerUze Choi <uzchoi@samsung.com>
Fri, 3 Jul 2015 07:12:27 +0000 (07:12 +0000)
Add prefixes to include-guards to lower possibility of conflicts with others.
Fix a file name 'ResourceAttributesConverter.h', there was a typo.

Change-Id: I76345b4c444ed242e8b3d307a550ba1f0c043b69
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1501
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
16 files changed:
service/resource-manipulation/modules/common/primitiveResource/include/PresenceSubscriber.h
service/resource-manipulation/modules/common/primitiveResource/include/PrimitiveException.h
service/resource-manipulation/modules/common/primitiveResource/include/PrimitiveResource.h
service/resource-manipulation/modules/common/primitiveResource/include/ResourceAttributes.h
service/resource-manipulation/modules/common/primitiveResource/include/ResponseStatement.h
service/resource-manipulation/modules/common/primitiveResource/include/internal/AssertUtils.h
service/resource-manipulation/modules/common/primitiveResource/include/internal/PrimitiveResourceImpl.h
service/resource-manipulation/modules/common/primitiveResource/include/internal/ResourceAttributesConverter.h [moved from service/resource-manipulation/modules/common/primitiveResource/include/internal/ResourceAtrributesConverter.h with 89% similarity]
service/resource-manipulation/modules/common/primitiveResource/include/internal/ResourceAttributesUtils.h
service/resource-manipulation/modules/common/primitiveResource/src/ResourceAttributes.cpp
service/resource-manipulation/modules/common/primitiveResource/src/ResponseStatement.cpp
service/resource-manipulation/modules/common/primitiveResource/unittests/ResourceAttributesTest.cpp
service/resource-manipulation/modules/serverBuilder/include/internal/RequestHandler.h
service/resource-manipulation/modules/serverBuilder/src/RequestHandler.cpp
service/resource-manipulation/modules/serverBuilder/src/ResourceObject.cpp
service/resource-manipulation/modules/serverBuilder/unittests/PrimitiveResponseTest.cpp

index 09a516e..e986cd3 100644 (file)
@@ -18,8 +18,8 @@
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#ifndef __PRESENCESUBSCRIBER_H
-#define __PRESENCESUBSCRIBER_H
+#ifndef COMMON_PRESENCESUBSCRIBER_H
+#define COMMON_PRESENCESUBSCRIBER_H
 
 #include <string>
 #include <functional>
@@ -85,4 +85,4 @@ namespace OIC
     }
 }
 
-#endif // __PRESENCESUBSCRIBER_H
+#endif // COMMON_PRESENCESUBSCRIBER_H
index a4a8570..c623eb1 100755 (executable)
@@ -18,8 +18,8 @@
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#ifndef __PRIMITIVEEXCEPTION_H
-#define __PRIMITIVEEXCEPTION_H
+#ifndef RES_MANIPULATION_PRIMITIVEEXCEPTION_H
+#define RES_MANIPULATION_PRIMITIVEEXCEPTION_H
 
 #include <string>
 
@@ -34,8 +34,8 @@ namespace OIC
         {
         public:
             PrimitiveException() {}
-            PrimitiveException(const std::string& what) : m_what{ what } {}
-            PrimitiveException(std::string&& what) : m_what{ std::move(what) } {}
+            explicit PrimitiveException(const std::string& what) : m_what{ what } {}
+            explicit PrimitiveException(std::string&& what) : m_what{ std::move(what) } {}
 
             const char* what() const noexcept override
             {
@@ -49,7 +49,7 @@ namespace OIC
         class PlatformException: public PrimitiveException
         {
         public:
-            PlatformException(OCStackResult reason);
+            explicit PlatformException(OCStackResult reason);
 
             OCStackResult getReasonCode() const;
             std::string getReason() const;
@@ -60,4 +60,4 @@ namespace OIC
     }
 }
 
-#endif //__PRIMITIVEEXCEPTION_H
+#endif // RES_MANIPULATION_PRIMITIVEEXCEPTION_H
index ae5f207..9dde868 100755 (executable)
@@ -18,8 +18,8 @@
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#ifndef __PRIMITIVERESOURCE_H
-#define __PRIMITIVERESOURCE_H
+#ifndef COMMON_PRIMITIVERESOURCE_H
+#define COMMON_PRIMITIVERESOURCE_H
 
 #include <functional>
 #include <string>
@@ -89,4 +89,4 @@ namespace OIC
     }
 }
 
-#endif // __PRIMITIVERESOURCE_H
+#endif // COMMON_PRIMITIVERESOURCE_H
index ef2dd36..40af425 100755 (executable)
@@ -18,8 +18,8 @@
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#ifndef __RESOURCEATTRIBUTES_H
-#define __RESOURCEATTRIBUTES_H
+#ifndef RES_MANIPULATION_RESOURCEATTRIBUTES_H
+#define RES_MANIPULATION_RESOURCEATTRIBUTES_H
 
 // To avoid conflict using different boost::variant configuration with OC.
 // It causes compile errors.
@@ -393,4 +393,4 @@ namespace OIC
     }
 }
 
-#endif // __RESOURCEATTRIBUTES_H
+#endif // RES_MANIPULATION_RESOURCEATTRIBUTES_H
index 34421c5..e19f9a3 100755 (executable)
@@ -18,8 +18,8 @@
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#ifndef __RESPONSESTATEMENT_H
-#define __RESPONSESTATEMENT_H
+#ifndef COMMON_RESPONSESTATEMENT_H
+#define COMMON_RESPONSESTATEMENT_H
 
 #include <string>
 #include <vector>
@@ -71,4 +71,4 @@ namespace OIC
     }
 }
 
-#endif // __RESPONSESTATEMENT_H
+#endif // COMMON_RESPONSESTATEMENT_H
index 1a440fd..eccc51e 100644 (file)
@@ -18,8 +18,8 @@
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#ifndef __PRIMITIVERESOURCE_ASSERTUTILS_H
-#define __PRIMITIVERESOURCE_ASSERTUTILS_H
+#ifndef COMMON_INTERNAL_ASSERTUTILS_H
+#define COMMON_INTERNAL_ASSERTUTILS_H
 
 #include <cstdint>
 
@@ -192,4 +192,4 @@ namespace OIC
     }
 }
 
-#endif // __PRIMITIVERESOURCE_ASSERTUTILS_H
+#endif // COMMON_INTERNAL_ASSERTUTILS_H
index 19fb909..d56d05d 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#ifndef __PRIMITIVERESOURCEIMPL_H
-#define __PRIMITIVERESOURCEIMPL_H
+#ifndef COMMON_INTERNAL_PRIMITIVERESOURCEIMPL_H
+#define COMMON_INTERNAL_PRIMITIVERESOURCEIMPL_H
 
 #include <PrimitiveResource.h>
 #include <ResponseStatement.h>
 #include <internal/AssertUtils.h>
 
-#include <internal/ResourceAtrributesConverter.h>
+#include <internal/ResourceAttributesConverter.h>
 
 namespace OIC
 {
@@ -135,4 +135,4 @@ namespace OIC
     }
 }
 
-#endif // __PRIMITIVERESOURCEIMPL_H
+#endif // COMMON_INTERNAL_PRIMITIVERESOURCEIMPL_H
@@ -18,8 +18,8 @@
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#ifndef __RESOURCEATTRIBUTESCONVERTER_H
-#define __RESOURCEATTRIBUTESCONVERTER_H
+#ifndef COMMON_INTERNAL_RESOURCEATTRIBUTESCONVERTER_H
+#define COMMON_INTERNAL_RESOURCEATTRIBUTESCONVERTER_H
 
 #include <ResourceAttributes.h>
 
@@ -37,11 +37,11 @@ namespace OIC
 
             template< typename T >
             using SupportedType = typename std::enable_if<
-            ResourceAttributes::is_supported_type< T >::type::value, T >::type;
+                    ResourceAttributes::is_supported_type< T >::type::value, T >::type;
 
             template< typename T >
             using UnsupportedType = typename std::enable_if<
-            !ResourceAttributes::is_supported_type< T >::type::value, T >::type;
+                    !ResourceAttributes::is_supported_type< T >::type::value, T >::type;
 
             class ResourceAttributesBuilder
             {
@@ -105,10 +105,10 @@ namespace OIC
                 ResourceAttributes m_target;
             };
 
-            class AttrVisitor
+            class OCRepresentationBuilder
             {
             public:
-                AttrVisitor() = default;
+                OCRepresentationBuilder() = default;
 
                 template< typename T >
                 void operator()(const std::string& key, const T& value)
@@ -150,15 +150,15 @@ namespace OIC
 
             static OC::OCRepresentation toOCRepresentation(const ResourceAttributes& resourceAttributes)
             {
-                AttrVisitor visitor;
+                OCRepresentationBuilder builder;
 
-                resourceAttributes.visit(visitor);
+                resourceAttributes.visit(builder);
 
-                return visitor.extract();
+                return builder.extract();
             }
         };
 
     }
 }
 
-#endif // __RESOURCEATTRIBUTESCONVERTER_H
+#endif // COMMON_INTERNAL_RESOURCEATTRIBUTESCONVERTER_H
index cd0618b..a61cd00 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-/*
- * ResourceAttributesUtils.h
- *
- *  Created on: 2015. 6. 11.
- *      Author: jhyo.kim
- */
-
-#ifndef __RESOURCEATTRIBUTESUTILS_H
-#define __RESOURCEATTRIBUTESUTILS_H
+#ifndef COMMON_INTERNAL_RESOURCEATTRIBUTESUTILS_H
+#define COMMON_INTERNAL_RESOURCEATTRIBUTESUTILS_H
 
 namespace OIC
 {
@@ -44,4 +37,4 @@ namespace OIC
     }
 }
 
-#endif // __RESOURCEATTRIBUTESUTILS_H
+#endif // COMMON_INTERNAL_RESOURCEATTRIBUTESUTILS_H
index 980104c..3b1b156 100755 (executable)
@@ -21,7 +21,7 @@
 #include <ResourceAttributes.h>
 
 #include <internal/ResourceAttributesUtils.h>
-#include <internal/ResourceAtrributesConverter.h>
+#include <internal/ResourceAttributesConverter.h>
 
 #include <boost/lexical_cast.hpp>
 
index 2a3b25b..41299af 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <ResponseStatement.h>
 
-#include <internal/ResourceAtrributesConverter.h>
+#include <internal/ResourceAttributesConverter.h>
 
 namespace OIC
 {
@@ -50,7 +50,8 @@ namespace OIC
         ResponseStatement::ResponseStatement(ResourceAttributes&& attrs, std::string&& uri,
                 std::vector< std::string >&& resourceTypes,
                 std::vector< std::string >&& resourceInterfaces) :
-                m_attrs{ std::move(attrs) }, m_uri{ std::move(uri) },
+                m_attrs{ std::move(attrs) },
+                m_uri{ std::move(uri) },
                 m_resourceTypes { std::move(resourceTypes) },
                 m_resourceInterfaces{ std::move(resourceInterfaces) }
         {
index fd06beb..30aaf1c 100644 (file)
@@ -19,7 +19,7 @@
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
 #include <ResourceAttributes.h>
-#include <internal/ResourceAtrributesConverter.h>
+#include <internal/ResourceAttributesConverter.h>
 #include <internal/ResourceAttributesUtils.h>
 
 #include <gtest/gtest.h>
index f3311f7..b7f97cc 100644 (file)
@@ -22,7 +22,6 @@
 #define __REQUESTHANDLER_H
 
 #include <ResourceObject.h>
-#include <internal/ResourceAtrributesConverter.h>
 
 #include <OCResourceResponse.h>
 
@@ -73,7 +72,7 @@ namespace OIC
             CustomAttrRequestHandler(T&& attrs,
                     const OCEntityHandlerResult& result = DEFAULT_RESULT,
                     int errorCode = DEFAULT_ERROR_CODE) :
-                SimpleRequestHandler{ result, errorCode }, m_attrs{ std::forward<T>(attrs) }
+                SimpleRequestHandler{ result, errorCode }, m_attrs{ std::forward< T >(attrs) }
             {
             }
 
index d02f3d1..0bd8848 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <internal/RequestHandler.h>
 
+#include <internal/ResourceAttributesConverter.h>
 #include <internal/ResourceAttributesUtils.h>
 
 namespace OIC
@@ -93,5 +94,6 @@ namespace OIC
             }
             return m_requestHandler->buildResponse(resource, requestAttrs);
         }
+
     }
 }
index 8618f02..36309a9 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <internal/RequestHandler.h>
 #include <internal/AssertUtils.h>
-
+#include <internal/ResourceAttributesConverter.h>
 
 #include <logger.h>
 #include <OCPlatform.h>
@@ -95,6 +95,7 @@ namespace
 
         return Detail::sendResponse(resource, ocRequest, attrs, RESPONSE::defaultAction());
     }
+
 } // unnamed namespace
 
 
index e110c3a..eb18e4f 100644 (file)
@@ -25,7 +25,7 @@
 #include <ResourceObject.h>
 
 #include <internal/RequestHandler.h>
-#include <internal/ResourceAtrributesConverter.h>
+#include <internal/ResourceAttributesConverter.h>
 
 #include <OCPlatform.h>