Permalink
Browse files

update

Signed-off-by: yayanyang <yayanyang@gmail.com>
  • Loading branch information...
yayanyang committed Aug 27, 2012
1 parent bdeff9c commit 512cc5873d618f4c2bfbf0f2830c580ccd6ffab0
View
@@ -1,5 +0,0 @@
-lemon_c_cxx_files(SRC)
-
-lemon_library_project(lemon-dtrace ${SRC})
-
-target_link_libraries(lemon-dtrace lemon-sys lemon-io lemonxx)
View
@@ -1,121 +0,0 @@
-#include <lemon/dtrace/abi.h>
-#include <lemon/dtrace/object.hpp>
-
-using namespace lemon;
-using namespace lemon::dtrace;
-
-LEMON_DTRACE_API
- LemonDTraceService
- LemonCreateDTraceService(
- __lemon_in const char * url,
- __lemon_inout LemonErrorInfo * errorCode)
-{
- try
- {
- return reinterpret_cast<LemonDTraceService>(Create(url));
- }
- catch(const lemon::error_info &e)
- {
- *errorCode = e;
-
- return LEMON_HANDLE_NULL_VALUE;
- }
-}
-
-LEMON_DTRACE_API
- void
- LemonCloseDTraceService(
- __lemon_in LemonDTraceService service)
-{
- delete reinterpret_cast<IService*>(service);
-}
-
-LEMON_DTRACE_API
- LemonDTraceController
- LemonCreateDTraceController(
- __lemon_in LemonDTraceService service,
- __lemon_inout LemonErrorInfo * errorCode)
-{
- try
- {
- return reinterpret_cast<LemonDTraceController>(reinterpret_cast<IService*>(service)->CreateController());
- }
- catch(const lemon::error_info &e)
- {
- *errorCode = e;
-
- return LEMON_HANDLE_NULL_VALUE;
- }
-}
-
-LEMON_DTRACE_API
- void
- LemonCloseDTraceController(
- __lemon_free LemonDTraceController controller )
-{
- reinterpret_cast<IController*>(controller)->Release();
-}
-
-
-LEMON_DTRACE_API
- LemonDTraceConsumer
- LemonCreateDTraceConsumer(
- __lemon_in LemonDTraceController controller,
- __lemon_in LemonDTraceConsumerCallback callback,
- __lemon_in void * userdata,
- __lemon_inout LemonErrorInfo *errorCode)
-{
- try
- {
- return reinterpret_cast<LemonDTraceConsumer>(reinterpret_cast<IController*>(controller)->CreateConsumer(callback,userdata));
- }
- catch(const lemon::error_info &e)
- {
- *errorCode = e;
-
- return LEMON_HANDLE_NULL_VALUE;
- }
-}
-
-LEMON_DTRACE_API
- void
- LemonCloseDTraceConsumer(
- __lemon_free LemonDTraceConsumer consumer)
-{
- delete reinterpret_cast<Consumer*>(consumer);
-}
-
-
-LEMON_DTRACE_API
- void LemonOpenTrace(
- __lemon_in LemonDTraceController controller,
- __lemon_in const LemonUuid * provider,
- __lemon_in lemon_dtrace_flag flag,
- __lemon_inout LemonErrorInfo *errorCode)
-{
- try
- {
- reinterpret_cast<IController*>(controller)->OpenTrace(provider,flag);
- }
- catch(const lemon::error_info &e)
- {
- *errorCode = e;
- }
-}
-
-LEMON_DTRACE_API
- void LemonCloseTrace(
- __lemon_in LemonDTraceController controller,
- __lemon_in const LemonUuid * provider,
- __lemon_in lemon_dtrace_flag flag,
- __lemon_inout LemonErrorInfo *errorCode)
-{
- try
- {
- reinterpret_cast<IController*>(controller)->CloseTrace(provider,flag);
- }
- catch(const lemon::error_info &e)
- {
- *errorCode = e;
- }
-}
View
@@ -1,98 +0,0 @@
-/**
-*
-* @file abi
-* @brief Copyright (C) 2012 yayanyang All Rights Reserved
-* @author yayanyang
-* @version 1.0.0.0
-* @date 2012/08/20
-*/
-#ifndef LEMON_DTRACE_ABI_H
-#define LEMON_DTRACE_ABI_H
-#include <lemon/sys/abi.h>
-#include <lemon/dtrace/configure.h>
-
-LEMON_DECLARE_HANDLE(LemonDTraceMessage);
-
-LEMON_DECLARE_HANDLE(LemonDTraceService);
-
-LEMON_DECLARE_HANDLE(LemonDTraceProvider);
-
-LEMON_DECLARE_HANDLE(LemonDTraceConsumer);
-
-LEMON_DECLARE_HANDLE(LemonDTraceController);
-
-typedef lemon_uint64_t lemon_dtrace_flag;
-
-#define LEMON_DTRACE_MESSAGE_MAX_LENGTH 1024
-
-#define LEMON_MAKE_DTRACE_FLAG(level,catalog)\
- (((((lemon_uint64_t)level) << 32) & 0xffffffff00000000) |\
- (((lemon_uint64_t)catalog) & 0x00000000ffffffff))
-
-#define LEMON_MAKE_DTRACE_FLAG_LEVEL(flag)\
- ((((lemon_uint64_t)flag) >> 32) & 0x00000000ffffffff)
-
-#define LEMON_MAKE_DTRACE_FLAG_CATALOG(flag)\
- (((lemon_uint64_t)flag) & 0x00000000ffffffff)
-
-typedef void(*LemonDTraceConsumerCallback)(void * userdata,LemonDTraceMessage message);
-
-/*
- * @brief Create DTrace Service
- *
- * @param url examples:
- * 1) "listen://0.0.0.0:82170" //this url create real service,support RPC call
- * 2) "local" or NULL //this url create real service,which not support RPC call
- * 3) "connect://0.0.0.0:82170" //this url create proxy service,which is RPC call sub object
- */
-LEMON_DTRACE_API
- LemonDTraceService
- LemonCreateDTraceService(
- __lemon_in const char * url,
- __lemon_inout LemonErrorInfo * errorCode);
-
-LEMON_DTRACE_API
- void
- LemonCloseDTraceService(
- __lemon_in LemonDTraceService service);
-
-LEMON_DTRACE_API
- LemonDTraceController
- LemonCreateDTraceController(
- __lemon_in LemonDTraceService service,
- __lemon_inout LemonErrorInfo * errorCode);
-
-LEMON_DTRACE_API
- void
- LemonCloseDTraceController(
- __lemon_free LemonDTraceController controller );
-
-LEMON_DTRACE_API
- void LemonOpenTrace(
- __lemon_in LemonDTraceController controller,
- __lemon_in const LemonUuid * provider,
- __lemon_in lemon_dtrace_flag flag,
- __lemon_inout LemonErrorInfo *errorCode);
-
-LEMON_DTRACE_API
- void LemonCloseTrace(
- __lemon_in LemonDTraceController controller,
- __lemon_in const LemonUuid * provider,
- __lemon_in lemon_dtrace_flag flag,
- __lemon_inout LemonErrorInfo *errorCode);
-
-LEMON_DTRACE_API
- LemonDTraceConsumer
- LemonCreateDTraceConsumer(
- __lemon_in LemonDTraceController controller,
- __lemon_in LemonDTraceConsumerCallback callback,
- __lemon_in void * userdata,
- __lemon_inout LemonErrorInfo *errorCode);
-
-LEMON_DTRACE_API
- void
- LemonCloseDTraceConsumer(
- __lemon_free LemonDTraceConsumer consumer);
-
-
-#endif //LEMON_DTRACE_ABI_H
View
@@ -1,13 +0,0 @@
-assembly =
-{
- name = "lemon-dtrace";
-
- errorcode =
- {
- {
- name = "PROVIDER_ID_ERROR";
-
- descrpition = "there is already a provider,which's uuid is same as the creating one";
- }
- };
-};
View
@@ -1,43 +0,0 @@
-#include <lemon/sys/assembly.h>
-#include <lemon/dtrace/local/listener.hpp>
-
-
-namespace lemon{namespace dtrace{
-
- IProvider * Listener::CreateProvider(const LemonUuid * /*provider*/)
- {
- error_info errorCode;
-
- LEMON_USER_ERROR(errorCode,LEMON_SYS_NOT_IMPLEMENT);
-
- throw errorCode;
- }
-
- void Listener::CloseProvider(IProvider * /*provider*/)
- {
- error_info errorCode;
-
- LEMON_USER_ERROR(errorCode,LEMON_SYS_NOT_IMPLEMENT);
-
- throw errorCode;
- }
-
- IController * Listener::CreateController()
- {
- error_info errorCode;
-
- LEMON_USER_ERROR(errorCode,LEMON_SYS_NOT_IMPLEMENT);
-
- throw errorCode;
- }
-
- void Listener::CloseController(IController * /*controller*/)
- {
- error_info errorCode;
-
- LEMON_USER_ERROR(errorCode,LEMON_SYS_NOT_IMPLEMENT);
-
- throw errorCode;
- }
-
-}}
View
@@ -1,43 +0,0 @@
-/**
-*
-* @file listener
-* @brief Copyright (C) 2012 yayanyang All Rights Reserved
-* @author yayanyang
-* @version 1.0.0.0
-* @date 2012/08/20
-*/
-#ifndef LEMON_DTRACE_LOCAL_LISTENER_HPP
-#define LEMON_DTRACE_LOCAL_LISTENER_HPP
-
-#include <lemonxx/io/endpoint.hpp>
-#include <lemon/dtrace/local/service.hpp>
-
-
-namespace lemon{namespace dtrace{
-
- class Listener : public IService
- {
- public:
-
- Listener(const lemon::io::ip::endpoint & ep)
- {
- _ep = ep;
- }
-
- IProvider * CreateProvider(const LemonUuid * provider);
-
- void CloseProvider(IProvider * provider);
-
- IController * CreateController();
-
- void CloseController(IController * controller);
-
- private:
-
- lemon::io::ip::endpoint _ep;
- };
-
-}}
-
-
-#endif //LEMON_DTRACE_LOCAL_LISTENER_HPP
Oops, something went wrong.

0 comments on commit 512cc58

Please sign in to comment.