RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
00001 00009 #ifndef __service__service_base_js_h__ 00010 #define __service__service_base_js_h__ 00011 00012 #include "service_js.h" 00013 #include "soa/service/service_base.h" 00014 #include "soa/js/js_wrapped.h" 00015 #include "jml/utils/smart_ptr_utils.h" 00016 00017 namespace Datacratic { 00018 namespace JS { 00019 00020 /******************************************************************************/ 00021 /* SERVICE PROXIES */ 00022 /******************************************************************************/ 00023 00024 std::shared_ptr<ServiceProxies> 00025 from_js(const JSValue& value, std::shared_ptr<ServiceProxies>*); 00026 00027 std::shared_ptr<ServiceProxies> 00028 from_js_ref(const JSValue& value, std::shared_ptr<ServiceProxies>*); 00029 00030 ServiceProxies* 00031 from_js(const JSValue& value, ServiceProxies**); 00032 00033 void 00034 to_js(JS::JSValue& value, const std::shared_ptr<ServiceProxies>& proxies); 00035 00036 00037 /******************************************************************************/ 00038 /* SERVICE BASE */ 00039 /******************************************************************************/ 00040 00041 extern const char* const ServiceBaseName; 00042 00043 struct ServiceBaseJS : 00044 public JSWrapped2< 00045 ServiceBase, 00046 ServiceBaseJS, 00047 ServiceBaseName, 00048 serviceModule> 00049 { 00050 ServiceBaseJS(); 00051 ServiceBaseJS( 00052 v8::Handle<v8::Object> This, 00053 const std::shared_ptr<ServiceBase>& service = 00054 std::shared_ptr<ServiceBase>()); 00055 00056 static v8::Handle<v8::Value> New(const v8::Arguments& args); 00057 static void Initialize(); 00058 static v8::Handle<v8::Value> recordHit(const v8::Arguments& args); 00059 static v8::Handle<v8::Value> recordCount(const v8::Arguments& args); 00060 static v8::Handle<v8::Value> recordOutcome(const v8::Arguments& args); 00061 static v8::Handle<v8::Value> recordLevel(const v8::Arguments& args); 00062 }; 00063 00064 std::shared_ptr<ServiceBase> 00065 from_js(const JSValue& value, std::shared_ptr<ServiceBase>*); 00066 00067 std::shared_ptr<ServiceBase> 00068 from_js_ref(const JSValue& value, std::shared_ptr<ServiceBase>*); 00069 00070 ServiceBase* 00071 from_js(const JSValue& value, ServiceBase**); 00072 00073 void 00074 to_js(JS::JSValue& value, const std::shared_ptr<ServiceBase>& service); 00075 00076 00077 00078 00079 } // namespace JS 00080 } // Datacratic 00081 00082 #endif // __service__service_base_js_h__