VMCFCoreImpl.h

Go to the documentation of this file.
00001 /* **********************************************************
00002  * Copyright 2007 VMware, Inc.  All rights reserved. -- VMware Confidential
00003  * **********************************************************/
00004 
00005 #ifndef _VMCF_CORE_IMPL_H_
00006 #define _VMCF_CORE_IMPL_H_
00007 
00016 #include "VMCFCore.h"
00017 #include "VMCFClass.h"
00018 
00019 
00020 #if !defined(CORBA_OBJECT_NIL)
00021 #   define CORBA_OBJECT_NIL (CORBA_Object)0
00022 #endif
00023 
00024 #if !defined(CORBA_TRUE)
00025 #   define CORBA_TRUE (CORBA_boolean)1
00026 #endif
00027 
00028 #if !defined(CORBA_FALSE)
00029 #   define CORBA_FALSE (CORBA_boolean)0
00030 #endif
00031 
00032 
00033 /* VMCF/ORB initialization and retrieval */
00034 
00035 VMCF_EXTERN CORBA_boolean
00036 VMCFCoreImpl_init(CORBA_boolean sslEnabled,
00037                   void *clientCtx);
00038 
00039 VMCF_EXTERN CORBA_Object
00040 VMCFCoreImpl_getORB(void);
00041 
00042 
00043 /* Global locking */
00044 
00045 VMCF_EXTERN void
00046 VMCFCoreImpl_lock(void);
00047 
00048 VMCF_EXTERN void
00049 VMCFCoreImpl_unlock(void);
00050 
00051 
00052 /* Server operations */
00053 
00054 struct VMCFServer_s;
00055 typedef struct VMCFServer_s *VMCFServer;
00056 
00057 
00058 VMCF_EXTERN VMCFServer
00059 VMCFCoreImpl_createServer(char *tinfo,
00060                           void *serverCtx,
00061                           CORBA_Environment *env);
00062 
00063 VMCF_EXTERN void
00064 VMCFCoreImpl_closeServer(VMCFServer server,
00065                          CORBA_Environment *env);
00066 
00067 
00068 /* Exception handling */
00069 
00071 #define VMCF_EXCEPTION_RAISED(env) ((env)->_major != CORBA_NO_EXCEPTION)
00072 
00073 
00075 #define VMCF_BREAK_ON_EXCEPTION(env) { if (VMCF_EXCEPTION_RAISED(env)) break; }
00076 
00077 
00086 #define VMCF_ASSERT_ARG(test, env, onfail) {                         \
00087    if (!(test)) {                                                    \
00088       VMCFCoreImpl_raiseInvalidArguments(env, NULL);                 \
00089       onfail;                                                        \
00090    }                                                                 \
00091 }
00092 
00093 
00102 #define VMCF_ASSERT_ALLOC(ptr, env, onfail) {                        \
00103    if ((ptr) == NULL) {                                              \
00104       CORBA_exception_set((env), CORBA_USER_EXCEPTION,               \
00105                           ex_VMCFCore_NoResources, NULL);            \
00106       onfail;                                                        \
00107    }                                                                 \
00108 }
00109 
00110 
00111 VMCF_EXTERN void
00112 VMCFCoreImpl_raiseInvalidArguments(CORBA_Environment *env, CORBA_string msg);
00113 
00114 
00115 /* General convenience functions */
00116 
00123 #define VMCF_IS_EMPTY(str) ((str) == NULL || *(str) == '\0')
00124 
00125 
00126 VMCF_EXTERN void
00127 VMCFCoreImpl_releaseObject(void *obj);
00128 
00129 VMCF_EXTERN CORBA_string
00130 VMCFCoreImpl_strdup(const CORBA_string src);
00131 
00134 #endif /* _VMCF_CORE_IMPL_H_ */
00135 

Generated on Tue Dec 22 15:48:41 2009 for VMCF by  doxygen 1.5.3