(file) Return to JMPIImpl.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2 / JMPI

Diff for /pegasus/src/Pegasus/ProviderManager2/JMPI/JMPIImpl.h between version 1.15 and 1.19

version 1.15, 2005/06/25 00:04:29 version 1.19, 2006/02/08 22:10:20
Line 1 
Line 1 
 //%2005////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
Line 8 
Line 8 
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 // EMC Corporation; VERITAS Software Corporation; The Open Group. // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 46 
Line 48 
 #include <Pegasus/Common/String.h> #include <Pegasus/Common/String.h>
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/HashTable.h> #include <Pegasus/Common/HashTable.h>
   #include <Pegasus/Common/CIMType.h>
   #include <Pegasus/Common/Mutex.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 113 
Line 117 
  
    static ClassTable  _classTable;    static ClassTable  _classTable;
    static ObjectTable _objectTable;    static ObjectTable _objectTable;
   
      static Mutex _initMutex;
 }; };
  
 class _nameSpace { class _nameSpace {
Line 130 
Line 136 
    String nameSpace_;    String nameSpace_;
 }; };
  
 static int pTypeToJType[]=  class _dataType {
  /* CIMTYPE_BOOLEAN,   public static final int BOOLEAN  = 10; 0     public:
     CIMTYPE_UINT8,     public static final int UINT8    = 1;  1  
     CIMTYPE_SINT8,     public static final int SINT8    = 2;  2     _dataType (int          type,
     CIMTYPE_UINT16,    public static final int UINT16   = 3;  3                int          size,
     CIMTYPE_SINT16,    public static final int SINT16   = 4;  4                Boolean      reference,
     CIMTYPE_UINT32,    public static final int UINT32   = 5;  5                Boolean      null,
     CIMTYPE_SINT32,    public static final int SINT32   = 6;  6                Boolean      array,
     CIMTYPE_UINT64,    public static final int UINT64   = 7;  7                String&      refClass,
     CIMTYPE_SINT64,    public static final int SINT64   = 8;  8                Boolean      fromProperty)
     CIMTYPE_REAL32,    public static final int REAL32   = 11; 9        : _type(type),
     CIMTYPE_REAL64,    public static final int REAL64   = 12; 10          _size(size),
     CIMTYPE_CHAR16,    public static final int CHAR16   = 14; 11          _reference(reference),
     CIMTYPE_STRING,    public static final int STRING   = 9;  12          _array(array),
     CIMTYPE_DATETIME,  public static final int DATETIME = 13; 12          _refClass(refClass),
     CIMTYPE_REFERENCE  public static final int REFERENCE = 0x32+1; 14          _fromProperty(fromProperty)
     CIMTYPE_OBJECT     public static final int OBJECT   = 15; 15     {
      }
   
      _dataType (int          type)
         : _type(type),
           _size(1),
           _reference(false),
           _array(false),
           _refClass(String::EMPTY),
           _fromProperty(false)
      {
      }
   
      _dataType (int          type,
                 int          size)
         : _type(type),
           _size(size),
           _reference(false),
           _array(true),
           _refClass(String::EMPTY),
           _fromProperty(true)
      {
      }
   
      _dataType (int          type,
                 const String ref)
          : _type(type),
            _size(0),
            _reference(true),
            _array(false),
            _refClass(ref),
            _fromProperty(true)
      {
      }
   
      static int convertCTypeToJavaType (CIMType cType, bool *pfSuccess)
      {
         static int cTypeToJType[]=
         /*  CIMType.h                CIMDataType.java
             CIMTYPE_BOOLEAN,     0   public static final int BOOLEAN   =      10;
             CIMTYPE_UINT8,       1   public static final int UINT8     =       1;
             CIMTYPE_SINT8,       2   public static final int SINT8     =       2;
             CIMTYPE_UINT16,      3   public static final int UINT16    =       3;
             CIMTYPE_SINT16,      4   public static final int SINT16    =       4;
             CIMTYPE_UINT32,      5   public static final int UINT32    =       5;
             CIMTYPE_SINT32,      6   public static final int SINT32    =       6;
             CIMTYPE_UINT64,      7   public static final int UINT64    =       7;
             CIMTYPE_SINT64,      8   public static final int SINT64    =       8;
             CIMTYPE_REAL32,      9   public static final int REAL32    =      11;
             CIMTYPE_REAL64,     10   public static final int REAL64    =      12;
             CIMTYPE_CHAR16,     11   public static final int CHAR16    =      14;
             CIMTYPE_STRING,     12   public static final int STRING    =       9;
             CIMTYPE_DATETIME,   13   public static final int DATETIME  =      13;
             CIMTYPE_REFERENCE,  14   public static final int REFERENCE = 0x20+ 1;
             CIMTYPE_OBJECT      15   public static final int OBJECT    =      15;
         */
         //  p:      0  1  2  3  4  5  6  7  8  9 10 11 12 13 14     15
         {/* j: */  10, 1, 2, 3, 4, 5, 6, 7, 8,11,12,14, 9,13,0x20+1,15};
   
         if ((int)cType < (int)CIMTYPE_BOOLEAN || (int)cType > (int)CIMTYPE_OBJECT)
         {
            *pfSuccess = false;
   
            return cTypeToJType[0];
         }
         else
         {
            *pfSuccess = true;
   
            return cTypeToJType[cType];
         }
      }
   
      static CIMType convertJavaTypeToCType (int jType, bool *pfSuccess)
      {
         static int jTypeToCType[]=
         /*  CIMDataType.java                              CIMType.h
             public static final int UINT8     =       1;  CIMTYPE_UINT8,       1
             public static final int SINT8     =       2;  CIMTYPE_SINT8,       2
             public static final int UINT16    =       3;  CIMTYPE_UINT16,      3
             public static final int SINT16    =       4;  CIMTYPE_SINT16,      4
             public static final int UINT32    =       5;  CIMTYPE_UINT32,      5
             public static final int SINT32    =       6;  CIMTYPE_SINT32,      6
             public static final int UINT64    =       7;  CIMTYPE_UINT64,      7
             public static final int SINT64    =       8;  CIMTYPE_SINT64,      8
             public static final int STRING    =       9;  CIMTYPE_STRING,     12
             public static final int BOOLEAN   =      10;  CIMTYPE_BOOLEAN,     0
             public static final int REAL32    =      11;  CIMTYPE_REAL32,      9
             public static final int REAL64    =      12;  CIMTYPE_REAL64,     10
             public static final int DATETIME  =      13;  CIMTYPE_DATETIME,   13
             public static final int CHAR16    =      14;  CIMTYPE_CHAR16,     11
             public static final int REFERENCE = 0x20+ 1;  CIMTYPE_REFERENCE,  14
             public static final int OBJECT    =      15;  CIMTYPE_OBJECT      15
 */ */
    {10, 1, 2, 3, 4, 5, 6, 7, 8,11,12,14, 9,13,0x32+1, 15};        //  j:      0  1  2  3  4  5  6  7  8   9 10 11  12  13  14  15
 //   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14      15        {/* p: */   0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 0, 9, 10, 13, 11, 15};
   
         if (jType < 1)
         {
            *pfSuccess = false;
  
 static int jTypeToPType[]=           return CIMTYPE_BOOLEAN;
    {0, 1, 2, 3, 4, 5, 6, 7, 8,12, 0, 9,10,12,14,15};        }
 //  0  1  2  3  4  5  6  7  8  9 10 11 12 13,??,15        else if (jType <= 15)
         {
            *pfSuccess = true;
   
            return (CIMType)jTypeToCType[jType];
         }
         else if (jType == 0x20 + 1) // REFERENCE
         {
            *pfSuccess = true;
  
            return CIMTYPE_REFERENCE;
         }
         else
         {
            *pfSuccess = false;
   
            return CIMTYPE_BOOLEAN;
         }
      }
   
      static char *convertJavaTypeToChars (int jType, bool *pfSuccess)
      {
    static char *jTypeToChars[]= {    static char *jTypeToChars[]= {
         NULL,        /* CIMDataType.java                             */ NULL,
         "uint8",        /* public static final int UINT8     =       1; */ "uint8",
         "sint8",        /* public static final int SINT8     =       2; */ "sint8",
         "uint16",        /* public static final int UINT16    =       3; */ "uint16",
         "sint16",        /* public static final int SINT16    =       4; */ "sint16",
         "uint32",        /* public static final int UINT32    =       5; */ "uint32",
         "sint32",        /* public static final int SINT32    =       6; */ "sint32",
         "uint64",        /* public static final int UINT64    =       7; */ "uint64",
         "sint64",        /* public static final int SINT64    =       8; */ "sint64",
         "string",        /* public static final int STRING    =       9; */ "string",
         "boolean",        /* public static final int BOOLEAN   =      10; */ "boolean",
         "real32",        /* public static final int REAL32    =      11; */ "real32",
         "real64",        /* public static final int REAL64    =      12; */ "real64",
         "datetime",        /* public static final int DATETIME  =      13; */ "datetime",
         "char16",        /* public static final int CHAR16    =      14; */ "char16",
         "object" };        /* public static final int OBJECT    =      15; */ "object"
         };
  
         if (jType < 1)
         {
            *pfSuccess = false;
  
 class _dataType {           return NULL;
   public:        }
    int     _type,_size;        else if (jType <= 15)
         {
            *pfSuccess = true;
   
            return jTypeToChars[jType];
         }
         else if (jType == 0x20 + 1) // REFERENCE
         {
            *pfSuccess = true;
   
            return "reference";
         }
         else
         {
            *pfSuccess = false;
   
            return NULL;
         }
      }
   
      int     _type;
      int     _size;
    Boolean _reference;    Boolean _reference;
    Boolean _null;    Boolean _null;
    Boolean _array;    Boolean _array;
    String _refClass;    String _refClass;
    Boolean _fromProperty;    Boolean _fromProperty;
   
    _dataType(int type, int size, Boolean reference,  
              Boolean null, Boolean array, String &refClass, Boolean fromProperty) :  
       _type(type), _size(size), _reference(reference), _array(array),  
       _refClass(refClass), _fromProperty(fromProperty) {}  
    _dataType(int type) :  
              _type(type), _size(1), _reference(false), _array(false),  
        _refClass(String::EMPTY), _fromProperty(false) {}  
    _dataType(int type, int size) :  
        _type(type), _size(size), _reference(false), _array(true),  
        _refClass(String::EMPTY), _fromProperty(true) {}  
    _dataType(int type, const String ref) :  
      _type(type), _size(0), _reference(true), _array(false),  
      _refClass(ref), _fromProperty(true) {}  
 }; };
  
 #define VectorClassRef               classRefs[0] #define VectorClassRef               classRefs[0]
Line 229 
Line 362 
 #define CIMFlavorClassRef            classRefs[28] #define CIMFlavorClassRef            classRefs[28]
 #define CIMArgumentClassRef          classRefs[29] #define CIMArgumentClassRef          classRefs[29]
 #define CIMInstanceExceptionClassRef classRefs[30] #define CIMInstanceExceptionClassRef classRefs[30]
   #define CIMObjectClassRef            classRefs[31]
   #define CharacterClassRef            classRefs[32]
  
 #define BigIntegerValueOf            staticMethodIDs[0] #define BigIntegerValueOf            staticMethodIDs[0]
 #define JarClassLoaderLoad           staticMethodIDs[1] #define JarClassLoaderLoad           staticMethodIDs[1]
Line 279 
Line 414 
 #define CIMArgumentCInst             instMethodIDs[39] #define CIMArgumentCInst             instMethodIDs[39]
 #define ObjectToString               instMethodIDs[24] #define ObjectToString               instMethodIDs[24]
 #define ThrowableGetMessage          instMethodIDs[25] #define ThrowableGetMessage          instMethodIDs[25]
   #define CIMObjectNewIZ               instMethodIDs[46]
   #define CharacterNewC                instMethodIDs[47]
  
 //extern "C" JNIEnv* attachThread(JvmVector**); //extern "C" JNIEnv* attachThread(JvmVector**);
 //extern "C" void detachThread(); //extern "C" void detachThread();


Legend:
Removed from v.1.15  
changed lines
  Added in v.1.19

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2