Example #1
0
        static H5DLLImporter()
        {
            H5.open();

            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.Win32NT:
            case PlatformID.Win32S:
            case PlatformID.Win32Windows:
            case PlatformID.WinCE:
                Instance = new H5WindowsDLLImporter(Constants.DLLFileName);
                break;

            case PlatformID.Xbox:
            case PlatformID.MacOSX:
                Instance = new H5UnixDllImporter(Constants.DLLFileName);
                break;

            case PlatformID.Unix:
                //  Instance = new H5WindowsDLLImporter(Constants.DLLFileName);
                Instance = new H5UnixDllImporter(Constants.DLLFileName);
                break;

            default:
                throw new NotImplementedException();;
            }
        }
        static H5DLLImporter()
        {
            if (H5.open() < 0)
            {
                throw new Exception("Could not initialize HDF5 library.");
            }

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                Instance = new H5LinuxDllImporter(Constants.DLLFileName);
            }

            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                Instance = new H5MacDllImporter(Constants.DLLFileName);
            }

            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Instance = new H5WindowsDLLImporter(Constants.DLLFileName);
            }

            else
            {
                throw new PlatformNotSupportedException();
            }
        }
        static H5DLLImporter()
        {
            // .NET Framework does not automatically load libraries from the native runtimes folder like .NET Core.
            // Therefore, if running .NET Framework, switch the current directory to the native runtime folder
            // before attempting to load the native HDF5 library.
            bool changedCurrentDir = false;
            var  prevCurrentDir    = Directory.GetCurrentDirectory();

            if (RuntimeInformation.FrameworkDescription.Contains("Framework"))
            {
                var dllDir = Path.Combine(prevCurrentDir, string.Format(Constants.WindowsDLLPath, Environment.Is64BitProcess ? "64" : "86"));
                if (Directory.Exists(dllDir))
                {
                    Directory.SetCurrentDirectory(dllDir);
                    changedCurrentDir = true;
                }
            }

            try
            {
                if (H5.open() < 0)
                {
                    throw new Exception("Could not initialize HDF5 library.");
                }
            }
            finally
            {
                if (changedCurrentDir)
                {
                    Directory.SetCurrentDirectory(prevCurrentDir);
                }
            }

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                Instance = new H5LinuxDllImporter(Constants.DLLFileName);
            }

            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                Instance = new H5MacDllImporter(Constants.DLLFileName);
            }

            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Instance = new H5WindowsDLLImporter(Constants.DLLFileName);
            }

            else
            {
                throw new PlatformNotSupportedException();
            }
        }
Example #4
0
 static H5S()
 {
     H5.open();
 }
Example #5
0
 public extern static herr_t iterate_by_name(hid_t loc_id,
     string obj_name, H5.index_t idx_type, H5.iter_order_t order,
     ref hsize_t n, operator_t op, IntPtr op_data,
     hid_t lapd_id = H5P.DEFAULT);
Example #6
0
 public extern static ssize_t get_name_by_idx(hid_t loc_id, string obj_name, H5.index_t idx_type, H5.iter_order_t order, hsize_t n, IntPtr name, size_t size, hid_t lapl_id);
Example #7
0
 public extern static ssize_t get_name_by_idx
     (hid_t loc_id, byte[] obj_name,
     H5.index_t idx_type, H5.iter_order_t order, hsize_t n,
     [Out] byte[] name, size_t size, hid_t lapl_id = H5P.DEFAULT);
Example #8
0
 public extern static herr_t delete_by_idx
     (hid_t loc_id, byte[] obj_name, H5.index_t idx_type,
     H5.iter_order_t order, hsize_t n, hid_t lapl_id = H5P.DEFAULT);
Example #9
0
 public extern static herr_t visit_by_name
     (hid_t loc_id, string obj_name, H5.index_t idx_type,
     H5.iter_order_t order, iterate_t op, IntPtr op_data,
     hid_t lapl_id = H5P.DEFAULT);
Example #10
0
 public extern static hid_t open_by_idx
     (hid_t loc_id, byte[] group_name, H5.index_t idx_type,
     H5.iter_order_t order, hsize_t n, hid_t lapl_id = H5P.DEFAULT);
Example #11
0
 static H5AC()
 {
     H5.open();
 }
Example #12
0
 static H5D()
 {
     H5.open();
 }
Example #13
0
 static H5DO()
 {
     H5.open();
 }
Example #14
0
 static H5O()
 {
     H5.open();
 }
Example #15
0
 static H5G()
 {
     H5.open();
 }
Example #16
0
 static H5PL()
 {
     H5.open();
 }
Example #17
0
 static H5E()
 {
     H5.open();
 }
Example #18
0
 static H5I()
 {
     H5.open();
 }
Example #19
0
 public extern static herr_t visit
     (hid_t obj_id, H5.index_t idx_type, H5.iter_order_t order,
     iterate_t op, IntPtr op_data);
Example #20
0
 static H5FD()
 {
     H5.open();
 }
Example #21
0
 static H5F()
 {
     H5.open();
 }
Example #22
0
 static H5E()
 {
     H5.open();
     m_importer = H5DLLImporter.Create();
 }
Example #23
0
 public extern static herr_t get_info_by_idx
     (hid_t loc_id, string obj_name,
     H5.index_t idx_type, H5.iter_order_t order, hsize_t n,
     ref info_t ainfo, hid_t lapl_id = H5P.DEFAULT);
Example #24
0
 static H5R()
 {
     H5.open();
 }
Example #25
0
 public extern static ssize_t get_name_by_idx
     (hid_t loc_id, string obj_name,
     H5.index_t idx_type, H5.iter_order_t order, hsize_t n,
     StringBuilder name, size_t size, hid_t lapl_id = H5P.DEFAULT);
Example #26
0
 public extern static herr_t iterate_by_name
     (hid_t loc_id, byte[] group_name, H5.index_t idx_type,
     H5.iter_order_t order, ref hsize_t idx, iterate_t op,
     IntPtr op_data, hid_t lapl_id = H5P.DEFAULT);
Example #27
0
 public extern static herr_t iterate
     (hid_t obj_id, H5.index_t idx_type, H5.iter_order_t order,
     ref hsize_t n, operator_t op, IntPtr op_data);
Example #28
0
 public extern static herr_t get_val_by_idx
     (hid_t loc_id, string group_name, H5.index_t idx_type,
     H5.iter_order_t order, hsize_t n, [Out] IntPtr buf, size_t size,
     hid_t lapl_id = H5P.DEFAULT);
Example #29
0
 public extern static hid_t open_by_idx
     (hid_t loc_id, string obj_name,
     H5.index_t idx_type, H5.iter_order_t order, hsize_t n,
     hid_t aapl_id = H5P.DEFAULT, hid_t lapl_id = H5P.DEFAULT);
Example #30
0
 static H5Z()
 {
     H5.open();
 }