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>
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#ifndef __PRESENCESUBSCRIBER_H
-#define __PRESENCESUBSCRIBER_H
+#ifndef COMMON_PRESENCESUBSCRIBER_H
+#define COMMON_PRESENCESUBSCRIBER_H
#include <string>
#include <functional>
}
}
-#endif // __PRESENCESUBSCRIBER_H
+#endif // COMMON_PRESENCESUBSCRIBER_H
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#ifndef __PRIMITIVEEXCEPTION_H
-#define __PRIMITIVEEXCEPTION_H
+#ifndef RES_MANIPULATION_PRIMITIVEEXCEPTION_H
+#define RES_MANIPULATION_PRIMITIVEEXCEPTION_H
#include <string>
{
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
{
class PlatformException: public PrimitiveException
{
public:
- PlatformException(OCStackResult reason);
+ explicit PlatformException(OCStackResult reason);
OCStackResult getReasonCode() const;
std::string getReason() const;
}
}
-#endif //__PRIMITIVEEXCEPTION_H
+#endif // RES_MANIPULATION_PRIMITIVEEXCEPTION_H
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#ifndef __PRIMITIVERESOURCE_H
-#define __PRIMITIVERESOURCE_H
+#ifndef COMMON_PRIMITIVERESOURCE_H
+#define COMMON_PRIMITIVERESOURCE_H
#include <functional>
#include <string>
}
}
-#endif // __PRIMITIVERESOURCE_H
+#endif // COMMON_PRIMITIVERESOURCE_H
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#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.
}
}
-#endif // __RESOURCEATTRIBUTES_H
+#endif // RES_MANIPULATION_RESOURCEATTRIBUTES_H
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#ifndef __RESPONSESTATEMENT_H
-#define __RESPONSESTATEMENT_H
+#ifndef COMMON_RESPONSESTATEMENT_H
+#define COMMON_RESPONSESTATEMENT_H
#include <string>
#include <vector>
}
}
-#endif // __RESPONSESTATEMENT_H
+#endif // COMMON_RESPONSESTATEMENT_H
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#ifndef __PRIMITIVERESOURCE_ASSERTUTILS_H
-#define __PRIMITIVERESOURCE_ASSERTUTILS_H
+#ifndef COMMON_INTERNAL_ASSERTUTILS_H
+#define COMMON_INTERNAL_ASSERTUTILS_H
#include <cstdint>
}
}
-#endif // __PRIMITIVERESOURCE_ASSERTUTILS_H
+#endif // COMMON_INTERNAL_ASSERTUTILS_H
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#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
{
}
}
-#endif // __PRIMITIVERESOURCEIMPL_H
+#endif // COMMON_INTERNAL_PRIMITIVERESOURCEIMPL_H
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#ifndef __RESOURCEATTRIBUTESCONVERTER_H
-#define __RESOURCEATTRIBUTESCONVERTER_H
+#ifndef COMMON_INTERNAL_RESOURCEATTRIBUTESCONVERTER_H
+#define COMMON_INTERNAL_RESOURCEATTRIBUTESCONVERTER_H
#include <ResourceAttributes.h>
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
{
ResourceAttributes m_target;
};
- class AttrVisitor
+ class OCRepresentationBuilder
{
public:
- AttrVisitor() = default;
+ OCRepresentationBuilder() = default;
template< typename T >
void operator()(const std::string& key, const T& value)
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
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-/*
- * 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
{
}
}
-#endif // __RESOURCEATTRIBUTESUTILS_H
+#endif // COMMON_INTERNAL_RESOURCEATTRIBUTESUTILS_H
#include <ResourceAttributes.h>
#include <internal/ResourceAttributesUtils.h>
-#include <internal/ResourceAtrributesConverter.h>
+#include <internal/ResourceAttributesConverter.h>
#include <boost/lexical_cast.hpp>
#include <ResponseStatement.h>
-#include <internal/ResourceAtrributesConverter.h>
+#include <internal/ResourceAttributesConverter.h>
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) }
{
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include <ResourceAttributes.h>
-#include <internal/ResourceAtrributesConverter.h>
+#include <internal/ResourceAttributesConverter.h>
#include <internal/ResourceAttributesUtils.h>
#include <gtest/gtest.h>
#define __REQUESTHANDLER_H
#include <ResourceObject.h>
-#include <internal/ResourceAtrributesConverter.h>
#include <OCResourceResponse.h>
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) }
{
}
#include <internal/RequestHandler.h>
+#include <internal/ResourceAttributesConverter.h>
#include <internal/ResourceAttributesUtils.h>
namespace OIC
}
return m_requestHandler->buildResponse(resource, requestAttrs);
}
+
}
}
#include <internal/RequestHandler.h>
#include <internal/AssertUtils.h>
-
+#include <internal/ResourceAttributesConverter.h>
#include <logger.h>
#include <OCPlatform.h>
return Detail::sendResponse(resource, ocRequest, attrs, RESPONSE::defaultAction());
}
+
} // unnamed namespace
#include <ResourceObject.h>
#include <internal/RequestHandler.h>
-#include <internal/ResourceAtrributesConverter.h>
+#include <internal/ResourceAttributesConverter.h>
#include <OCPlatform.h>