1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESH_Gen_i.hxx
23 // Author : Paul RASCLE, EDF
26 #ifndef _SMESH_GEN_I_HXX_
27 #define _SMESH_GEN_I_HXX_
31 #include <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(SMESH_Gen)
33 #include CORBA_SERVER_HEADER(SMESH_Mesh)
34 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
35 #include CORBA_CLIENT_HEADER(GEOM_Gen)
36 #include CORBA_CLIENT_HEADER(SALOMEDS)
37 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
39 #include "SMESH_Mesh_i.hxx"
40 #include "SMESH_Hypothesis_i.hxx"
41 #include "SALOME_Component_i.hxx"
42 #include "SALOME_NamingService.hxx"
44 #include "SMESH_Gen.hxx"
45 #include "GEOM_Client.hxx"
47 #include <TCollection_AsciiString.hxx>
48 #include <Resource_DataMapOfAsciiStringAsciiString.hxx>
49 #include <TColStd_HSequenceOfAsciiString.hxx>
55 class SALOME_LifeCycleCORBA;
57 // ===========================================================
58 // Study context - stores study-connected objects references
59 // ==========================================================
60 class SMESH_I_EXPORT StudyContext
71 // register object in the internal map and return its id
72 int addObject( string theIOR )
74 int nextId = getNextId();
75 mapIdToIOR[ nextId ] = theIOR;
78 // find the object id in the internal map by the IOR
79 int findId( string theIOR )
81 map<int, string>::iterator imap;
82 for ( imap = mapIdToIOR.begin(); imap != mapIdToIOR.end(); ++imap ) {
83 if ( imap->second == theIOR )
88 // get object's IOR by id
89 string getIORbyId( const int theId )
91 if ( mapIdToIOR.find( theId ) != mapIdToIOR.end() )
92 return mapIdToIOR[ theId ];
95 // get object's IOR by old id
96 string getIORbyOldId( const int theOldId )
98 if ( mapIdToId.find( theOldId ) != mapIdToId.end() )
99 return getIORbyId( mapIdToId[ theOldId ] );
102 // maps old object id to the new one (used when restoring data)
103 void mapOldToNew( const int oldId, const int newId ) {
104 mapIdToId[ oldId ] = newId;
106 // get old id by a new one
107 int getOldId( const int newId ) {
108 map<int, int>::iterator imap;
109 for ( imap = mapIdToId.begin(); imap != mapIdToId.end(); ++imap ) {
110 if ( imap->second == newId )
117 // get next free object identifier
121 while( mapIdToIOR.find( id ) != mapIdToIOR.end() )
126 map<int, string> mapIdToIOR; // persistent-to-transient map
127 map<int, int> mapIdToId; // used to translate object from persistent to transient form
130 // ===========================================================
131 // SMESH module's engine
132 // ==========================================================
133 class SMESH_I_EXPORT SMESH_Gen_i:
134 public virtual POA_SMESH::SMESH_Gen,
135 public virtual Engines_Component_i
138 // Get last created instance of the class
139 static SMESH_Gen_i* GetSMESHGen() { return mySMESHGen;}
141 static CORBA::ORB_var GetORB() { return myOrb;}
142 // Get SMESH module's POA object
143 static PortableServer::POA_var GetPOA() { return myPoa;}
144 // Get Naming Service object
145 static SALOME_NamingService* GetNS();
146 // Get SALOME_LifeCycleCORBA object
147 static SALOME_LifeCycleCORBA* GetLCC();
148 // Retrieve and get GEOM engine reference
149 static GEOM::GEOM_Gen_var GetGeomEngine();
150 // Get object of the CORBA reference
151 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
152 // Get CORBA object corresponding to the SALOMEDS::SObject
153 static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
154 // Get the SALOMEDS::SObject corresponding to a CORBA object
155 static SALOMEDS::SObject_ptr ObjectToSObject(SALOMEDS::Study_ptr theStudy,
156 CORBA::Object_ptr theObject);
157 // Get GEOM Object correspoding to TopoDS_Shape
158 GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape );
159 // Get TopoDS_Shape correspoding to GEOM_Object
160 TopoDS_Shape GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject);
162 // Default constructor
164 // Standard constructor
165 SMESH_Gen_i( CORBA::ORB_ptr orb,
166 PortableServer::POA_ptr poa,
167 PortableServer::ObjectId* contId,
168 const char* instanceName,
169 const char* interfaceName );
171 virtual ~SMESH_Gen_i();
173 // *****************************************
175 // *****************************************
176 // Set a new Mesh object name
177 void SetName(const char* theIOR,
178 const char* theName);
180 //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
181 void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
184 void SetEmbeddedMode( CORBA::Boolean theMode );
186 CORBA::Boolean IsEmbeddedMode();
189 void SetCurrentStudy( SALOMEDS::Study_ptr theStudy );
191 SALOMEDS::Study_ptr GetCurrentStudy();
193 // Create hypothesis/algorothm of given type
194 SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
195 const char* theLibName)
196 throw ( SALOME::SALOME_Exception );
198 // Return hypothesis of given type holding parameter values of the existing mesh
199 SMESH::SMESH_Hypothesis_ptr GetHypothesisParameterValues (const char* theHypType,
200 const char* theLibName,
201 SMESH::SMESH_Mesh_ptr theMesh,
202 GEOM::GEOM_Object_ptr theGeom,
203 CORBA::Boolean byMesh)
204 throw ( SALOME::SALOME_Exception );
209 * Sets number of segments per diagonal of boundary box of geometry by which
210 * default segment length of appropriate 1D hypotheses is defined
212 void SetBoundaryBoxSegmentation( CORBA::Long theNbSegments ) throw ( SALOME::SALOME_Exception );
214 * \brief Sets default number of segments per edge
216 void SetDefaultNbSegments(CORBA::Long theNbSegments) throw ( SALOME::SALOME_Exception );
221 virtual void SetOption(const char*, const char*);
223 Return an option value
225 virtual char* GetOption(const char*);
228 * To load full mesh data from study at hyp modification or not
230 bool ToForgetMeshDataOnHypModif() const { return myToForgetMeshDataOnHypModif; }
233 // Create empty mesh on a shape
234 SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject )
235 throw ( SALOME::SALOME_Exception );
238 SMESH::SMESH_Mesh_ptr CreateEmptyMesh()
239 throw ( SALOME::SALOME_Exception );
241 // Create a mesh and import data from an UNV file
242 SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName )
243 throw ( SALOME::SALOME_Exception );
245 // Create mesh(es) and import data from MED file
246 SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName,
247 SMESH::DriverMED_ReadStatus& theStatus )
248 throw ( SALOME::SALOME_Exception );
250 // Create mesh(es) and import data from MED file
251 SMESH::mesh_array* CreateMeshesFromSAUV( const char* theFileName,
252 SMESH::DriverMED_ReadStatus& theStatus )
253 throw ( SALOME::SALOME_Exception );
255 // Create a mesh and import data from a STL file
256 SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName )
257 throw ( SALOME::SALOME_Exception );
259 // Create mesh(es) and import data from CGNS file
260 SMESH::mesh_array* CreateMeshesFromCGNS( const char* theFileName,
261 SMESH::DriverMED_ReadStatus& theStatus )
262 throw ( SALOME::SALOME_Exception );
264 // Create a mesh and import data from a GMF file
265 SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF( const char* theFileName,
266 CORBA::Boolean theMakeRequiredGroups,
267 SMESH::ComputeError_out theError)
268 throw ( SALOME::SALOME_Exception );
270 // Copy a part of mesh
271 SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
272 const char* meshName,
273 CORBA::Boolean toCopyGroups,
274 CORBA::Boolean toKeepIDs);
276 // Compute mesh on a shape
277 CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh,
278 GEOM::GEOM_Object_ptr theShapeObject )
279 throw ( SALOME::SALOME_Exception );
281 // Cancel Compute mesh on a shape
282 void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
283 GEOM::GEOM_Object_ptr theShapeObject );
286 * \brief Return errors of mesh computation
288 SMESH::compute_error_array* GetComputeErrors(SMESH::SMESH_Mesh_ptr theMesh,
289 GEOM::GEOM_Object_ptr theShapeObject )
290 throw ( SALOME::SALOME_Exception );
293 * Evaluate mesh on a shape and
294 * returns statistic of mesh elements
295 * Result array of number enityties
297 SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
298 GEOM::GEOM_Object_ptr theShapeObject)
299 throw ( SALOME::SALOME_Exception );
301 // Returns true if mesh contains enough data to be computed
302 CORBA::Boolean IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
303 GEOM::GEOM_Object_ptr theShapeObject )
304 throw ( SALOME::SALOME_Exception );
307 * Calculate Mesh as preview till indicated dimension on shape
308 * First, verify list of hypothesis associated with the subShape.
309 * Return mesh preview structure
311 SMESH::MeshPreviewStruct* Precompute( SMESH::SMESH_Mesh_ptr theMesh,
312 GEOM::GEOM_Object_ptr theSubObject,
313 SMESH::Dimension theDimension,
314 SMESH::long_array& theShapesId )
315 throw ( SALOME::SALOME_Exception );
317 // Returns errors of hypotheses definintion
318 SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh,
319 GEOM::GEOM_Object_ptr theSubObject )
320 throw ( SALOME::SALOME_Exception );
322 // Return mesh elements preventing computation of a subshape
323 SMESH::MeshPreviewStruct* GetBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
324 CORBA::Short theSubShapeID )
325 throw ( SALOME::SALOME_Exception );
327 // Get sub-shapes unique ID's list
328 SMESH::long_array* GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject,
329 const SMESH::object_array& theListOfSubShape )
330 throw ( SALOME::SALOME_Exception );
332 // Return geometrical object the given element is built on. Publish it in study.
333 GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
334 CORBA::Long theElementID,
335 const char* theGeomName)
336 throw ( SALOME::SALOME_Exception );
338 // Return geometrical object the given element is built on. Don't publish it in study.
339 GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
340 CORBA::Long theElementID)
341 throw ( SALOME::SALOME_Exception );
343 // Concatenate the given meshes into one mesh
344 SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::mesh_array& theMeshesArray,
345 CORBA::Boolean theUniteIdenticalGroups,
346 CORBA::Boolean theMergeNodesAndElements,
347 CORBA::Double theMergeTolerance,
348 CORBA::Boolean theCommonGroups)
349 throw ( SALOME::SALOME_Exception );
351 // Concatenate the given meshes into one mesh
352 SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::mesh_array& theMeshesArray,
353 CORBA::Boolean theUniteIdenticalGroups,
354 CORBA::Boolean theMergeNodesAndElements,
355 CORBA::Double theMergeTolerance)
356 throw ( SALOME::SALOME_Exception );
358 // Concatenate the given meshes into one mesh
359 // Create the groups of all elements from initial meshes
360 SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::mesh_array& theMeshesArray,
361 CORBA::Boolean theUniteIdenticalGroups,
362 CORBA::Boolean theMergeNodesAndElements,
363 CORBA::Double theMergeTolerance)
364 throw ( SALOME::SALOME_Exception );
366 // Get MED version of the file by its name
367 CORBA::Boolean GetMEDVersion(const char* theFileName,
368 SMESH::MED_VERSION& theVersion);
370 // Get names of meshes defined in file with the specified name
371 SMESH::string_array* GetMeshNames(const char* theFileName);
373 // ****************************************************
374 // Interface inherited methods (from SALOMEDS::Driver)
375 // ****************************************************
378 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
382 bool Load( SALOMEDS::SComponent_ptr theComponent,
383 const SALOMEDS::TMPFile& theStream,
386 // Save SMESH data in ASCII format
387 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
390 // Load SMESH data in ASCII format
391 bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
392 const SALOMEDS::TMPFile& theStream,
396 // Create filter manager
397 SMESH::FilterManager_ptr CreateFilterManager();
399 // Return a pattern mesher
400 SMESH::SMESH_Pattern_ptr GetPattern();
402 // Create measurement instance
403 SMESH::Measurements_ptr CreateMeasurements();
405 // Clears study-connected data when it is closed
406 void Close( SALOMEDS::SComponent_ptr theComponent );
408 // Get component data type
409 char* ComponentDataType();
411 // Transform data from transient form to persistent
412 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
413 const char* IORString,
414 CORBA::Boolean isMultiFile,
415 CORBA::Boolean isASCII );
416 // Transform data from persistent form to transient
417 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
418 const char* aLocalPersistentID,
419 CORBA::Boolean isMultiFile,
420 CORBA::Boolean isASCII );
422 // Returns true if object can be published in the study
423 bool CanPublishInStudy( CORBA::Object_ptr theIOR );
424 // Publish object in the study
425 SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::Study_ptr theStudy,
426 SALOMEDS::SObject_ptr theSObject,
427 CORBA::Object_ptr theObject,
428 const char* theName )
429 throw ( SALOME::SALOME_Exception );
431 // Copy-paste methods - returns true if object can be copied to the clipboard
432 CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr theObject ) { return false; }
433 // Copy-paste methods - copy object to the clipboard
434 SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID ) { return false; }
435 // Copy-paste methods - returns true if object can be pasted from the clipboard
436 CORBA::Boolean CanPaste( const char* theComponentName, CORBA::Long theObjectID ) { return false; }
437 // Copy-paste methods - paste object from the clipboard
438 SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile& theStream,
439 CORBA::Long theObjectID,
440 SALOMEDS::SObject_ptr theObject ) {
441 SALOMEDS::SObject_var aResultSO;
442 return aResultSO._retn();
446 // Version information
449 virtual char* getVersion();
455 virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
456 CORBA::Boolean isPublished,
457 CORBA::Boolean isMultiFile,
458 CORBA::Boolean& isValidScript);
460 void AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString);
462 void RemoveLastFromPythonScript (int theStudyID);
464 void SavePython (SALOMEDS::Study_ptr theStudy);
466 TCollection_AsciiString DumpPython_impl (SALOMEDS::Study_ptr theStudy,
467 Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
468 Resource_DataMapOfAsciiStringAsciiString& theNames,
471 bool isHistoricalDump,
473 const TCollection_AsciiString& theSavedTrace);
475 TCollection_AsciiString GetNewPythonLines (int theStudyID);
477 void CleanPythonTrace (int theStudyID);
480 // *****************************************
482 // *****************************************
485 GEOM_Client* GetShapeReader();
488 static long GetHypothesisRootTag();
489 static long GetAlgorithmsRootTag();
490 static long GetRefOnShapeTag();
491 static long GetRefOnAppliedHypothesisTag();
492 static long GetRefOnAppliedAlgorithmsTag();
493 static long GetSubMeshOnVertexTag();
494 static long GetSubMeshOnEdgeTag();
495 static long GetSubMeshOnFaceTag();
496 static long GetSubMeshOnSolidTag();
497 static long GetSubMeshOnCompoundTag();
498 static long GetSubMeshOnWireTag();
499 static long GetSubMeshOnShellTag();
500 static long GetNodeGroupsTag();
501 static long GetEdgeGroupsTag();
502 static long GetFaceGroupsTag();
503 static long GetVolumeGroupsTag();
504 static long Get0DElementsGroupsTag();
505 static long GetBallElementsGroupsTag();
507 // publishing methods
508 SALOMEDS::SComponent_ptr PublishComponent(SALOMEDS::Study_ptr theStudy);
509 SALOMEDS::SObject_ptr PublishMesh (SALOMEDS::Study_ptr theStudy,
510 SMESH::SMESH_Mesh_ptr theMesh,
511 const char* theName = 0);
512 SALOMEDS::SObject_ptr PublishHypothesis (SALOMEDS::Study_ptr theStudy,
513 SMESH::SMESH_Hypothesis_ptr theHyp,
514 const char* theName = 0);
515 SALOMEDS::SObject_ptr PublishSubMesh (SALOMEDS::Study_ptr theStudy,
516 SMESH::SMESH_Mesh_ptr theMesh,
517 SMESH::SMESH_subMesh_ptr theSubMesh,
518 GEOM::GEOM_Object_ptr theShapeObject,
519 const char* theName = 0);
520 SALOMEDS::SObject_ptr PublishGroup (SALOMEDS::Study_ptr theStudy,
521 SMESH::SMESH_Mesh_ptr theMesh,
522 SMESH::SMESH_GroupBase_ptr theGroup,
523 GEOM::GEOM_Object_ptr theShapeObject,
524 const char* theName = 0);
525 bool AddHypothesisToShape(SALOMEDS::Study_ptr theStudy,
526 SMESH::SMESH_Mesh_ptr theMesh,
527 GEOM::GEOM_Object_ptr theShapeObject,
528 SMESH::SMESH_Hypothesis_ptr theHyp);
529 bool RemoveHypothesisFromShape(SALOMEDS::Study_ptr theStudy,
530 SMESH::SMESH_Mesh_ptr theMesh,
531 GEOM::GEOM_Object_ptr theShapeObject,
532 SMESH::SMESH_Hypothesis_ptr theHyp);
533 SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SALOMEDS::Study_ptr theStudy,
534 SMESH::SMESH_Mesh_ptr theMesh,
535 GEOM::GEOM_Object_ptr theShape);
536 static void SetName(SALOMEDS::SObject_ptr theSObject,
538 const char* theDefaultName = 0);
540 static void SetPixMap(SALOMEDS::SObject_ptr theSObject,
541 const char* thePixMap);
544 StudyContext* GetCurrentStudyContext();
546 // Register an object in a StudyContext; return object id
547 int RegisterObject(CORBA::Object_ptr theObject);
549 // Return id of registered object
550 CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
552 // Return an object that previously had an oldID
553 template<class TInterface>
554 typename TInterface::_var_type GetObjectByOldId( const int oldID )
556 if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) {
557 string ior = myStudyContext->getIORbyOldId( oldID );
559 return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
561 return TInterface::_nil();
564 // Get current study ID
565 int GetCurrentStudyID();
568 * \brief Find SObject for an algo
570 SALOMEDS::SObject_ptr GetAlgoSO(const ::SMESH_Algo* algo);
572 void UpdateParameters(/*CORBA::Object_ptr theObject,*/ const char* theParameters);
573 char* GetParameters(CORBA::Object_ptr theObject);
574 char* ParseParameters(const char* theParameters);
575 const std::vector< std::string >& GetLastParameters() const { return myLastParameters; }
578 // Create hypothesis of given type
579 SMESH::SMESH_Hypothesis_ptr createHypothesis( const char* theHypName,
580 const char* theLibName)
581 throw ( SALOME::SALOME_Exception );
583 // Create empty mesh on shape
584 SMESH::SMESH_Mesh_ptr createMesh()
585 throw ( SALOME::SALOME_Exception );
587 static void loadGeomData( SALOMEDS::SComponent_ptr theCompRoot );
589 SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName,
590 SMESH::DriverMED_ReadStatus& theStatus,
591 const char* theCommandNameForPython,
592 const char* theFileNameForPython);
594 void setCurrentStudy( SALOMEDS::Study_ptr theStudy,
595 bool theStudyIsBeingClosed=false);
598 static GEOM::GEOM_Gen_var myGeomGen;
599 static CORBA::ORB_var myOrb; // ORB reference
600 static PortableServer::POA_var myPoa; // POA reference
601 static SALOME_NamingService* myNS; // Naming Service
602 static SALOME_LifeCycleCORBA* myLCC; // Life Cycle CORBA
603 static SMESH_Gen_i* mySMESHGen; // Point to last created instance of the class
604 ::SMESH_Gen myGen; // SMESH_Gen local implementation
606 // hypotheses managing
607 map<string, GenericHypothesisCreator_i*> myHypCreatorMap;
609 map<int, StudyContext*> myStudyContextMap; // Map of study context objects
611 GEOM_Client* myShapeReader; // Shape reader
612 SALOMEDS::Study_var myCurrentStudy; // Current study
613 CORBA::Boolean myIsEmbeddedMode; // Current mode
615 // To load full mesh data from study at hyp modification or not
616 bool myToForgetMeshDataOnHypModif;
618 // Dump Python: trace of API methods calls
619 std::map < int, Handle(TColStd_HSequenceOfAsciiString) > myPythonScripts;
620 bool myIsHistoricalPythonDump;
621 std::vector< std::string > myLastParameters;
629 DownCast(CORBA::Object_ptr theArg)
631 return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());