⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mcowrap.h

📁 PB 熟悉的哥们希望大家可以互相学习一下
💻 H
📖 第 1 页 / 共 3 页
字号:
/*******************************************************************
 *                                                                 *
 *  This file is a part of the eXtremeDB source code               *
 *  Copyright (c) 2001-2007 McObject LLC                           *
 *  All Rights Reserved                                            *
 *                                                                 *
 *  eXtremeDB runtime generated interface definitions              *
 *                                                                 *
 *******************************************************************/
/*
 * ++
 *
 *\file  mcowrap.h
 *
 * PROJECT:   eXtremeDB\n
 *
 * SUBSYSTEM: eXtremeDB internal interface\n
 *
 * MODULE:    mcowrap.h\n
 *
 * ABSTRACT:  eXtremeDB internal interface definitions\n
 *
 * HISTORY:\n
 *            1. 2000-2002   TP versions 1-2 created\n
 *            2. 01-Jul-2002 TP dictionary extended (XML support)\n
 *            3. 25-Aug-2002 TP added layout sizes to mco_dict_struct_t\n
 *            4. 29-Aug-2002 TP vectors, arrays api modified, version 2.1\n
 *            5. 12-Sep-2002 TP added XML Schema support\n
 *            6. 27-Sep-2002 TP added n_structs\n
 *            7. 27-Dec-2002 TP High Availability support\n
 *            8. 23-Feb-2003 TP added num_HA_estimation\n
 *            9. 03-Jun-2003 TP added initialization to numeric fields\n
 *           10. 08-Jun-2004 TP added compact method\n
 *           11. 22-Oct-2004 AK added refto_class field\n
 *           12. 01-Nov-2004 AK added order_no field\n
 *           13. 04-Dec-2004 AK added mco_is_the_objects_same() routine\n
 *           14. 15-Nov-2005 SS adopted to Doxygen\n 
 * --
 */

#ifndef MCO_WRAP__H__
    #define MCO_WRAP__H__

    #ifdef __cplusplus
        extern "C"
        {
        #endif 

        #include "mco.h"
        #include "mcotargt.h"

        #ifdef __cplusplus
        }
    #endif 

    #ifdef MCO_CFG_WCHAR_SUPPORT
        #include <stdarg.h>
        #ifndef _VXWORKS
            #include <wchar.h>
        #else 
            #include <stdlib.h>
        #endif 
    #endif 

    #ifdef __cplusplus
        extern "C"
        {
        #endif 

        #if defined(MCO_PLATFORM_X64) && defined(MCO_LONG_OBJECTS)
            typedef mco_puint mco_obj_offset;
        #else //MCO_PLATFORM_X64_MCO_LONG_OBJECTS
            typedef uint4 mco_obj_offset;
        #endif //MCO_PLATFORM_X64_MCO_LONG_OBJECTS

        #if defined(MCO_PLATFORM_X64) && !defined(MCO_BIG_STATIC_FIELD)
            #define MCO_BIG_STATIC_FIELD
        #endif 

        #ifdef MCO_BIG_STATIC_FIELD
            typedef uint4 mco_obj_fld_offset;
        #else //MCO_BIG_STATIC_FIELD
            typedef uint2 mco_obj_fld_offset;
        #endif //MCO_BIG_STATIC_FIELD

        typedef mco_obj_fld_offset mco_obj_fld_size;

        /** dictionary: */

        /** layout for field/structure in a parent struct/class */
        typedef struct mco_datalayout_t_
        {
            mco_obj_fld_size c_size; /**< compact: size not including dynamic part    */
            uint2 c_align; /**< compact: align                              */
            mco_obj_fld_offset c_offset;
            mco_obj_fld_size u_size; /**< notcompact: size not including dynamic part */
            uint2 u_align; /**< notcompact: align                           */
            mco_obj_fld_offset u_offset;
        } mco_datalayout_t;



        /**
        field information relative to holding struct/class
         */
        typedef struct mco_dict_field_t_
        {
            const char* name;
            mco_datalayout_t layout;
            uint1 field_el_type; /**< MCO_DB_FLDTYPE_E */
            uint1 flags; /**< MCO_DICT_FLDF_   */
            uint2 array_size; /**< for array fields */
            int4 struct_num; /**< if field is nested struct/optional struct, index of mco_dict_struct_t_ */
            mco_obj_fld_size field_size; /**< of the field, 0 when statically unknown  */
            int2 refto_class; /**< index of a class inside mco_dict_class_info_t table */
            void* init_data; /**< depending on type; array has init values for each el */
            uint1 order_no; /**< order of the field in class declaration */
            uint2 event_id;
            uint1 pad1; /**< paddings */
        } mco_dict_field_t;



        typedef struct mco_dict_struct_t_
        {
            const char* name;
            uint2 flags; /**< MCO_DICT_STF_...  */
            uint2 n_fields;
            mco_dict_field_t* fields; /**< [ n_fields ]      */
            mco_obj_fld_size c_size; /**< compact: size not including dynamic part    */
            uint2 c_align; /**< compact: align                           */
            mco_obj_fld_size u_size; /**< notcompact: size not including dynamic part */
            uint2 u_align; /**< notcompact: align                           */
        } mco_dict_struct_t;


        typedef struct mco_dict_index_field_t_ /**< index field description                  */
        {

            #if defined(MCO_PLATFORM_X64) && defined(MCO_LONG_OBJECTS)
                /**< for an index compact flag is known statically        */
                mco_puint field_offset; /**< for vstruct_based - offset in a structure - vect el  */
                /**< For vtype_based: 0                       */
                mco_puint vect_field_offset; /**< offset used for v_based indexes.         */
            #else //MCO_PLATFORM_X64_MCO_LONG_OBJECTS
                /**< for an index compact flag is known statically        */
                uint4 field_offset; /**< for vstruct_based - offset in a structure - vect el  */
                /**< For vtype_based: 0                       */
                uint4 vect_field_offset; /**< offset used for v_based indexes.         */

            #endif //MCO_PLATFORM_X64_MCO_LONG_OBJECTS

            mco_obj_fld_size field_size; /**< of the field, 0 when statically unknown  */
            uint1 field_type; /**< MCO_DB_FLDTYPE_E                         */
            uint1 fld_flags; /**< MCO_DB_INDFLD_...                        */
            // MCO_CFG_SEPINDECES
            uint2 fld_idx; /**< index of the field inside a struct       */
        } mco_dict_index_field_t;


        /**
        Index descriptor
         */
        typedef struct mco_dict_index_t_
        {
            uint2 class_code;
            uint2 numof_fields;
            #if defined(MCO_PLATFORM_X64) && defined(MCO_LONG_OBJECTS)
                mco_pint vect_field_offset; /**< -1 for not v_based                       */
            #else //MCO_PLATFORM_X64_MCO_LONG_OBJECTS
                uint4 vect_field_offset; /**< -1 for not v_based                       */
            #endif //MCO_PLATFORM_X64_MCO_LONG_OBJECTS
            uint2 flags; /**< MCO_DB_INDF_...                          */
            mco_dict_index_field_t* fields;
            mco_puint numof_keys_estimate; /**< for hash indexes                         */
            /* #ifdef MCO_CFG_USERDEF_IDX */
            int2 userdef_id; /** number of custom-index or -1 for non-userdef indices */
            /* #endif */
        } mco_dict_index_t;



        typedef struct mco_dict_class_info_t_ /**< indexes specification for a class        */
        {
            int2 first_index_num; /**< index numbers are sequential for a class */
            int2 last_index_num; /**< if < first_index_num => no indexes       */

            int2 list_index_num; /**< <0 => no list support                    */
            int2 autoid_index_num; /**< <0 => no autoid                          */
            mco_obj_fld_size fixedsize; /**< 0 for dynamic classes                    */
            uint2 autoid_offset; /**< - for compact or not; 0 if no autoid     */
            int2 history_index_num; /**< -1 if no history index                   */
            uint2 history_length; /**< 0 if no history index                    */
            uint2 history_offset; /**< 0 if no history field, for compact or not*/
            int2 first_event_num; /**< events numbers are sequential            */
            int2 last_event_num; /**< if < last_event_num => no events         */
            uint2 flags; /**< MCO_DB_TYPINFO_...                       */
            mco_dict_struct_t* struct_ptr; /**< layout & members info                    */
            uint4 init_size; /**< initial allocation size */
            uint2 auto_oid_offset; /**< HA support              */
            uint2 event_id_new;
            uint2 event_id_delete;
            uint2 event_id_delete_all;
        } mco_dict_class_info_t;


        typedef struct mco_dict_event_t_
        {
            uint2 class_code;
            uint2 flags;

            #if defined(MCO_PLATFORM_X64) && defined(MCO_LONG_OBJECTS)
                /**< MCO_DB_EVENT_T_...                       */
                mco_puint field_offset; /**< for update event                         */
            #else //MCO_PLATFORM_X64_MCO_LONG_OBJECTS
                /**< MCO_DB_EVENT_T_...                       */
                uint4 field_offset; /**< for update event                         */
            #endif //MCO_PLATFORM_X64_MCO_LONG_OBJECTS
            mco_obj_fld_size field_size; /**< of the field, 0 when statically unknown  */
            uint1 field_type; /**< MCO_DB_FLDTYPE_E                         */
            uint1 reserved;
        } mco_dict_event_t;

        /**
        Dictionary structure
         */
        typedef struct mco_dictionary_t_
        {
            const char** str_class_names; /**< debug mode only */
            const char** str_index_names; /**< debug mode only */

            uint2 version_major;
            uint2 version_minor;
            uint2 version_build;
            uint2 magic_number;

            uint4 flags; /**< MCO_DICT_F_   */
            uint2 oid_is_supported;
            uint2 auto_oid_supported; /**< HA support */

            /* counters: */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -