Version: 9.16.0
Salome_file_i.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20// File : Salome_file_i.hxx
21// Author : André RIBES, EDF
22// Module : SALOME
23// $Header:
24//
25#ifndef _SALOME_FILE_I_HXX_
26#define _SALOME_FILE_I_HXX_
27
28#include <SALOMEconfig.h>
29
30#include CORBA_SERVER_HEADER(SALOME_Component)
31#include CORBA_SERVER_HEADER(SALOME_Exception)
32
33#include "SALOME_Container.hxx"
35
36#include <map>
37#include <cstdio>
38#include <string>
39
41 public virtual POA_Engines::Salome_file,public virtual fileTransfer_i
42{
43 public:
45 virtual ~Salome_file_i();
46
47 // Import and export methods
48 virtual void load(const char* hdf5_file);
49 virtual void save(const char* hdf5_file);
50 virtual void save_all(const char* hdf5_file);
51
52 // Adding files
53 virtual void setLocalFile(const char* comp_file_name);
54 virtual void setDistributedFile(const char* comp_file_name);
55
56 // Configure DistributedFile
57 virtual void connect(Engines::Salome_file_ptr source_Salome_file);
58 virtual void connectDistributedFile(const char * file_name,
59 Engines::Salome_file_ptr source_Salome_file);
60 virtual void setDistributedSourceFile(const char* file_name,
61 const char * source_file_name);
62
63 // Recv and check files
64 virtual void recvFiles();
65
66 // Removing or deleting files
67 virtual void removeFile(const char* file_name);
68 virtual void removeFiles();
69
70 // Information methods:
71 virtual void setContainer(Engines::Container_ptr container);
72 virtual Engines::files* getFilesInfos();
73 virtual Engines::file* getFileInfos(const char* file_name);
74 virtual Engines::SfState* getSalome_fileState();
75
76 // ---------------- fileTransfert Methods -----------------------
77 virtual CORBA::Long open(const char* file_name);
78 virtual void close(CORBA::Long fileId);
79 virtual Engines::fileBlock* getBlock(CORBA::Long fileId);
80
81 protected:
82 // ---------------- local C++ methods ---------------------------
83 virtual bool checkLocalFile(std::string file_name);
84 virtual bool getDistributedFile(std::string file_name);
85
86 protected:
87
88 // Contains a relation between a file ID (int) with
89 // a fd descriptor (FILE*) open on the file.
90 typedef std::map<int, FILE*> _t_fileAccess;
91
92 // Contains the information of the files managed by the Salome_file.
93 typedef std::map<std::string, Engines::file> _t_fileManaged;
94
95 // Contains the CORBA reference for each distributed file managed.
96 typedef std::map<std::string, Engines::Salome_file_var> _t_fileDistributedSource;
97
104 Engines::Container_ptr _container;
105 Engines::Salome_file_var _default_source_Salome_file;
106};
107
108#endif
#define CONTAINER_EXPORT
Definition: SALOME_Container.hxx:37
A class to manage file transfer in SALOME.
Definition: Salome_file_i.hxx:42
int _fileId
Definition: Salome_file_i.hxx:98
Engines::Container_ptr _container
Definition: Salome_file_i.hxx:104
long _path_max
Definition: Salome_file_i.hxx:99
_t_fileAccess _fileAccess
Definition: Salome_file_i.hxx:100
Engines::SfState _state
Definition: Salome_file_i.hxx:103
std::map< std::string, Engines::Salome_file_var > _t_fileDistributedSource
Definition: Salome_file_i.hxx:96
_t_fileDistributedSource _fileDistributedSource
Definition: Salome_file_i.hxx:102
std::map< std::string, Engines::file > _t_fileManaged
Definition: Salome_file_i.hxx:93
Engines::Salome_file_var _default_source_Salome_file
Definition: Salome_file_i.hxx:105
_t_fileManaged _fileManaged
Definition: Salome_file_i.hxx:101
std::map< int, FILE * > _t_fileAccess
Definition: Salome_file_i.hxx:90
A class to manage file transfer in SALOME.
Definition: SALOME_FileTransfer_i.hxx:44
Engines::fileBlock * getBlock(CORBA::Long fileId)
get a data block from a file
Definition: SALOME_FileTransfer_i.cxx:116
CORBA::Long open(const char *fileName)
open the given file
Definition: SALOME_FileTransfer_i.cxx:68
void close(CORBA::Long fileId)
close a file
Definition: SALOME_FileTransfer_i.cxx:90
sequence< octet > fileBlock
A block of binary data used for file transfer. The maximum size of the block is defined on server sid...
Definition: SALOME_Component.idl:565
sequence< Engines::file > files
A sequence of Engines::file.
Definition: SALOME_Component.idl:628
container
Definition: TestComponentPy.py:63
def connect(args=None, env=None)
Definition: runConsole.py:195
The state of a Salome_file.
Definition: SALOME_Component.idl:632
A file managed by a Salome_file.
Definition: SALOME_Component.idl:614