1 #ifndef __SALOMEDS_DRIVER_I_H__
2 #define __SALOMEDS_DRIVER_I_H__
5 #include <TCollection_AsciiString.hxx>
6 #include "SALOMEDSImpl_Driver.hxx"
7 #include "SALOMEDSImpl_SComponent.hxx"
8 #include "SALOMEDSImpl_SObject.hxx"
10 #include <SALOMEconfig.h>
11 #include CORBA_SERVER_HEADER(SALOMEDS)
12 #include CORBA_SERVER_HEADER(SALOME_Component)
14 class Standard_EXPORT SALOMEDS_Driver_i : public virtual SALOMEDSImpl_Driver
17 SALOMEDS::Driver_var _driver;
22 SALOMEDS_Driver_i(SALOMEDS::Driver_ptr theDriver, CORBA::ORB_ptr theORB)
24 _driver = SALOMEDS::Driver::_duplicate(theDriver);
25 _orb = CORBA::ORB::_duplicate(theORB);
30 virtual TCollection_AsciiString GetIOR()
32 CORBA::String_var ior = _orb->object_to_string(_driver);
33 return TCollection_AsciiString(ior);
36 virtual unsigned char* Save(const Handle(SALOMEDSImpl_SComponent)& theComponent,
37 const TCollection_AsciiString& theURL,
38 long& theStreamLength,
41 virtual unsigned char* SaveASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
42 const TCollection_AsciiString& theURL,
43 long& theStreamLength,
46 virtual bool Load(const Handle(SALOMEDSImpl_SComponent)& theComponent,
47 const unsigned char* theStream,
48 const long theStreamLength,
49 const TCollection_AsciiString& theURL,
52 virtual bool LoadASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
53 const unsigned char* theStream,
54 const long theStreamLength,
55 const TCollection_AsciiString& theURL,
58 virtual void Close(const Handle(SALOMEDSImpl_SComponent)& theComponent);
60 virtual TCollection_AsciiString ComponentDataType()
62 CORBA::String_var ior = _driver->ComponentDataType();
63 return TCollection_AsciiString(ior);
67 virtual TCollection_AsciiString IORToLocalPersistentID(const Handle(SALOMEDSImpl_SObject)& theSObject,
68 const TCollection_AsciiString& IORString,
72 virtual TCollection_AsciiString LocalPersistentIDToIOR(const Handle(SALOMEDSImpl_SObject)& theSObject,
73 const TCollection_AsciiString& aLocalPersistentID,
77 virtual bool CanCopy(const Handle(SALOMEDSImpl_SObject)& theObject);
79 virtual unsigned char* CopyFrom(const Handle(SALOMEDSImpl_SObject)& theObject,
81 long& theStreamLength);
83 virtual bool CanPaste(const TCollection_AsciiString& theComponentName, int theObjectID);
85 virtual TCollection_AsciiString PasteInto(const unsigned char* theStream,
86 const long theStreamLength,
88 const Handle(SALOMEDSImpl_SObject)& theObject);
90 virtual unsigned char* DumpPython(const Handle(SALOMEDSImpl_Study)& theStudy,
93 long& theStreamLength);
96 #include "SALOME_NamingService.hxx"
97 #include "SALOME_LifeCycleCORBA.hxx"
99 class SALOMEDS_DriverFactory_i : public virtual SALOMEDSImpl_DriverFactory
103 SALOME_NamingService* _name_service;
107 SALOMEDS_DriverFactory_i(CORBA::ORB_ptr theORB)
109 _orb = CORBA::ORB::_duplicate(theORB);
110 _name_service = new SALOME_NamingService(_orb);
114 ~SALOMEDS_DriverFactory_i()
116 delete _name_service;
119 virtual SALOMEDSImpl_Driver* GetDriverByType(const TCollection_AsciiString& theComponentType);
121 virtual SALOMEDSImpl_Driver* GetDriverByIOR(const TCollection_AsciiString& theIOR);