X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fsimulator%2Fsrc%2Fcommon%2Fsimulator_utils.h;h=231078d181fd2d633b75e4519df5d9a2939e96e3;hb=01f8d734c2a2e3734ac73f8559fa347251da17cb;hp=23dd47f80ec3f0ae949764619da49098eff5194e;hpb=381e8c46a0611e41c55e87ba95e9199d9a75bf27;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/simulator/src/common/simulator_utils.h b/service/simulator/src/common/simulator_utils.h index 23dd47f..231078d 100644 --- a/service/simulator/src/common/simulator_utils.h +++ b/service/simulator/src/common/simulator_utils.h @@ -34,7 +34,7 @@ #include /** - * Utilities for Invokation of OC platfrom level APIs. + * Utilities for Invocation of OC platfrom level APIs. */ template typename std::enable_if()(std::declval()...))>::value>::type @@ -58,12 +58,29 @@ invokeocplatform(FnT fn, ArgsT &&...args) namespace OC { + // Read-Only interface + const std::string READ_INTERFACE = "oic.if.r"; + + // Read-Write Interface + const std::string READWRITE_INTERFACE = "oic.if.rw"; + + // Actuator Interface + const std::string ACTUATOR_INTERFACE = "oic.if.a"; + + // Sensor Interface + const std::string SENSOR_INTERFACE = "oic.if.s"; + class OCRepresentation; } std::string getPayloadString(const OC::OCRepresentation &); +std::string getPayloadTypeString(OCPayloadType type); std::string getRequestString(const std::map &queryParams, const OC::OCRepresentation &rep); std::string getRequestString(const std::map &queryParams); + +#define VALIDATE_INPUT(CONDITION, MSG) if (CONDITION) {throw InvalidArgsException(SIMULATOR_INVALID_PARAM, MSG);} +#define VALIDATE_CALLBACK(CALLBACK) if (!CALLBACK){throw InvalidArgsException(SIMULATOR_INVALID_CALLBACK, "Invalid callback!");} + #endif \ No newline at end of file